Skip to content

Commit 8233729

Browse files
jhovoldFelipe Balbi
authored andcommitted
usb: gadget: pxa25x_udc: fix deferred probe from __init
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 <[email protected]> Cc: Russell King <[email protected]> Cc: Haojian Zhuang <[email protected]> Cc: Felipe Balbi <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 1374a43 commit 8233729

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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");

0 commit comments

Comments
 (0)