Commit af32fe51 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Greg Kroah-Hartman

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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9a28b7bd
...@@ -352,9 +352,13 @@ static int __devinit usbhs_probe(struct platform_device *pdev) ...@@ -352,9 +352,13 @@ static int __devinit usbhs_probe(struct platform_device *pdev)
static int __devexit usbhs_remove(struct platform_device *pdev) static int __devexit usbhs_remove(struct platform_device *pdev)
{ {
struct usbhs_priv *priv = usbhsc_pdev_to_priv(pdev); struct usbhs_priv *priv = usbhsc_pdev_to_priv(pdev);
struct renesas_usbhs_platform_info *info = pdev->dev.platform_data;
struct renesas_usbhs_driver_callback *dfunc = &info->driver_callback;
dev_dbg(&pdev->dev, "usb remove\n"); dev_dbg(&pdev->dev, "usb remove\n");
dfunc->notify_hotplug = NULL;
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
usbhsc_bus_ctrl(priv, 0); usbhsc_bus_ctrl(priv, 0);
......
...@@ -143,7 +143,7 @@ struct renesas_usbhs_platform_info { ...@@ -143,7 +143,7 @@ struct renesas_usbhs_platform_info {
({ \ ({ \
struct renesas_usbhs_driver_callback *dc; \ struct renesas_usbhs_driver_callback *dc; \
dc = &(renesas_usbhs_get_info(pdev)->driver_callback); \ dc = &(renesas_usbhs_get_info(pdev)->driver_callback); \
if (dc) \ if (dc && dc->notify_hotplug) \
dc->notify_hotplug(pdev); \ dc->notify_hotplug(pdev); \
}) })
#endif /* RENESAS_USB_H */ #endif /* RENESAS_USB_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment