Skip to content

Commit bdd78f2

Browse files
committed
Merge tag 'fixes-for-v3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus
Felipe writes: usb: fixes for v3.12-rc4 Here are some more fixes to musb's OTG support and a regression caused on latest merge window; pxa25x_udc and gpio-vbus learned to cope with deferred probe; s3c-hsotg got a fix for non-periodic endpoints write size and f_fs got an error handling fix for cases where ffs_do_descs() fail. Signed-of-by: Felipe Balbi <[email protected]>
2 parents eb2addd + b377216 commit bdd78f2

File tree

6 files changed

+20
-12
lines changed

6 files changed

+20
-12
lines changed

drivers/usb/gadget/f_fs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,6 +2256,8 @@ static int ffs_func_bind(struct usb_configuration *c,
22562256
data->raw_descs + ret,
22572257
(sizeof data->raw_descs) - ret,
22582258
__ffs_func_bind_do_descs, func);
2259+
if (unlikely(ret < 0))
2260+
goto error;
22592261
}
22602262

22612263
/*

drivers/usb/gadget/pxa25x_udc.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,7 +2054,7 @@ static struct pxa25x_udc memory = {
20542054
/*
20552055
* probe - binds to the platform device
20562056
*/
2057-
static int __init pxa25x_udc_probe(struct platform_device *pdev)
2057+
static int pxa25x_udc_probe(struct platform_device *pdev)
20582058
{
20592059
struct pxa25x_udc *dev = &memory;
20602060
int retval, irq;
@@ -2203,7 +2203,7 @@ static void pxa25x_udc_shutdown(struct platform_device *_dev)
22032203
pullup_off();
22042204
}
22052205

2206-
static int __exit pxa25x_udc_remove(struct platform_device *pdev)
2206+
static int pxa25x_udc_remove(struct platform_device *pdev)
22072207
{
22082208
struct pxa25x_udc *dev = platform_get_drvdata(pdev);
22092209

@@ -2294,7 +2294,8 @@ static int pxa25x_udc_resume(struct platform_device *dev)
22942294

22952295
static struct platform_driver udc_driver = {
22962296
.shutdown = pxa25x_udc_shutdown,
2297-
.remove = __exit_p(pxa25x_udc_remove),
2297+
.probe = pxa25x_udc_probe,
2298+
.remove = pxa25x_udc_remove,
22982299
.suspend = pxa25x_udc_suspend,
22992300
.resume = pxa25x_udc_resume,
23002301
.driver = {
@@ -2303,7 +2304,7 @@ static struct platform_driver udc_driver = {
23032304
},
23042305
};
23052306

2306-
module_platform_driver_probe(udc_driver, pxa25x_udc_probe);
2307+
module_platform_driver(udc_driver);
23072308

23082309
MODULE_DESCRIPTION(DRIVER_DESC);
23092310
MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell");

drivers/usb/gadget/s3c-hsotg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ static int s3c_hsotg_write_fifo(struct s3c_hsotg *hsotg,
543543
* FIFO, requests of >512 cause the endpoint to get stuck with a
544544
* fragment of the end of the transfer in it.
545545
*/
546-
if (can_write > 512)
546+
if (can_write > 512 && !periodic)
547547
can_write = 512;
548548

549549
/*

drivers/usb/musb/musb_dsps.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,9 @@ static int dsps_probe(struct platform_device *pdev)
535535
struct dsps_glue *glue;
536536
int ret;
537537

538+
if (!strcmp(pdev->name, "musb-hdrc"))
539+
return -ENODEV;
540+
538541
match = of_match_node(musb_dsps_of_match, pdev->dev.of_node);
539542
if (!match) {
540543
dev_err(&pdev->dev, "fail to get matching of_match struct\n");

drivers/usb/musb/musb_gadget.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1790,6 +1790,10 @@ int musb_gadget_setup(struct musb *musb)
17901790
musb->g.max_speed = USB_SPEED_HIGH;
17911791
musb->g.speed = USB_SPEED_UNKNOWN;
17921792

1793+
MUSB_DEV_MODE(musb);
1794+
musb->xceiv->otg->default_a = 0;
1795+
musb->xceiv->state = OTG_STATE_B_IDLE;
1796+
17931797
/* this "gadget" abstracts/virtualizes the controller */
17941798
musb->g.name = musb_driver_name;
17951799
musb->g.is_otg = 1;
@@ -1849,7 +1853,6 @@ static int musb_gadget_start(struct usb_gadget *g,
18491853
musb->gadget_driver = driver;
18501854

18511855
spin_lock_irqsave(&musb->lock, flags);
1852-
musb->is_active = 1;
18531856

18541857
otg_set_peripheral(otg, &musb->g);
18551858
musb->xceiv->state = OTG_STATE_B_IDLE;

drivers/usb/phy/phy-gpio-vbus-usb.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ static int gpio_vbus_set_suspend(struct usb_phy *phy, int suspend)
241241

242242
/* platform driver interface */
243243

244-
static int __init gpio_vbus_probe(struct platform_device *pdev)
244+
static int gpio_vbus_probe(struct platform_device *pdev)
245245
{
246246
struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev);
247247
struct gpio_vbus_data *gpio_vbus;
@@ -349,7 +349,7 @@ static int __init gpio_vbus_probe(struct platform_device *pdev)
349349
return err;
350350
}
351351

352-
static int __exit gpio_vbus_remove(struct platform_device *pdev)
352+
static int gpio_vbus_remove(struct platform_device *pdev)
353353
{
354354
struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev);
355355
struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev);
@@ -398,8 +398,6 @@ static const struct dev_pm_ops gpio_vbus_dev_pm_ops = {
398398
};
399399
#endif
400400

401-
/* NOTE: the gpio-vbus device may *NOT* be hotplugged */
402-
403401
MODULE_ALIAS("platform:gpio-vbus");
404402

405403
static struct platform_driver gpio_vbus_driver = {
@@ -410,10 +408,11 @@ static struct platform_driver gpio_vbus_driver = {
410408
.pm = &gpio_vbus_dev_pm_ops,
411409
#endif
412410
},
413-
.remove = __exit_p(gpio_vbus_remove),
411+
.probe = gpio_vbus_probe,
412+
.remove = gpio_vbus_remove,
414413
};
415414

416-
module_platform_driver_probe(gpio_vbus_driver, gpio_vbus_probe);
415+
module_platform_driver(gpio_vbus_driver);
417416

418417
MODULE_DESCRIPTION("simple GPIO controlled OTG transceiver driver");
419418
MODULE_AUTHOR("Philipp Zabel");

0 commit comments

Comments
 (0)