diff options
Diffstat (limited to 'drivers/usb/gadget/s3c-hsudc.c')
-rw-r--r-- | drivers/usb/gadget/s3c-hsudc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c index 236b271871a0..e26a4e7ed2bf 100644 --- a/drivers/usb/gadget/s3c-hsudc.c +++ b/drivers/usb/gadget/s3c-hsudc.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
27 | #include <linux/err.h> | ||
27 | #include <linux/usb/ch9.h> | 28 | #include <linux/usb/ch9.h> |
28 | #include <linux/usb/gadget.h> | 29 | #include <linux/usb/gadget.h> |
29 | #include <linux/usb/otg.h> | 30 | #include <linux/usb/otg.h> |
@@ -1165,7 +1166,7 @@ static int s3c_hsudc_start(struct usb_gadget *gadget, | |||
1165 | } | 1166 | } |
1166 | 1167 | ||
1167 | /* connect to bus through transceiver */ | 1168 | /* connect to bus through transceiver */ |
1168 | if (hsudc->transceiver) { | 1169 | if (!IS_ERR_OR_NULL(hsudc->transceiver)) { |
1169 | ret = otg_set_peripheral(hsudc->transceiver->otg, | 1170 | ret = otg_set_peripheral(hsudc->transceiver->otg, |
1170 | &hsudc->gadget); | 1171 | &hsudc->gadget); |
1171 | if (ret) { | 1172 | if (ret) { |
@@ -1220,7 +1221,7 @@ static int s3c_hsudc_stop(struct usb_gadget *gadget, | |||
1220 | s3c_hsudc_stop_activity(hsudc); | 1221 | s3c_hsudc_stop_activity(hsudc); |
1221 | spin_unlock_irqrestore(&hsudc->lock, flags); | 1222 | spin_unlock_irqrestore(&hsudc->lock, flags); |
1222 | 1223 | ||
1223 | if (hsudc->transceiver) | 1224 | if (!IS_ERR_OR_NULL(hsudc->transceiver)) |
1224 | (void) otg_set_peripheral(hsudc->transceiver->otg, NULL); | 1225 | (void) otg_set_peripheral(hsudc->transceiver->otg, NULL); |
1225 | 1226 | ||
1226 | disable_irq(hsudc->irq); | 1227 | disable_irq(hsudc->irq); |
@@ -1249,7 +1250,7 @@ static int s3c_hsudc_vbus_draw(struct usb_gadget *gadget, unsigned mA) | |||
1249 | if (!hsudc) | 1250 | if (!hsudc) |
1250 | return -ENODEV; | 1251 | return -ENODEV; |
1251 | 1252 | ||
1252 | if (hsudc->transceiver) | 1253 | if (!IS_ERR_OR_NULL(hsudc->transceiver)) |
1253 | return usb_phy_set_power(hsudc->transceiver, mA); | 1254 | return usb_phy_set_power(hsudc->transceiver, mA); |
1254 | 1255 | ||
1255 | return -EOPNOTSUPP; | 1256 | return -EOPNOTSUPP; |
@@ -1282,7 +1283,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev) | |||
1282 | hsudc->dev = dev; | 1283 | hsudc->dev = dev; |
1283 | hsudc->pd = pdev->dev.platform_data; | 1284 | hsudc->pd = pdev->dev.platform_data; |
1284 | 1285 | ||
1285 | hsudc->transceiver = usb_get_transceiver(); | 1286 | hsudc->transceiver = usb_get_phy(USB_PHY_TYPE_USB2); |
1286 | 1287 | ||
1287 | for (i = 0; i < ARRAY_SIZE(hsudc->supplies); i++) | 1288 | for (i = 0; i < ARRAY_SIZE(hsudc->supplies); i++) |
1288 | hsudc->supplies[i].supply = s3c_hsudc_supply_names[i]; | 1289 | hsudc->supplies[i].supply = s3c_hsudc_supply_names[i]; |
@@ -1385,8 +1386,8 @@ err_irq: | |||
1385 | err_remap: | 1386 | err_remap: |
1386 | release_mem_region(res->start, resource_size(res)); | 1387 | release_mem_region(res->start, resource_size(res)); |
1387 | err_res: | 1388 | err_res: |
1388 | if (hsudc->transceiver) | 1389 | if (!IS_ERR_OR_NULL(hsudc->transceiver)) |
1389 | usb_put_transceiver(hsudc->transceiver); | 1390 | usb_put_phy(hsudc->transceiver); |
1390 | 1391 | ||
1391 | regulator_bulk_free(ARRAY_SIZE(hsudc->supplies), hsudc->supplies); | 1392 | regulator_bulk_free(ARRAY_SIZE(hsudc->supplies), hsudc->supplies); |
1392 | err_supplies: | 1393 | err_supplies: |