mmc: mvsdio: 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 the mmc_gpio_request_cd fails.

Cc: Nicolas Pitre <nico@fluxnic.net>
Cc: Chris Ball <cjb@laptop.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Johan Hovold 2013-09-23 16:27:27 +02:00 committed by Greg Kroah-Hartman
parent 3f9120b042
commit 1867adee6e

View file

@ -655,7 +655,7 @@ static const struct mmc_host_ops mvsd_ops = {
.enable_sdio_irq = mvsd_enable_sdio_irq, .enable_sdio_irq = mvsd_enable_sdio_irq,
}; };
static void __init static void
mv_conf_mbus_windows(struct mvsd_host *host, mv_conf_mbus_windows(struct mvsd_host *host,
const struct mbus_dram_target_info *dram) const struct mbus_dram_target_info *dram)
{ {
@ -677,7 +677,7 @@ mv_conf_mbus_windows(struct mvsd_host *host,
} }
} }
static int __init mvsd_probe(struct platform_device *pdev) static int mvsd_probe(struct platform_device *pdev)
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct mmc_host *mmc = NULL; struct mmc_host *mmc = NULL;
@ -819,7 +819,7 @@ static int __init mvsd_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int __exit mvsd_remove(struct platform_device *pdev) static int mvsd_remove(struct platform_device *pdev)
{ {
struct mmc_host *mmc = platform_get_drvdata(pdev); struct mmc_host *mmc = platform_get_drvdata(pdev);
@ -872,7 +872,8 @@ static const struct of_device_id mvsdio_dt_ids[] = {
MODULE_DEVICE_TABLE(of, mvsdio_dt_ids); MODULE_DEVICE_TABLE(of, mvsdio_dt_ids);
static struct platform_driver mvsd_driver = { static struct platform_driver mvsd_driver = {
.remove = __exit_p(mvsd_remove), .probe = mvsd_probe,
.remove = mvsd_remove,
.suspend = mvsd_suspend, .suspend = mvsd_suspend,
.resume = mvsd_resume, .resume = mvsd_resume,
.driver = { .driver = {
@ -881,7 +882,7 @@ static struct platform_driver mvsd_driver = {
}, },
}; };
module_platform_driver_probe(mvsd_driver, mvsd_probe); module_platform_driver(mvsd_driver);
/* maximum card clock frequency (default 50MHz) */ /* maximum card clock frequency (default 50MHz) */
module_param(maxfreq, int, 0); module_param(maxfreq, int, 0);