[PATCH 1/5] spi-imx: use platform_driver_probe as probe lives in .init.text

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Tue Dec 8 16:14:06 EST 2009


Using platform_driver_register with a probe function defined using
__init is wrong.

This fixes an oops after:

	cd /sys/bus/platform/drivers/spi_imx
	echo -n spi_imx.0 > unbind
	echo -n spi_imx.0 > bind

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
Cc: David Brownell <dbrownell at users.sourceforge.net>
Cc: Andrew Morton <akpm at linux-foundation.org>
Cc: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/spi/spi_imx.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
index 1b17f44..c83ca05 100644
--- a/drivers/spi/spi_imx.c
+++ b/drivers/spi/spi_imx.c
@@ -666,13 +666,12 @@ static struct platform_driver spi_imx_driver = {
 		   .name = DRIVER_NAME,
 		   .owner = THIS_MODULE,
 		   },
-	.probe = spi_imx_probe,
 	.remove = __exit_p(spi_imx_remove),
 };
 
 static int __init spi_imx_init(void)
 {
-	return platform_driver_register(&spi_imx_driver);
+	return platform_driver_probe(&spi_imx_driver, spi_imx_probe);
 }
 
 static void __exit spi_imx_exit(void)
-- 
1.6.5.2




More information about the linux-arm-kernel mailing list