aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-04-21 01:10:16 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-29 20:24:32 -0400
commitaf32fe511374f17feb137d7fbfe2f4c73a8f531c (patch)
treecc60eb666cc945a39ce5e0ca4c7399aa8460af9b
parent9a28b7bd4f1fb388a15b12fb425a589ba6188425 (diff)
usb: renesas_usbhs: remove callback when module removed.
The callback function which is called from platform must be removed if module removed. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/renesas_usbhs/common.c4
-rw-r--r--include/linux/usb/renesas_usbhs.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index d9ad60d1c156..fda586d1f7d8 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -352,9 +352,13 @@ probe_end_kfree:
352static int __devexit usbhs_remove(struct platform_device *pdev) 352static int __devexit usbhs_remove(struct platform_device *pdev)
353{ 353{
354 struct usbhs_priv *priv = usbhsc_pdev_to_priv(pdev); 354 struct usbhs_priv *priv = usbhsc_pdev_to_priv(pdev);
355 struct renesas_usbhs_platform_info *info = pdev->dev.platform_data;
356 struct renesas_usbhs_driver_callback *dfunc = &info->driver_callback;
355 357
356 dev_dbg(&pdev->dev, "usb remove\n"); 358 dev_dbg(&pdev->dev, "usb remove\n");
357 359
360 dfunc->notify_hotplug = NULL;
361
358 pm_runtime_disable(&pdev->dev); 362 pm_runtime_disable(&pdev->dev);
359 363
360 usbhsc_bus_ctrl(priv, 0); 364 usbhsc_bus_ctrl(priv, 0);
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 565bca3aa440..66bbdd12d153 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -143,7 +143,7 @@ struct renesas_usbhs_platform_info {
143 ({ \ 143 ({ \
144 struct renesas_usbhs_driver_callback *dc; \ 144 struct renesas_usbhs_driver_callback *dc; \
145 dc = &(renesas_usbhs_get_info(pdev)->driver_callback); \ 145 dc = &(renesas_usbhs_get_info(pdev)->driver_callback); \
146 if (dc) \ 146 if (dc && dc->notify_hotplug) \
147 dc->notify_hotplug(pdev); \ 147 dc->notify_hotplug(pdev); \
148 }) 148 })
149#endif /* RENESAS_USB_H */ 149#endif /* RENESAS_USB_H */