summaryrefslogtreecommitdiff
path: root/drivers/usb/musb/am35x.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-12 05:12:27 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-12 05:13:16 +0400
commit3a3f2e50951faaac1c67b5c6c0c70dec5b150e9b (patch)
treee27ce9aa85d26b978096a1eb6acbf4e297488953 /drivers/usb/musb/am35x.c
parent8e06c6a7f4404f10e6630932dffcb06de023a7a2 (diff)
parentd928cd2ef8f7f4194e479d4a66452901ec82ccda (diff)
downloadlinux-3a3f2e50951faaac1c67b5c6c0c70dec5b150e9b.tar.xz
Merge tag 'musb-for-v3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
USB musb merge from Felipe: "usb: musb: patches for v3.8 merge window We have here the usual set of cleanups for the MUSB driver; a big set of patches converting platform_device_del() and platform_device_put() into platform_device_unregister(). Another big set was applied converting to module_platform_driver() macro in order to reduce some boilerplate code from all glue layers. Other than that, we had a series fixing one known silicon errata where we couldn't read a few registers. In order to fix that we're now using shadow variables for reads and only writing to the registers which are known to break functionality when read."
Diffstat (limited to 'drivers/usb/musb/am35x.c')
-rw-r--r--drivers/usb/musb/am35x.c34
1 files changed, 4 insertions, 30 deletions
diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index c964d6af178b..3baccf765418 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -465,7 +465,6 @@ static int __devinit am35x_probe(struct platform_device *pdev)
struct clk *clk;
int ret = -ENOMEM;
- int musbid;
glue = kzalloc(sizeof(*glue), GFP_KERNEL);
if (!glue) {
@@ -473,18 +472,10 @@ static int __devinit am35x_probe(struct platform_device *pdev)
goto err0;
}
- /* get the musb id */
- musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
- if (musbid < 0) {
- dev_err(&pdev->dev, "failed to allocate musb id\n");
- ret = -ENOMEM;
- goto err1;
- }
-
- musb = platform_device_alloc("musb-hdrc", musbid);
+ musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
if (!musb) {
dev_err(&pdev->dev, "failed to allocate musb device\n");
- goto err2;
+ goto err1;
}
phy_clk = clk_get(&pdev->dev, "fck");
@@ -513,7 +504,6 @@ static int __devinit am35x_probe(struct platform_device *pdev)
goto err6;
}
- musb->id = musbid;
musb->dev.parent = &pdev->dev;
musb->dev.dma_mask = &am35x_dmamask;
musb->dev.coherent_dma_mask = am35x_dmamask;
@@ -563,9 +553,6 @@ err4:
err3:
platform_device_put(musb);
-err2:
- musb_put_id(&pdev->dev, musbid);
-
err1:
kfree(glue);
@@ -577,9 +564,7 @@ static int __devexit am35x_remove(struct platform_device *pdev)
{
struct am35x_glue *glue = platform_get_drvdata(pdev);
- musb_put_id(&pdev->dev, glue->musb->id);
- platform_device_del(glue->musb);
- platform_device_put(glue->musb);
+ platform_device_unregister(glue->musb);
clk_disable(glue->clk);
clk_disable(glue->phy_clk);
clk_put(glue->clk);
@@ -654,15 +639,4 @@ static struct platform_driver am35x_driver = {
MODULE_DESCRIPTION("AM35x MUSB Glue Layer");
MODULE_AUTHOR("Ajay Kumar Gupta <ajay.gupta@ti.com>");
MODULE_LICENSE("GPL v2");
-
-static int __init am35x_init(void)
-{
- return platform_driver_register(&am35x_driver);
-}
-module_init(am35x_init);
-
-static void __exit am35x_exit(void)
-{
- platform_driver_unregister(&am35x_driver);
-}
-module_exit(am35x_exit);
+module_platform_driver(am35x_driver);