Commit 310e9e334f60ca8282990a9c56678a4f58bce81f
Committed by
Greg Kroah-Hartman
1 parent
58c559e650
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
isp1760-if: make module unloads correctly
Without this patch, the prepared disable routines will not be called on module unloading. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 1 changed file with 8 additions and 0 deletions Side-by-side Diff
drivers/usb/host/isp1760-if.c
... | ... | @@ -398,6 +398,9 @@ |
398 | 398 | hcd = isp1760_register(mem_res->start, mem_size, irq_res->start, |
399 | 399 | irqflags, -ENOENT, |
400 | 400 | &pdev->dev, dev_name(&pdev->dev), devflags); |
401 | + | |
402 | + dev_set_drvdata(&pdev->dev, hcd); | |
403 | + | |
401 | 404 | if (IS_ERR(hcd)) { |
402 | 405 | pr_warning("isp1760: Failed to register the HCD device\n"); |
403 | 406 | ret = -ENODEV; |
404 | 407 | |
405 | 408 | |
... | ... | @@ -417,10 +420,15 @@ |
417 | 420 | { |
418 | 421 | struct resource *mem_res; |
419 | 422 | resource_size_t mem_size; |
423 | + struct usb_hcd *hcd = dev_get_drvdata(&pdev->dev); | |
420 | 424 | |
425 | + usb_remove_hcd(hcd); | |
426 | + | |
421 | 427 | mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
422 | 428 | mem_size = resource_size(mem_res); |
423 | 429 | release_mem_region(mem_res->start, mem_size); |
430 | + | |
431 | + usb_put_hcd(hcd); | |
424 | 432 | |
425 | 433 | return 0; |
426 | 434 | } |