summaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-06-29 17:48:52 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-06 10:58:39 -0700
commit6bf83594e3fa1b1147ed1baff356d4fd30846b84 (patch)
tree65f768dae47c4901fada26b286fb7863ff8fd5e5 /drivers/usb/chipidea
parent17d2fcc393bfe58cc1e2bc34603a48e447ff7afb (diff)
downloadop-kernel-dev-6bf83594e3fa1b1147ed1baff356d4fd30846b84.zip
op-kernel-dev-6bf83594e3fa1b1147ed1baff356d4fd30846b84.tar.gz
usb: chipidea: msm: add remove method
allow this driver to be removed too. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea')
-rw-r--r--drivers/usb/chipidea/ci13xxx_msm.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/usb/chipidea/ci13xxx_msm.c b/drivers/usb/chipidea/ci13xxx_msm.c
index 8d438b8..11a7bef 100644
--- a/drivers/usb/chipidea/ci13xxx_msm.c
+++ b/drivers/usb/chipidea/ci13xxx_msm.c
@@ -84,6 +84,8 @@ static int __devinit ci13xxx_msm_probe(struct platform_device *pdev)
if (ret)
goto put_platform;
+ platform_set_drvdata(pdev, plat_ci);
+
pm_runtime_no_callbacks(&pdev->dev);
pm_runtime_enable(&pdev->dev);
@@ -95,16 +97,23 @@ put_platform:
return ret;
}
+static int __devexit ci13xxx_msm_remove(struct platform_device *pdev)
+{
+ struct platform_device *plat_ci = platform_get_drvdata(pdev);
+
+ pm_runtime_disable(&pdev->dev);
+ platform_device_unregister(plat_ci);
+
+ return 0;
+}
+
static struct platform_driver ci13xxx_msm_driver = {
.probe = ci13xxx_msm_probe,
+ .remove = __devexit_p(ci13xxx_msm_remove),
.driver = { .name = "msm_hsusb", },
};
-MODULE_ALIAS("platform:msm_hsusb");
-static int __init ci13xxx_msm_init(void)
-{
- return platform_driver_register(&ci13xxx_msm_driver);
-}
-module_init(ci13xxx_msm_init);
+module_platform_driver(ci13xxx_msm_driver);
+MODULE_ALIAS("platform:msm_hsusb");
MODULE_LICENSE("GPL v2");
OpenPOWER on IntegriCloud