Skip to content

Commit

Permalink
usb: gadget: pxa25x_udc: fix deferred probe from __init
Browse files Browse the repository at this point in the history
Move probe out of __init section and don't use platform_driver_probe
which cannot be used with deferred probing.

Since commit e935457 ("gpiolib: Defer failed gpio requests by default")
this driver might return -EPROBE_DEFER if a gpio_request fails.

Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Johan Hovold authored and Felipe Balbi committed Sep 23, 2013
1 parent 1374a43 commit 8233729
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/usb/gadget/pxa25x_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2054,7 +2054,7 @@ static struct pxa25x_udc memory = {
/*
* probe - binds to the platform device
*/
static int __init pxa25x_udc_probe(struct platform_device *pdev)
static int pxa25x_udc_probe(struct platform_device *pdev)
{
struct pxa25x_udc *dev = &memory;
int retval, irq;
Expand Down Expand Up @@ -2203,7 +2203,7 @@ static void pxa25x_udc_shutdown(struct platform_device *_dev)
pullup_off();
}

static int __exit pxa25x_udc_remove(struct platform_device *pdev)
static int pxa25x_udc_remove(struct platform_device *pdev)
{
struct pxa25x_udc *dev = platform_get_drvdata(pdev);

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

static struct platform_driver udc_driver = {
.shutdown = pxa25x_udc_shutdown,
.remove = __exit_p(pxa25x_udc_remove),
.probe = pxa25x_udc_probe,
.remove = pxa25x_udc_remove,
.suspend = pxa25x_udc_suspend,
.resume = pxa25x_udc_resume,
.driver = {
Expand All @@ -2303,7 +2304,7 @@ static struct platform_driver udc_driver = {
},
};

module_platform_driver_probe(udc_driver, pxa25x_udc_probe);
module_platform_driver(udc_driver);

MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell");
Expand Down

0 comments on commit 8233729

Please sign in to comment.