aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/ux500.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-10-31 11:12:43 -0400
committerFelipe Balbi <balbi@ti.com>2012-11-01 06:32:23 -0400
commit2f7711642559851c187d09795a3eb51c2bde36ec (patch)
treecc0663e2d53d0f4d6a5355c51fd5e30c843cafcd /drivers/usb/musb/ux500.c
parentb18d26f6ad8f00ea5f7c6a12ea52627ca3c3c6e2 (diff)
usb: musb: remove hand-crafted id handling
This replaced the handcrafted id handling by the PLATFORM_DEVID_AUTO value which should do the same thing. This patch probably also fixes ux500 because I did not find the "musbid" variable to remove. And we close a tiny-unlikely race window becuase the old code gave the id back before device was destroyed in the remove case. [ balbi@ti.com : fixed up two failed hunks when applying patch ] Cc: B, Ravi <ravibabu@ti.com> Cc: Santhapuri, Damodar <damodar.santhapuri@ti.com> Cc: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Cc: Bob Liu <lliubbo@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/ux500.c')
-rw-r--r--drivers/usb/musb/ux500.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c
index 4197f307ae0f..5e9053eb4298 100644
--- a/drivers/usb/musb/ux500.c
+++ b/drivers/usb/musb/ux500.c
@@ -65,7 +65,6 @@ static int __devinit ux500_probe(struct platform_device *pdev)
65 struct platform_device *musb; 65 struct platform_device *musb;
66 struct ux500_glue *glue; 66 struct ux500_glue *glue;
67 struct clk *clk; 67 struct clk *clk;
68
69 int ret = -ENOMEM; 68 int ret = -ENOMEM;
70 69
71 glue = kzalloc(sizeof(*glue), GFP_KERNEL); 70 glue = kzalloc(sizeof(*glue), GFP_KERNEL);
@@ -74,18 +73,10 @@ static int __devinit ux500_probe(struct platform_device *pdev)
74 goto err0; 73 goto err0;
75 } 74 }
76 75
77 /* get the musb id */ 76 musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
78 musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
79 if (musbid < 0) {
80 dev_err(&pdev->dev, "failed to allocate musb id\n");
81 ret = -ENOMEM;
82 goto err1;
83 }
84
85 musb = platform_device_alloc("musb-hdrc", musbid);
86 if (!musb) { 77 if (!musb) {
87 dev_err(&pdev->dev, "failed to allocate musb device\n"); 78 dev_err(&pdev->dev, "failed to allocate musb device\n");
88 goto err2; 79 goto err1;
89 } 80 }
90 81
91 clk = clk_get(&pdev->dev, "usb"); 82 clk = clk_get(&pdev->dev, "usb");
@@ -101,7 +92,6 @@ static int __devinit ux500_probe(struct platform_device *pdev)
101 goto err4; 92 goto err4;
102 } 93 }
103 94
104 musb->id = musbid;
105 musb->dev.parent = &pdev->dev; 95 musb->dev.parent = &pdev->dev;
106 musb->dev.dma_mask = pdev->dev.dma_mask; 96 musb->dev.dma_mask = pdev->dev.dma_mask;
107 musb->dev.coherent_dma_mask = pdev->dev.coherent_dma_mask; 97 musb->dev.coherent_dma_mask = pdev->dev.coherent_dma_mask;
@@ -144,9 +134,6 @@ err4:
144err3: 134err3:
145 platform_device_put(musb); 135 platform_device_put(musb);
146 136
147err2:
148 musb_put_id(&pdev->dev, musbid);
149
150err1: 137err1:
151 kfree(glue); 138 kfree(glue);
152 139
@@ -158,7 +145,6 @@ static int __devexit ux500_remove(struct platform_device *pdev)
158{ 145{
159 struct ux500_glue *glue = platform_get_drvdata(pdev); 146 struct ux500_glue *glue = platform_get_drvdata(pdev);
160 147
161 musb_put_id(&pdev->dev, glue->musb->id);
162 platform_device_unregister(glue->musb); 148 platform_device_unregister(glue->musb);
163 clk_disable(glue->clk); 149 clk_disable(glue->clk);
164 clk_put(glue->clk); 150 clk_put(glue->clk);