aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-03-14 05:18:28 -0400
committerChris Ball <cjb@laptop.org>2012-04-05 20:32:29 -0400
commitefa25fd3a33275861aa74ff03a512423873a8805 (patch)
tree840162161412b57a3bf03c03bcf32ff6f132335b
parent927ce944aebdcac0fa757d4e6448a6972184db8c (diff)
mmc: omap_hsmmc: make it behave well as a module
If we put probe() on __init section, that will never work for multiple module insertions/removals. In order to make it work properly, move probe to __devinit section and use platform_driver_register() instead of platform_driver_probe(). Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Venkatraman S <svenkatr@ti.com> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/omap_hsmmc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 920964ac3214..2aa963dcbdbd 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1785,7 +1785,7 @@ static inline struct omap_mmc_platform_data
1785} 1785}
1786#endif 1786#endif
1787 1787
1788static int __init omap_hsmmc_probe(struct platform_device *pdev) 1788static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
1789{ 1789{
1790 struct omap_mmc_platform_data *pdata = pdev->dev.platform_data; 1790 struct omap_mmc_platform_data *pdata = pdev->dev.platform_data;
1791 struct mmc_host *mmc; 1791 struct mmc_host *mmc;
@@ -2036,7 +2036,7 @@ err:
2036 return ret; 2036 return ret;
2037} 2037}
2038 2038
2039static int omap_hsmmc_remove(struct platform_device *pdev) 2039static int __devexit omap_hsmmc_remove(struct platform_device *pdev)
2040{ 2040{
2041 struct omap_hsmmc_host *host = platform_get_drvdata(pdev); 2041 struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
2042 struct resource *res; 2042 struct resource *res;
@@ -2194,7 +2194,8 @@ static struct dev_pm_ops omap_hsmmc_dev_pm_ops = {
2194}; 2194};
2195 2195
2196static struct platform_driver omap_hsmmc_driver = { 2196static struct platform_driver omap_hsmmc_driver = {
2197 .remove = omap_hsmmc_remove, 2197 .probe = omap_hsmmc_probe,
2198 .remove = __devexit_p(omap_hsmmc_remove),
2198 .driver = { 2199 .driver = {
2199 .name = DRIVER_NAME, 2200 .name = DRIVER_NAME,
2200 .owner = THIS_MODULE, 2201 .owner = THIS_MODULE,
@@ -2206,7 +2207,7 @@ static struct platform_driver omap_hsmmc_driver = {
2206static int __init omap_hsmmc_init(void) 2207static int __init omap_hsmmc_init(void)
2207{ 2208{
2208 /* Register the MMC driver */ 2209 /* Register the MMC driver */
2209 return platform_driver_probe(&omap_hsmmc_driver, omap_hsmmc_probe); 2210 return platform_driver_register(&omap_hsmmc_driver);
2210} 2211}
2211 2212
2212static void __exit omap_hsmmc_cleanup(void) 2213static void __exit omap_hsmmc_cleanup(void)