Skip to content

Commit

Permalink
Input: spitzkbd - mark probe function as __devinit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Uwe Kleine-König authored and Dmitry Torokhov committed Jan 14, 2009
1 parent d63dab0 commit 27f2333
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/input/keyboard/spitzkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ static int spitzkbd_resume(struct platform_device *dev)
#define spitzkbd_resume NULL
#endif

static int __init spitzkbd_probe(struct platform_device *dev)
static int __devinit spitzkbd_probe(struct platform_device *dev)
{
struct spitzkbd *spitzkbd;
struct input_dev *input_dev;
Expand Down Expand Up @@ -444,7 +444,7 @@ static int __init spitzkbd_probe(struct platform_device *dev)
return err;
}

static int spitzkbd_remove(struct platform_device *dev)
static int __devexit spitzkbd_remove(struct platform_device *dev)
{
int i;
struct spitzkbd *spitzkbd = platform_get_drvdata(dev);
Expand All @@ -470,7 +470,7 @@ static int spitzkbd_remove(struct platform_device *dev)

static struct platform_driver spitzkbd_driver = {
.probe = spitzkbd_probe,
.remove = spitzkbd_remove,
.remove = __devexit_p(spitzkbd_remove),
.suspend = spitzkbd_suspend,
.resume = spitzkbd_resume,
.driver = {
Expand All @@ -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);
}
Expand Down

0 comments on commit 27f2333

Please sign in to comment.