Commit 0808a402 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Tony Lindgren

Fix sections for omap-mcbsp platform driver

Don't use __init but __devinit to define probe function.  A pointer to
omap_mcbsp_probe is passed to the core via platform_driver_register and
so the function must not disappear when the init code is freed.  Using
__init and having HOTPLUG=y the following probably oopses:

	echo -n omap-mcbsp.1 > /sys/bus/platform/driver/omap-mcbsp/unbind
	echo -n omap-mcbsp.1 > /sys/bus/platform/driver/omap-mcbsp/bind

While at it move the remove function to the .devexit.text section.
Signed-off-by: default avatarUwe Kleine-König <ukleinek@strlen.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent c29cfcea
...@@ -863,7 +863,7 @@ EXPORT_SYMBOL(omap_mcbsp_set_spi_mode); ...@@ -863,7 +863,7 @@ EXPORT_SYMBOL(omap_mcbsp_set_spi_mode);
* McBSP1 and McBSP3 are directly mapped on 1610 and 1510. * McBSP1 and McBSP3 are directly mapped on 1610 and 1510.
* 730 has only 2 McBSP, and both of them are MPU peripherals. * 730 has only 2 McBSP, and both of them are MPU peripherals.
*/ */
static int __init omap_mcbsp_probe(struct platform_device *pdev) static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
{ {
struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data; struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data;
struct omap_mcbsp *mcbsp; struct omap_mcbsp *mcbsp;
...@@ -935,7 +935,7 @@ exit: ...@@ -935,7 +935,7 @@ exit:
return ret; return ret;
} }
static int omap_mcbsp_remove(struct platform_device *pdev) static int __devexit omap_mcbsp_remove(struct platform_device *pdev)
{ {
struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev); struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev);
...@@ -961,7 +961,7 @@ static int omap_mcbsp_remove(struct platform_device *pdev) ...@@ -961,7 +961,7 @@ static int omap_mcbsp_remove(struct platform_device *pdev)
static struct platform_driver omap_mcbsp_driver = { static struct platform_driver omap_mcbsp_driver = {
.probe = omap_mcbsp_probe, .probe = omap_mcbsp_probe,
.remove = omap_mcbsp_remove, .remove = __devexit_p(omap_mcbsp_remove),
.driver = { .driver = {
.name = "omap-mcbsp", .name = "omap-mcbsp",
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment