Commit ae04c825 authored by Johan Hovold's avatar Johan Hovold Committed by Jiri Slaby

pcmcia: at91_cf: fix deferred probe from __init

commit 16a7c7cf upstream.

Move probe out of __init section and don't use platform_driver_probe
which cannot be used with deferred probing.

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

Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 05b598ab
...@@ -245,7 +245,7 @@ static int at91_cf_dt_init(struct platform_device *pdev) ...@@ -245,7 +245,7 @@ static int at91_cf_dt_init(struct platform_device *pdev)
} }
#endif #endif
static int __init at91_cf_probe(struct platform_device *pdev) static int at91_cf_probe(struct platform_device *pdev)
{ {
struct at91_cf_socket *cf; struct at91_cf_socket *cf;
struct at91_cf_data *board = pdev->dev.platform_data; struct at91_cf_data *board = pdev->dev.platform_data;
...@@ -354,7 +354,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) ...@@ -354,7 +354,7 @@ static int __init at91_cf_probe(struct platform_device *pdev)
return status; return status;
} }
static int __exit at91_cf_remove(struct platform_device *pdev) static int at91_cf_remove(struct platform_device *pdev)
{ {
struct at91_cf_socket *cf = platform_get_drvdata(pdev); struct at91_cf_socket *cf = platform_get_drvdata(pdev);
...@@ -404,14 +404,13 @@ static struct platform_driver at91_cf_driver = { ...@@ -404,14 +404,13 @@ static struct platform_driver at91_cf_driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = of_match_ptr(at91_cf_dt_ids), .of_match_table = of_match_ptr(at91_cf_dt_ids),
}, },
.remove = __exit_p(at91_cf_remove), .probe = at91_cf_probe,
.remove = at91_cf_remove,
.suspend = at91_cf_suspend, .suspend = at91_cf_suspend,
.resume = at91_cf_resume, .resume = at91_cf_resume,
}; };
/*--------------------------------------------------------------------------*/ module_platform_driver(at91_cf_driver);
module_platform_driver_probe(at91_cf_driver, at91_cf_probe);
MODULE_DESCRIPTION("AT91 Compact Flash Driver"); MODULE_DESCRIPTION("AT91 Compact Flash Driver");
MODULE_AUTHOR("David Brownell"); MODULE_AUTHOR("David Brownell");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment