lkml.org 
[lkml]   [2009]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/5] spi-imx: use platform_driver_probe as probe lives in .init.text
Date
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@pengutronix.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Sascha Hauer <s.hauer@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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-12-08 22:17    [W:0.076 / U:1.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site