Commit 27f23336 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Dmitry Torokhov

Input: spitzkbd - mark probe function as __devinit

A pointer to spitzkbd_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

[dtor@mail.ru: fixed some more section markups]
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent d63dab00
...@@ -343,7 +343,7 @@ static int spitzkbd_resume(struct platform_device *dev) ...@@ -343,7 +343,7 @@ static int spitzkbd_resume(struct platform_device *dev)
#define spitzkbd_resume NULL #define spitzkbd_resume NULL
#endif #endif
static int __init spitzkbd_probe(struct platform_device *dev) static int __devinit spitzkbd_probe(struct platform_device *dev)
{ {
struct spitzkbd *spitzkbd; struct spitzkbd *spitzkbd;
struct input_dev *input_dev; struct input_dev *input_dev;
...@@ -444,7 +444,7 @@ static int __init spitzkbd_probe(struct platform_device *dev) ...@@ -444,7 +444,7 @@ static int __init spitzkbd_probe(struct platform_device *dev)
return err; return err;
} }
static int spitzkbd_remove(struct platform_device *dev) static int __devexit spitzkbd_remove(struct platform_device *dev)
{ {
int i; int i;
struct spitzkbd *spitzkbd = platform_get_drvdata(dev); struct spitzkbd *spitzkbd = platform_get_drvdata(dev);
...@@ -470,7 +470,7 @@ static int spitzkbd_remove(struct platform_device *dev) ...@@ -470,7 +470,7 @@ static int spitzkbd_remove(struct platform_device *dev)
static struct platform_driver spitzkbd_driver = { static struct platform_driver spitzkbd_driver = {
.probe = spitzkbd_probe, .probe = spitzkbd_probe,
.remove = spitzkbd_remove, .remove = __devexit_p(spitzkbd_remove),
.suspend = spitzkbd_suspend, .suspend = spitzkbd_suspend,
.resume = spitzkbd_resume, .resume = spitzkbd_resume,
.driver = { .driver = {
...@@ -479,7 +479,7 @@ static struct platform_driver spitzkbd_driver = { ...@@ -479,7 +479,7 @@ static struct platform_driver spitzkbd_driver = {
}, },
}; };
static int __devinit spitzkbd_init(void) static int __init spitzkbd_init(void)
{ {
return platform_driver_register(&spitzkbd_driver); return platform_driver_register(&spitzkbd_driver);
} }
......
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