diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-15 12:52:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-15 12:52:04 -0400 |
commit | 4089ffd7665fabfbceb8bbbdce458fcc416f3733 (patch) | |
tree | a7a7c891c71025e45903ac9d37eab4eec684151a | |
parent | f722406faae2d073cc1d01063d1123c35425939e (diff) | |
parent | 4e0aa635d069478e73ad95ff21fd4ae144faa189 (diff) |
Merge tag 'fixes-for-v3.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus
Felipe writes:
usb: fixes for v3.10-rc2
Here's the initial set of fixes for v3.10-rc series. It countains miscellaneous
fixes in numerous drivers.
Many gadget drivers and PHY drivers learned that it's not necessary to
platform_set_drvdata() twice, that's not necessary to check the resource
pointer returned by platform_get_resource() when using devm_ioremap_resource()
and they learned that we shouldn't return 0 in case of errors.
DWC3 got a build fix for cases where DWC3 is marked as 'y' while gadget API is
marked as 'm'.
There's also a NULL pointer exception fix on usb_get_phy(), mxs-phy now knows
which PHY type it is and s3c-hsotg is now passing proper arguments to
usb_gadget_unmap_request().
Other than that there are some spelling fixes and kernel-doc warnings.
Signed-of-by: Felipe Balbi <balbi@ti.com>
32 files changed, 40 insertions, 71 deletions
diff --git a/drivers/staging/dwc2/Kconfig b/drivers/staging/dwc2/Kconfig index f0b4739c65a1..bbee1775d49e 100644 --- a/drivers/staging/dwc2/Kconfig +++ b/drivers/staging/dwc2/Kconfig | |||
@@ -2,7 +2,6 @@ config USB_DWC2 | |||
2 | tristate "DesignWare USB2 DRD Core Support" | 2 | tristate "DesignWare USB2 DRD Core Support" |
3 | depends on USB | 3 | depends on USB |
4 | depends on VIRT_TO_BUS | 4 | depends on VIRT_TO_BUS |
5 | select USB_OTG_UTILS | ||
6 | help | 5 | help |
7 | Say Y or M here if your system has a Dual Role HighSpeed | 6 | Say Y or M here if your system has a Dual Role HighSpeed |
8 | USB controller based on the DesignWare HSOTG IP Core. | 7 | USB controller based on the DesignWare HSOTG IP Core. |
diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig index ea5ee9c21c35..757aa18027d0 100644 --- a/drivers/usb/dwc3/Kconfig +++ b/drivers/usb/dwc3/Kconfig | |||
@@ -19,21 +19,21 @@ choice | |||
19 | 19 | ||
20 | config USB_DWC3_HOST | 20 | config USB_DWC3_HOST |
21 | bool "Host only mode" | 21 | bool "Host only mode" |
22 | depends on USB | 22 | depends on USB=y || USB=USB_DWC3 |
23 | help | 23 | help |
24 | Select this when you want to use DWC3 in host mode only, | 24 | Select this when you want to use DWC3 in host mode only, |
25 | thereby the gadget feature will be regressed. | 25 | thereby the gadget feature will be regressed. |
26 | 26 | ||
27 | config USB_DWC3_GADGET | 27 | config USB_DWC3_GADGET |
28 | bool "Gadget only mode" | 28 | bool "Gadget only mode" |
29 | depends on USB_GADGET | 29 | depends on USB_GADGET=y || USB_GADGET=USB_DWC3 |
30 | help | 30 | help |
31 | Select this when you want to use DWC3 in gadget mode only, | 31 | Select this when you want to use DWC3 in gadget mode only, |
32 | thereby the host feature will be regressed. | 32 | thereby the host feature will be regressed. |
33 | 33 | ||
34 | config USB_DWC3_DUAL_ROLE | 34 | config USB_DWC3_DUAL_ROLE |
35 | bool "Dual Role mode" | 35 | bool "Dual Role mode" |
36 | depends on (USB && USB_GADGET) | 36 | depends on ((USB=y || USB=USB_DWC3) && (USB_GADGET=y || USB_GADGET=USB_DWC3)) |
37 | help | 37 | help |
38 | This is the default mode of working of DWC3 controller where | 38 | This is the default mode of working of DWC3 controller where |
39 | both host and gadget features are enabled. | 39 | both host and gadget features are enabled. |
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 83300d94a893..f41aa0d0c414 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig | |||
@@ -146,7 +146,6 @@ config USB_LPC32XX | |||
146 | depends on ARCH_LPC32XX | 146 | depends on ARCH_LPC32XX |
147 | depends on USB_PHY | 147 | depends on USB_PHY |
148 | select USB_ISP1301 | 148 | select USB_ISP1301 |
149 | select USB_OTG_UTILS | ||
150 | help | 149 | help |
151 | This option selects the USB device controller in the LPC32xx SoC. | 150 | This option selects the USB device controller in the LPC32xx SoC. |
152 | 151 | ||
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index f2a970f75bfa..5a5128a226f7 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c | |||
@@ -1992,8 +1992,6 @@ err_map_regs: | |||
1992 | err_get_hclk: | 1992 | err_get_hclk: |
1993 | clk_put(pclk); | 1993 | clk_put(pclk); |
1994 | 1994 | ||
1995 | platform_set_drvdata(pdev, NULL); | ||
1996 | |||
1997 | return ret; | 1995 | return ret; |
1998 | } | 1996 | } |
1999 | 1997 | ||
diff --git a/drivers/usb/gadget/bcm63xx_udc.c b/drivers/usb/gadget/bcm63xx_udc.c index 6e6518264c42..fd24cb4540a4 100644 --- a/drivers/usb/gadget/bcm63xx_udc.c +++ b/drivers/usb/gadget/bcm63xx_udc.c | |||
@@ -2334,21 +2334,11 @@ static int bcm63xx_udc_probe(struct platform_device *pdev) | |||
2334 | } | 2334 | } |
2335 | 2335 | ||
2336 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 2336 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
2337 | if (!res) { | ||
2338 | dev_err(dev, "error finding USBD resource\n"); | ||
2339 | return -ENXIO; | ||
2340 | } | ||
2341 | |||
2342 | udc->usbd_regs = devm_ioremap_resource(dev, res); | 2337 | udc->usbd_regs = devm_ioremap_resource(dev, res); |
2343 | if (IS_ERR(udc->usbd_regs)) | 2338 | if (IS_ERR(udc->usbd_regs)) |
2344 | return PTR_ERR(udc->usbd_regs); | 2339 | return PTR_ERR(udc->usbd_regs); |
2345 | 2340 | ||
2346 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 2341 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
2347 | if (!res) { | ||
2348 | dev_err(dev, "error finding IUDMA resource\n"); | ||
2349 | return -ENXIO; | ||
2350 | } | ||
2351 | |||
2352 | udc->iudma_regs = devm_ioremap_resource(dev, res); | 2342 | udc->iudma_regs = devm_ioremap_resource(dev, res); |
2353 | if (IS_ERR(udc->iudma_regs)) | 2343 | if (IS_ERR(udc->iudma_regs)) |
2354 | return PTR_ERR(udc->iudma_regs); | 2344 | return PTR_ERR(udc->iudma_regs); |
@@ -2420,7 +2410,6 @@ static int bcm63xx_udc_remove(struct platform_device *pdev) | |||
2420 | usb_del_gadget_udc(&udc->gadget); | 2410 | usb_del_gadget_udc(&udc->gadget); |
2421 | BUG_ON(udc->driver); | 2411 | BUG_ON(udc->driver); |
2422 | 2412 | ||
2423 | platform_set_drvdata(pdev, NULL); | ||
2424 | bcm63xx_uninit_udc_hw(udc); | 2413 | bcm63xx_uninit_udc_hw(udc); |
2425 | 2414 | ||
2426 | return 0; | 2415 | return 0; |
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index 3d5cfc9c2c78..80e7f75a56c7 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c | |||
@@ -821,8 +821,10 @@ static int configfs_composite_bind(struct usb_gadget *gadget, | |||
821 | gi->gstrings[i] = NULL; | 821 | gi->gstrings[i] = NULL; |
822 | s = usb_gstrings_attach(&gi->cdev, gi->gstrings, | 822 | s = usb_gstrings_attach(&gi->cdev, gi->gstrings, |
823 | USB_GADGET_FIRST_AVAIL_IDX); | 823 | USB_GADGET_FIRST_AVAIL_IDX); |
824 | if (IS_ERR(s)) | 824 | if (IS_ERR(s)) { |
825 | ret = PTR_ERR(s); | ||
825 | goto err_comp_cleanup; | 826 | goto err_comp_cleanup; |
827 | } | ||
826 | 828 | ||
827 | gi->cdev.desc.iManufacturer = s[USB_GADGET_MANUFACTURER_IDX].id; | 829 | gi->cdev.desc.iManufacturer = s[USB_GADGET_MANUFACTURER_IDX].id; |
828 | gi->cdev.desc.iProduct = s[USB_GADGET_PRODUCT_IDX].id; | 830 | gi->cdev.desc.iProduct = s[USB_GADGET_PRODUCT_IDX].id; |
@@ -847,8 +849,10 @@ static int configfs_composite_bind(struct usb_gadget *gadget, | |||
847 | } | 849 | } |
848 | cfg->gstrings[i] = NULL; | 850 | cfg->gstrings[i] = NULL; |
849 | s = usb_gstrings_attach(&gi->cdev, cfg->gstrings, 1); | 851 | s = usb_gstrings_attach(&gi->cdev, cfg->gstrings, 1); |
850 | if (IS_ERR(s)) | 852 | if (IS_ERR(s)) { |
853 | ret = PTR_ERR(s); | ||
851 | goto err_comp_cleanup; | 854 | goto err_comp_cleanup; |
855 | } | ||
852 | c->iConfiguration = s[0].id; | 856 | c->iConfiguration = s[0].id; |
853 | } | 857 | } |
854 | 858 | ||
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index a792e322f4f1..c588e8e486e5 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c | |||
@@ -1001,7 +1001,6 @@ static int dummy_udc_remove(struct platform_device *pdev) | |||
1001 | struct dummy *dum = platform_get_drvdata(pdev); | 1001 | struct dummy *dum = platform_get_drvdata(pdev); |
1002 | 1002 | ||
1003 | usb_del_gadget_udc(&dum->gadget); | 1003 | usb_del_gadget_udc(&dum->gadget); |
1004 | platform_set_drvdata(pdev, NULL); | ||
1005 | device_remove_file(&dum->gadget.dev, &dev_attr_function); | 1004 | device_remove_file(&dum->gadget.dev, &dev_attr_function); |
1006 | return 0; | 1005 | return 0; |
1007 | } | 1006 | } |
@@ -2661,8 +2660,10 @@ static int __init init(void) | |||
2661 | } | 2660 | } |
2662 | for (i = 0; i < mod_data.num; i++) { | 2661 | for (i = 0; i < mod_data.num; i++) { |
2663 | dum[i] = kzalloc(sizeof(struct dummy), GFP_KERNEL); | 2662 | dum[i] = kzalloc(sizeof(struct dummy), GFP_KERNEL); |
2664 | if (!dum[i]) | 2663 | if (!dum[i]) { |
2664 | retval = -ENOMEM; | ||
2665 | goto err_add_pdata; | 2665 | goto err_add_pdata; |
2666 | } | ||
2666 | retval = platform_device_add_data(the_hcd_pdev[i], &dum[i], | 2667 | retval = platform_device_add_data(the_hcd_pdev[i], &dum[i], |
2667 | sizeof(void *)); | 2668 | sizeof(void *)); |
2668 | if (retval) | 2669 | if (retval) |
diff --git a/drivers/usb/gadget/f_ecm.c b/drivers/usb/gadget/f_ecm.c index d893d6929079..abf8a31ae146 100644 --- a/drivers/usb/gadget/f_ecm.c +++ b/drivers/usb/gadget/f_ecm.c | |||
@@ -816,6 +816,7 @@ ecm_unbind(struct usb_configuration *c, struct usb_function *f) | |||
816 | * @c: the configuration to support the network link | 816 | * @c: the configuration to support the network link |
817 | * @ethaddr: a buffer in which the ethernet address of the host side | 817 | * @ethaddr: a buffer in which the ethernet address of the host side |
818 | * side of the link was recorded | 818 | * side of the link was recorded |
819 | * @dev: eth_dev structure | ||
819 | * Context: single threaded during gadget setup | 820 | * Context: single threaded during gadget setup |
820 | * | 821 | * |
821 | * Returns zero on success, else negative errno. | 822 | * Returns zero on success, else negative errno. |
diff --git a/drivers/usb/gadget/f_subset.c b/drivers/usb/gadget/f_subset.c index 185d6f5e4e4d..7be04b342494 100644 --- a/drivers/usb/gadget/f_subset.c +++ b/drivers/usb/gadget/f_subset.c | |||
@@ -373,6 +373,7 @@ geth_unbind(struct usb_configuration *c, struct usb_function *f) | |||
373 | * @c: the configuration to support the network link | 373 | * @c: the configuration to support the network link |
374 | * @ethaddr: a buffer in which the ethernet address of the host side | 374 | * @ethaddr: a buffer in which the ethernet address of the host side |
375 | * side of the link was recorded | 375 | * side of the link was recorded |
376 | * @dev: eth_dev structure | ||
376 | * Context: single threaded during gadget setup | 377 | * Context: single threaded during gadget setup |
377 | * | 378 | * |
378 | * Returns zero on success, else negative errno. | 379 | * Returns zero on success, else negative errno. |
diff --git a/drivers/usb/gadget/f_uac2.c b/drivers/usb/gadget/f_uac2.c index c7468b6c07b0..03c1fb686644 100644 --- a/drivers/usb/gadget/f_uac2.c +++ b/drivers/usb/gadget/f_uac2.c | |||
@@ -456,8 +456,6 @@ static int snd_uac2_remove(struct platform_device *pdev) | |||
456 | { | 456 | { |
457 | struct snd_card *card = platform_get_drvdata(pdev); | 457 | struct snd_card *card = platform_get_drvdata(pdev); |
458 | 458 | ||
459 | platform_set_drvdata(pdev, NULL); | ||
460 | |||
461 | if (card) | 459 | if (card) |
462 | return snd_card_free(card); | 460 | return snd_card_free(card); |
463 | 461 | ||
diff --git a/drivers/usb/gadget/fusb300_udc.c b/drivers/usb/gadget/fusb300_udc.c index cec8871b77f9..b8632d40f8bf 100644 --- a/drivers/usb/gadget/fusb300_udc.c +++ b/drivers/usb/gadget/fusb300_udc.c | |||
@@ -1461,8 +1461,10 @@ static int __init fusb300_probe(struct platform_device *pdev) | |||
1461 | 1461 | ||
1462 | fusb300->ep0_req = fusb300_alloc_request(&fusb300->ep[0]->ep, | 1462 | fusb300->ep0_req = fusb300_alloc_request(&fusb300->ep[0]->ep, |
1463 | GFP_KERNEL); | 1463 | GFP_KERNEL); |
1464 | if (fusb300->ep0_req == NULL) | 1464 | if (fusb300->ep0_req == NULL) { |
1465 | ret = -ENOMEM; | ||
1465 | goto clean_up3; | 1466 | goto clean_up3; |
1467 | } | ||
1466 | 1468 | ||
1467 | init_controller(fusb300); | 1469 | init_controller(fusb300); |
1468 | ret = usb_add_gadget_udc(&pdev->dev, &fusb300->gadget); | 1470 | ret = usb_add_gadget_udc(&pdev->dev, &fusb300->gadget); |
diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c index b5cebd6b0d7a..9b2d24e4c95f 100644 --- a/drivers/usb/gadget/imx_udc.c +++ b/drivers/usb/gadget/imx_udc.c | |||
@@ -1511,8 +1511,6 @@ static int __exit imx_udc_remove(struct platform_device *pdev) | |||
1511 | if (pdata->exit) | 1511 | if (pdata->exit) |
1512 | pdata->exit(&pdev->dev); | 1512 | pdata->exit(&pdev->dev); |
1513 | 1513 | ||
1514 | platform_set_drvdata(pdev, NULL); | ||
1515 | |||
1516 | return 0; | 1514 | return 0; |
1517 | } | 1515 | } |
1518 | 1516 | ||
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c index 866ef0999247..51cfe72da5bb 100644 --- a/drivers/usb/gadget/m66592-udc.c +++ b/drivers/usb/gadget/m66592-udc.c | |||
@@ -1660,8 +1660,10 @@ static int __init m66592_probe(struct platform_device *pdev) | |||
1660 | m66592->epaddr2ep[0] = &m66592->ep[0]; | 1660 | m66592->epaddr2ep[0] = &m66592->ep[0]; |
1661 | 1661 | ||
1662 | m66592->ep0_req = m66592_alloc_request(&m66592->ep[0].ep, GFP_KERNEL); | 1662 | m66592->ep0_req = m66592_alloc_request(&m66592->ep[0].ep, GFP_KERNEL); |
1663 | if (m66592->ep0_req == NULL) | 1663 | if (m66592->ep0_req == NULL) { |
1664 | ret = -ENOMEM; | ||
1664 | goto clean_up3; | 1665 | goto clean_up3; |
1666 | } | ||
1665 | m66592->ep0_req->complete = nop_completion; | 1667 | m66592->ep0_req->complete = nop_completion; |
1666 | 1668 | ||
1667 | init_controller(m66592); | 1669 | init_controller(m66592); |
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index ef47495dec8f..95c531d5aa4f 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c | |||
@@ -2236,7 +2236,6 @@ static int __exit pxa25x_udc_remove(struct platform_device *pdev) | |||
2236 | dev->transceiver = NULL; | 2236 | dev->transceiver = NULL; |
2237 | } | 2237 | } |
2238 | 2238 | ||
2239 | platform_set_drvdata(pdev, NULL); | ||
2240 | the_controller = NULL; | 2239 | the_controller = NULL; |
2241 | return 0; | 2240 | return 0; |
2242 | } | 2241 | } |
diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c index 0b742d171843..7ff7d9cf2061 100644 --- a/drivers/usb/gadget/r8a66597-udc.c +++ b/drivers/usb/gadget/r8a66597-udc.c | |||
@@ -1977,8 +1977,10 @@ static int __init r8a66597_probe(struct platform_device *pdev) | |||
1977 | 1977 | ||
1978 | r8a66597->ep0_req = r8a66597_alloc_request(&r8a66597->ep[0].ep, | 1978 | r8a66597->ep0_req = r8a66597_alloc_request(&r8a66597->ep[0].ep, |
1979 | GFP_KERNEL); | 1979 | GFP_KERNEL); |
1980 | if (r8a66597->ep0_req == NULL) | 1980 | if (r8a66597->ep0_req == NULL) { |
1981 | ret = -ENOMEM; | ||
1981 | goto clean_up3; | 1982 | goto clean_up3; |
1983 | } | ||
1982 | r8a66597->ep0_req->complete = nop_completion; | 1984 | r8a66597->ep0_req->complete = nop_completion; |
1983 | 1985 | ||
1984 | ret = usb_add_gadget_udc(&pdev->dev, &r8a66597->gadget); | 1986 | ret = usb_add_gadget_udc(&pdev->dev, &r8a66597->gadget); |
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index a3cdc32115d5..af22f24046b2 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -437,7 +437,7 @@ static void s3c_hsotg_unmap_dma(struct s3c_hsotg *hsotg, | |||
437 | if (hs_req->req.length == 0) | 437 | if (hs_req->req.length == 0) |
438 | return; | 438 | return; |
439 | 439 | ||
440 | usb_gadget_unmap_request(&hsotg->gadget, hs_req, hs_ep->dir_in); | 440 | usb_gadget_unmap_request(&hsotg->gadget, req, hs_ep->dir_in); |
441 | } | 441 | } |
442 | 442 | ||
443 | /** | 443 | /** |
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index d0e75e1b3ccb..09c4f70c93c4 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c | |||
@@ -1851,6 +1851,7 @@ static int s3c2410_udc_probe(struct platform_device *pdev) | |||
1851 | irq = gpio_to_irq(udc_info->vbus_pin); | 1851 | irq = gpio_to_irq(udc_info->vbus_pin); |
1852 | if (irq < 0) { | 1852 | if (irq < 0) { |
1853 | dev_err(dev, "no irq for gpio vbus pin\n"); | 1853 | dev_err(dev, "no irq for gpio vbus pin\n"); |
1854 | retval = irq; | ||
1854 | goto err_gpio_claim; | 1855 | goto err_gpio_claim; |
1855 | } | 1856 | } |
1856 | 1857 | ||
@@ -1948,8 +1949,6 @@ static int s3c2410_udc_remove(struct platform_device *pdev) | |||
1948 | iounmap(base_addr); | 1949 | iounmap(base_addr); |
1949 | release_mem_region(rsrc_start, rsrc_len); | 1950 | release_mem_region(rsrc_start, rsrc_len); |
1950 | 1951 | ||
1951 | platform_set_drvdata(pdev, NULL); | ||
1952 | |||
1953 | if (!IS_ERR(udc_clock) && udc_clock != NULL) { | 1952 | if (!IS_ERR(udc_clock) && udc_clock != NULL) { |
1954 | clk_disable(udc_clock); | 1953 | clk_disable(udc_clock); |
1955 | clk_put(udc_clock); | 1954 | clk_put(udc_clock); |
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c index 2cd6262e8b71..0deb9d6cde26 100644 --- a/drivers/usb/gadget/zero.c +++ b/drivers/usb/gadget/zero.c | |||
@@ -284,12 +284,16 @@ static int __init zero_bind(struct usb_composite_dev *cdev) | |||
284 | ss_opts->bulk_buflen = gzero_options.bulk_buflen; | 284 | ss_opts->bulk_buflen = gzero_options.bulk_buflen; |
285 | 285 | ||
286 | func_ss = usb_get_function(func_inst_ss); | 286 | func_ss = usb_get_function(func_inst_ss); |
287 | if (IS_ERR(func_ss)) | 287 | if (IS_ERR(func_ss)) { |
288 | status = PTR_ERR(func_ss); | ||
288 | goto err_put_func_inst_ss; | 289 | goto err_put_func_inst_ss; |
290 | } | ||
289 | 291 | ||
290 | func_inst_lb = usb_get_function_instance("Loopback"); | 292 | func_inst_lb = usb_get_function_instance("Loopback"); |
291 | if (IS_ERR(func_inst_lb)) | 293 | if (IS_ERR(func_inst_lb)) { |
294 | status = PTR_ERR(func_inst_lb); | ||
292 | goto err_put_func_ss; | 295 | goto err_put_func_ss; |
296 | } | ||
293 | 297 | ||
294 | lb_opts = container_of(func_inst_lb, struct f_lb_opts, func_inst); | 298 | lb_opts = container_of(func_inst_lb, struct f_lb_opts, func_inst); |
295 | lb_opts->bulk_buflen = gzero_options.bulk_buflen; | 299 | lb_opts->bulk_buflen = gzero_options.bulk_buflen; |
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index 3a18e44e9391..e1b661d04021 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c | |||
@@ -560,6 +560,7 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue, u8 id) | |||
560 | if (!config) { | 560 | if (!config) { |
561 | dev_err(&pdev->dev, | 561 | dev_err(&pdev->dev, |
562 | "failed to allocate musb hdrc config\n"); | 562 | "failed to allocate musb hdrc config\n"); |
563 | ret = -ENOMEM; | ||
563 | goto err2; | 564 | goto err2; |
564 | } | 565 | } |
565 | 566 | ||
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 3551f1a30c65..628b93fe5ccc 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -549,7 +549,8 @@ static int omap2430_probe(struct platform_device *pdev) | |||
549 | glue->control_otghs = omap_get_control_dev(); | 549 | glue->control_otghs = omap_get_control_dev(); |
550 | if (IS_ERR(glue->control_otghs)) { | 550 | if (IS_ERR(glue->control_otghs)) { |
551 | dev_vdbg(&pdev->dev, "Failed to get control device\n"); | 551 | dev_vdbg(&pdev->dev, "Failed to get control device\n"); |
552 | return -ENODEV; | 552 | ret = PTR_ERR(glue->control_otghs); |
553 | goto err2; | ||
553 | } | 554 | } |
554 | } else { | 555 | } else { |
555 | glue->control_otghs = ERR_PTR(-ENODEV); | 556 | glue->control_otghs = ERR_PTR(-ENODEV); |
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index 371d0e74e909..5053cea0ad89 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig | |||
@@ -139,7 +139,6 @@ config USB_ISP1301 | |||
139 | tristate "NXP ISP1301 USB transceiver support" | 139 | tristate "NXP ISP1301 USB transceiver support" |
140 | depends on USB || USB_GADGET | 140 | depends on USB || USB_GADGET |
141 | depends on I2C | 141 | depends on I2C |
142 | select USB_OTG_UTILS | ||
143 | help | 142 | help |
144 | Say Y here to add support for the NXP ISP1301 USB transceiver driver. | 143 | Say Y here to add support for the NXP ISP1301 USB transceiver driver. |
145 | This chip is typically used as USB transceiver for USB host, gadget | 144 | This chip is typically used as USB transceiver for USB host, gadget |
diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c index 4acef26a2ef5..e5eb1b5a04eb 100644 --- a/drivers/usb/phy/phy-ab8500-usb.c +++ b/drivers/usb/phy/phy-ab8500-usb.c | |||
@@ -892,8 +892,6 @@ static int ab8500_usb_remove(struct platform_device *pdev) | |||
892 | else if (ab->mode == USB_PERIPHERAL) | 892 | else if (ab->mode == USB_PERIPHERAL) |
893 | ab8500_usb_peri_phy_dis(ab); | 893 | ab8500_usb_peri_phy_dis(ab); |
894 | 894 | ||
895 | platform_set_drvdata(pdev, NULL); | ||
896 | |||
897 | return 0; | 895 | return 0; |
898 | } | 896 | } |
899 | 897 | ||
diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c index 97b9308507c3..e771bafb9f1d 100644 --- a/drivers/usb/phy/phy-fsl-usb.c +++ b/drivers/usb/phy/phy-fsl-usb.c | |||
@@ -799,6 +799,7 @@ static int fsl_otg_conf(struct platform_device *pdev) | |||
799 | 799 | ||
800 | /* initialize the otg structure */ | 800 | /* initialize the otg structure */ |
801 | fsl_otg_tc->phy.label = DRIVER_DESC; | 801 | fsl_otg_tc->phy.label = DRIVER_DESC; |
802 | fsl_otg_tc->phy.dev = &pdev->dev; | ||
802 | fsl_otg_tc->phy.set_power = fsl_otg_set_power; | 803 | fsl_otg_tc->phy.set_power = fsl_otg_set_power; |
803 | 804 | ||
804 | fsl_otg_tc->phy.otg->phy = &fsl_otg_tc->phy; | 805 | fsl_otg_tc->phy.otg->phy = &fsl_otg_tc->phy; |
diff --git a/drivers/usb/phy/phy-gpio-vbus-usb.c b/drivers/usb/phy/phy-gpio-vbus-usb.c index 4c76074e518d..8443335c2ea0 100644 --- a/drivers/usb/phy/phy-gpio-vbus-usb.c +++ b/drivers/usb/phy/phy-gpio-vbus-usb.c | |||
@@ -266,6 +266,7 @@ static int __init gpio_vbus_probe(struct platform_device *pdev) | |||
266 | platform_set_drvdata(pdev, gpio_vbus); | 266 | platform_set_drvdata(pdev, gpio_vbus); |
267 | gpio_vbus->dev = &pdev->dev; | 267 | gpio_vbus->dev = &pdev->dev; |
268 | gpio_vbus->phy.label = "gpio-vbus"; | 268 | gpio_vbus->phy.label = "gpio-vbus"; |
269 | gpio_vbus->phy.dev = gpio_vbus->dev; | ||
269 | gpio_vbus->phy.set_power = gpio_vbus_set_power; | 270 | gpio_vbus->phy.set_power = gpio_vbus_set_power; |
270 | gpio_vbus->phy.set_suspend = gpio_vbus_set_suspend; | 271 | gpio_vbus->phy.set_suspend = gpio_vbus_set_suspend; |
271 | gpio_vbus->phy.state = OTG_STATE_UNDEFINED; | 272 | gpio_vbus->phy.state = OTG_STATE_UNDEFINED; |
@@ -343,7 +344,6 @@ err_irq: | |||
343 | gpio_free(pdata->gpio_pullup); | 344 | gpio_free(pdata->gpio_pullup); |
344 | gpio_free(pdata->gpio_vbus); | 345 | gpio_free(pdata->gpio_vbus); |
345 | err_gpio: | 346 | err_gpio: |
346 | platform_set_drvdata(pdev, NULL); | ||
347 | kfree(gpio_vbus->phy.otg); | 347 | kfree(gpio_vbus->phy.otg); |
348 | kfree(gpio_vbus); | 348 | kfree(gpio_vbus); |
349 | return err; | 349 | return err; |
@@ -365,7 +365,6 @@ static int __exit gpio_vbus_remove(struct platform_device *pdev) | |||
365 | if (gpio_is_valid(pdata->gpio_pullup)) | 365 | if (gpio_is_valid(pdata->gpio_pullup)) |
366 | gpio_free(pdata->gpio_pullup); | 366 | gpio_free(pdata->gpio_pullup); |
367 | gpio_free(gpio); | 367 | gpio_free(gpio); |
368 | platform_set_drvdata(pdev, NULL); | ||
369 | kfree(gpio_vbus->phy.otg); | 368 | kfree(gpio_vbus->phy.otg); |
370 | kfree(gpio_vbus); | 369 | kfree(gpio_vbus); |
371 | 370 | ||
diff --git a/drivers/usb/phy/phy-isp1301.c b/drivers/usb/phy/phy-isp1301.c index 225ae6c97eeb..8a55b37d1a02 100644 --- a/drivers/usb/phy/phy-isp1301.c +++ b/drivers/usb/phy/phy-isp1301.c | |||
@@ -102,6 +102,7 @@ static int isp1301_probe(struct i2c_client *client, | |||
102 | mutex_init(&isp->mutex); | 102 | mutex_init(&isp->mutex); |
103 | 103 | ||
104 | phy = &isp->phy; | 104 | phy = &isp->phy; |
105 | phy->dev = &client->dev; | ||
105 | phy->label = DRV_NAME; | 106 | phy->label = DRV_NAME; |
106 | phy->init = isp1301_phy_init; | 107 | phy->init = isp1301_phy_init; |
107 | phy->set_vbus = isp1301_phy_set_vbus; | 108 | phy->set_vbus = isp1301_phy_set_vbus; |
diff --git a/drivers/usb/phy/phy-mv-u3d-usb.c b/drivers/usb/phy/phy-mv-u3d-usb.c index f7838a43347c..1568ea63e338 100644 --- a/drivers/usb/phy/phy-mv-u3d-usb.c +++ b/drivers/usb/phy/phy-mv-u3d-usb.c | |||
@@ -278,11 +278,6 @@ static int mv_u3d_phy_probe(struct platform_device *pdev) | |||
278 | } | 278 | } |
279 | 279 | ||
280 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 280 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
281 | if (!res) { | ||
282 | dev_err(dev, "missing mem resource\n"); | ||
283 | return -ENODEV; | ||
284 | } | ||
285 | |||
286 | phy_base = devm_ioremap_resource(dev, res); | 281 | phy_base = devm_ioremap_resource(dev, res); |
287 | if (IS_ERR(phy_base)) | 282 | if (IS_ERR(phy_base)) |
288 | return PTR_ERR(phy_base); | 283 | return PTR_ERR(phy_base); |
diff --git a/drivers/usb/phy/phy-mv-usb.c b/drivers/usb/phy/phy-mv-usb.c index c987bbe27851..4a6b03c73876 100644 --- a/drivers/usb/phy/phy-mv-usb.c +++ b/drivers/usb/phy/phy-mv-usb.c | |||
@@ -667,7 +667,6 @@ int mv_otg_remove(struct platform_device *pdev) | |||
667 | mv_otg_disable(mvotg); | 667 | mv_otg_disable(mvotg); |
668 | 668 | ||
669 | usb_remove_phy(&mvotg->phy); | 669 | usb_remove_phy(&mvotg->phy); |
670 | platform_set_drvdata(pdev, NULL); | ||
671 | 670 | ||
672 | return 0; | 671 | return 0; |
673 | } | 672 | } |
@@ -850,8 +849,6 @@ err_destroy_workqueue: | |||
850 | flush_workqueue(mvotg->qwork); | 849 | flush_workqueue(mvotg->qwork); |
851 | destroy_workqueue(mvotg->qwork); | 850 | destroy_workqueue(mvotg->qwork); |
852 | 851 | ||
853 | platform_set_drvdata(pdev, NULL); | ||
854 | |||
855 | return retval; | 852 | return retval; |
856 | } | 853 | } |
857 | 854 | ||
diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c index 9d4381e64d51..bd601c537c8d 100644 --- a/drivers/usb/phy/phy-mxs-usb.c +++ b/drivers/usb/phy/phy-mxs-usb.c | |||
@@ -130,11 +130,6 @@ static int mxs_phy_probe(struct platform_device *pdev) | |||
130 | int ret; | 130 | int ret; |
131 | 131 | ||
132 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 132 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
133 | if (!res) { | ||
134 | dev_err(&pdev->dev, "can't get device resources\n"); | ||
135 | return -ENOENT; | ||
136 | } | ||
137 | |||
138 | base = devm_ioremap_resource(&pdev->dev, res); | 133 | base = devm_ioremap_resource(&pdev->dev, res); |
139 | if (IS_ERR(base)) | 134 | if (IS_ERR(base)) |
140 | return PTR_ERR(base); | 135 | return PTR_ERR(base); |
@@ -160,6 +155,7 @@ static int mxs_phy_probe(struct platform_device *pdev) | |||
160 | mxs_phy->phy.set_suspend = mxs_phy_suspend; | 155 | mxs_phy->phy.set_suspend = mxs_phy_suspend; |
161 | mxs_phy->phy.notify_connect = mxs_phy_on_connect; | 156 | mxs_phy->phy.notify_connect = mxs_phy_on_connect; |
162 | mxs_phy->phy.notify_disconnect = mxs_phy_on_disconnect; | 157 | mxs_phy->phy.notify_disconnect = mxs_phy_on_disconnect; |
158 | mxs_phy->phy.type = USB_PHY_TYPE_USB2; | ||
163 | 159 | ||
164 | ATOMIC_INIT_NOTIFIER_HEAD(&mxs_phy->phy.notifier); | 160 | ATOMIC_INIT_NOTIFIER_HEAD(&mxs_phy->phy.notifier); |
165 | 161 | ||
@@ -180,8 +176,6 @@ static int mxs_phy_remove(struct platform_device *pdev) | |||
180 | 176 | ||
181 | usb_remove_phy(&mxs_phy->phy); | 177 | usb_remove_phy(&mxs_phy->phy); |
182 | 178 | ||
183 | platform_set_drvdata(pdev, NULL); | ||
184 | |||
185 | return 0; | 179 | return 0; |
186 | } | 180 | } |
187 | 181 | ||
diff --git a/drivers/usb/phy/phy-nop.c b/drivers/usb/phy/phy-nop.c index 2b10cc969bbb..638cc5dade35 100644 --- a/drivers/usb/phy/phy-nop.c +++ b/drivers/usb/phy/phy-nop.c | |||
@@ -254,8 +254,6 @@ static int nop_usb_xceiv_remove(struct platform_device *pdev) | |||
254 | 254 | ||
255 | usb_remove_phy(&nop->phy); | 255 | usb_remove_phy(&nop->phy); |
256 | 256 | ||
257 | platform_set_drvdata(pdev, NULL); | ||
258 | |||
259 | return 0; | 257 | return 0; |
260 | } | 258 | } |
261 | 259 | ||
diff --git a/drivers/usb/phy/phy-samsung-usb2.c b/drivers/usb/phy/phy-samsung-usb2.c index 45ffe036dacc..9d5e273abcc7 100644 --- a/drivers/usb/phy/phy-samsung-usb2.c +++ b/drivers/usb/phy/phy-samsung-usb2.c | |||
@@ -363,11 +363,6 @@ static int samsung_usb2phy_probe(struct platform_device *pdev) | |||
363 | int ret; | 363 | int ret; |
364 | 364 | ||
365 | phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 365 | phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
366 | if (!phy_mem) { | ||
367 | dev_err(dev, "%s: missing mem resource\n", __func__); | ||
368 | return -ENODEV; | ||
369 | } | ||
370 | |||
371 | phy_base = devm_ioremap_resource(dev, phy_mem); | 366 | phy_base = devm_ioremap_resource(dev, phy_mem); |
372 | if (IS_ERR(phy_base)) | 367 | if (IS_ERR(phy_base)) |
373 | return PTR_ERR(phy_base); | 368 | return PTR_ERR(phy_base); |
diff --git a/drivers/usb/phy/phy-samsung-usb3.c b/drivers/usb/phy/phy-samsung-usb3.c index 133f3d0c554f..5a9efcbcb532 100644 --- a/drivers/usb/phy/phy-samsung-usb3.c +++ b/drivers/usb/phy/phy-samsung-usb3.c | |||
@@ -239,11 +239,6 @@ static int samsung_usb3phy_probe(struct platform_device *pdev) | |||
239 | int ret; | 239 | int ret; |
240 | 240 | ||
241 | phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 241 | phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
242 | if (!phy_mem) { | ||
243 | dev_err(dev, "%s: missing mem resource\n", __func__); | ||
244 | return -ENODEV; | ||
245 | } | ||
246 | |||
247 | phy_base = devm_ioremap_resource(dev, phy_mem); | 242 | phy_base = devm_ioremap_resource(dev, phy_mem); |
248 | if (IS_ERR(phy_base)) | 243 | if (IS_ERR(phy_base)) |
249 | return PTR_ERR(phy_base); | 244 | return PTR_ERR(phy_base); |
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index c454a88abf2e..f1b0dca60f12 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -563,9 +563,8 @@ static inline int gadget_is_dualspeed(struct usb_gadget *g) | |||
563 | } | 563 | } |
564 | 564 | ||
565 | /** | 565 | /** |
566 | * gadget_is_superspeed() - return true if the hardware handles | 566 | * gadget_is_superspeed() - return true if the hardware handles superspeed |
567 | * supperspeed | 567 | * @g: controller that might support superspeed |
568 | * @g: controller that might support supper speed | ||
569 | */ | 568 | */ |
570 | static inline int gadget_is_superspeed(struct usb_gadget *g) | 569 | static inline int gadget_is_superspeed(struct usb_gadget *g) |
571 | { | 570 | { |