diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-10-31 11:12:43 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-11-01 06:32:23 -0400 |
commit | 2f7711642559851c187d09795a3eb51c2bde36ec (patch) | |
tree | cc0663e2d53d0f4d6a5355c51fd5e30c843cafcd /drivers/usb/musb/tusb6010.c | |
parent | b18d26f6ad8f00ea5f7c6a12ea52627ca3c3c6e2 (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/tusb6010.c')
-rw-r--r-- | drivers/usb/musb/tusb6010.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 4454561c6f57..812719b683d1 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
@@ -1160,7 +1160,6 @@ static int __devinit tusb_probe(struct platform_device *pdev) | |||
1160 | struct tusb6010_glue *glue; | 1160 | struct tusb6010_glue *glue; |
1161 | 1161 | ||
1162 | int ret = -ENOMEM; | 1162 | int ret = -ENOMEM; |
1163 | int musbid; | ||
1164 | 1163 | ||
1165 | glue = kzalloc(sizeof(*glue), GFP_KERNEL); | 1164 | glue = kzalloc(sizeof(*glue), GFP_KERNEL); |
1166 | if (!glue) { | 1165 | if (!glue) { |
@@ -1168,21 +1167,12 @@ static int __devinit tusb_probe(struct platform_device *pdev) | |||
1168 | goto err0; | 1167 | goto err0; |
1169 | } | 1168 | } |
1170 | 1169 | ||
1171 | /* get the musb id */ | 1170 | musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO); |
1172 | musbid = musb_get_id(&pdev->dev, GFP_KERNEL); | ||
1173 | if (musbid < 0) { | ||
1174 | dev_err(&pdev->dev, "failed to allocate musb id\n"); | ||
1175 | ret = -ENOMEM; | ||
1176 | goto err1; | ||
1177 | } | ||
1178 | |||
1179 | musb = platform_device_alloc("musb-hdrc", musbid); | ||
1180 | if (!musb) { | 1171 | if (!musb) { |
1181 | dev_err(&pdev->dev, "failed to allocate musb device\n"); | 1172 | dev_err(&pdev->dev, "failed to allocate musb device\n"); |
1182 | goto err2; | 1173 | goto err1; |
1183 | } | 1174 | } |
1184 | 1175 | ||
1185 | musb->id = musbid; | ||
1186 | musb->dev.parent = &pdev->dev; | 1176 | musb->dev.parent = &pdev->dev; |
1187 | musb->dev.dma_mask = &tusb_dmamask; | 1177 | musb->dev.dma_mask = &tusb_dmamask; |
1188 | musb->dev.coherent_dma_mask = tusb_dmamask; | 1178 | musb->dev.coherent_dma_mask = tusb_dmamask; |
@@ -1218,9 +1208,6 @@ static int __devinit tusb_probe(struct platform_device *pdev) | |||
1218 | err3: | 1208 | err3: |
1219 | platform_device_put(musb); | 1209 | platform_device_put(musb); |
1220 | 1210 | ||
1221 | err2: | ||
1222 | musb_put_id(&pdev->dev, musbid); | ||
1223 | |||
1224 | err1: | 1211 | err1: |
1225 | kfree(glue); | 1212 | kfree(glue); |
1226 | 1213 | ||
@@ -1232,7 +1219,6 @@ static int __devexit tusb_remove(struct platform_device *pdev) | |||
1232 | { | 1219 | { |
1233 | struct tusb6010_glue *glue = platform_get_drvdata(pdev); | 1220 | struct tusb6010_glue *glue = platform_get_drvdata(pdev); |
1234 | 1221 | ||
1235 | musb_put_id(&pdev->dev, glue->musb->id); | ||
1236 | platform_device_unregister(glue->musb); | 1222 | platform_device_unregister(glue->musb); |
1237 | kfree(glue); | 1223 | kfree(glue); |
1238 | 1224 | ||