提交 2c2b9285 编写于 作者: J Johan Hovold 提交者: Greg Kroah-Hartman

mtd: atmel_nand: 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 e9354576 ("gpiolib: Defer failed gpio requests by default")
this driver might return -EPROBE_DEFER if a gpio_request fails.

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Josh Wu <josh.wu@atmel.com>
Signed-off-by: NJohan Hovold <jhovold@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 1867adee
...@@ -1139,7 +1139,7 @@ static int pmecc_choose_ecc(struct atmel_nand_host *host, ...@@ -1139,7 +1139,7 @@ static int pmecc_choose_ecc(struct atmel_nand_host *host,
return 0; return 0;
} }
static int __init atmel_pmecc_nand_init_params(struct platform_device *pdev, static int atmel_pmecc_nand_init_params(struct platform_device *pdev,
struct atmel_nand_host *host) struct atmel_nand_host *host)
{ {
struct mtd_info *mtd = &host->mtd; struct mtd_info *mtd = &host->mtd;
...@@ -1548,7 +1548,7 @@ static int atmel_of_init_port(struct atmel_nand_host *host, ...@@ -1548,7 +1548,7 @@ static int atmel_of_init_port(struct atmel_nand_host *host,
} }
#endif #endif
static int __init atmel_hw_nand_init_params(struct platform_device *pdev, static int atmel_hw_nand_init_params(struct platform_device *pdev,
struct atmel_nand_host *host) struct atmel_nand_host *host)
{ {
struct mtd_info *mtd = &host->mtd; struct mtd_info *mtd = &host->mtd;
...@@ -1987,7 +1987,7 @@ static struct platform_driver atmel_nand_nfc_driver; ...@@ -1987,7 +1987,7 @@ static struct platform_driver atmel_nand_nfc_driver;
/* /*
* Probe for the NAND device. * Probe for the NAND device.
*/ */
static int __init atmel_nand_probe(struct platform_device *pdev) static int atmel_nand_probe(struct platform_device *pdev)
{ {
struct atmel_nand_host *host; struct atmel_nand_host *host;
struct mtd_info *mtd; struct mtd_info *mtd;
...@@ -2184,7 +2184,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev) ...@@ -2184,7 +2184,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
/* /*
* Remove a NAND device. * Remove a NAND device.
*/ */
static int __exit atmel_nand_remove(struct platform_device *pdev) static int atmel_nand_remove(struct platform_device *pdev)
{ {
struct atmel_nand_host *host = platform_get_drvdata(pdev); struct atmel_nand_host *host = platform_get_drvdata(pdev);
struct mtd_info *mtd = &host->mtd; struct mtd_info *mtd = &host->mtd;
...@@ -2270,7 +2270,8 @@ static struct platform_driver atmel_nand_nfc_driver = { ...@@ -2270,7 +2270,8 @@ static struct platform_driver atmel_nand_nfc_driver = {
}; };
static struct platform_driver atmel_nand_driver = { static struct platform_driver atmel_nand_driver = {
.remove = __exit_p(atmel_nand_remove), .probe = atmel_nand_probe,
.remove = atmel_nand_remove,
.driver = { .driver = {
.name = "atmel_nand", .name = "atmel_nand",
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -2278,7 +2279,7 @@ static struct platform_driver atmel_nand_driver = { ...@@ -2278,7 +2279,7 @@ static struct platform_driver atmel_nand_driver = {
}, },
}; };
module_platform_driver_probe(atmel_nand_driver, atmel_nand_probe); module_platform_driver(atmel_nand_driver);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Rick Bronson"); MODULE_AUTHOR("Rick Bronson");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册