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: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
parent
d63dab00e8
commit
27f23336bc
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||||
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)
|
||||||
|
|
||||||
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 = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __devinit spitzkbd_init(void)
|
static int __init spitzkbd_init(void)
|
||||||
{
|
{
|
||||||
return platform_driver_register(&spitzkbd_driver);
|
return platform_driver_register(&spitzkbd_driver);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue