Commit 840207ed authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Dmitry Torokhov

Input: corgi_ts - mark probe function as __devinit

A pointer to corgits_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 f2d8dc75
...@@ -268,7 +268,7 @@ static int corgits_resume(struct platform_device *dev) ...@@ -268,7 +268,7 @@ static int corgits_resume(struct platform_device *dev)
#define corgits_resume NULL #define corgits_resume NULL
#endif #endif
static int __init corgits_probe(struct platform_device *pdev) static int __devinit corgits_probe(struct platform_device *pdev)
{ {
struct corgi_ts *corgi_ts; struct corgi_ts *corgi_ts;
struct input_dev *input_dev; struct input_dev *input_dev;
...@@ -343,7 +343,7 @@ static int __init corgits_probe(struct platform_device *pdev) ...@@ -343,7 +343,7 @@ static int __init corgits_probe(struct platform_device *pdev)
return err; return err;
} }
static int corgits_remove(struct platform_device *pdev) static int __devexit corgits_remove(struct platform_device *pdev)
{ {
struct corgi_ts *corgi_ts = platform_get_drvdata(pdev); struct corgi_ts *corgi_ts = platform_get_drvdata(pdev);
...@@ -352,12 +352,13 @@ static int corgits_remove(struct platform_device *pdev) ...@@ -352,12 +352,13 @@ static int corgits_remove(struct platform_device *pdev)
corgi_ts->machinfo->put_hsync(); corgi_ts->machinfo->put_hsync();
input_unregister_device(corgi_ts->input); input_unregister_device(corgi_ts->input);
kfree(corgi_ts); kfree(corgi_ts);
return 0; return 0;
} }
static struct platform_driver corgits_driver = { static struct platform_driver corgits_driver = {
.probe = corgits_probe, .probe = corgits_probe,
.remove = corgits_remove, .remove = __devexit_p(corgits_remove),
.suspend = corgits_suspend, .suspend = corgits_suspend,
.resume = corgits_resume, .resume = corgits_resume,
.driver = { .driver = {
...@@ -366,7 +367,7 @@ static struct platform_driver corgits_driver = { ...@@ -366,7 +367,7 @@ static struct platform_driver corgits_driver = {
}, },
}; };
static int __devinit corgits_init(void) static int __init corgits_init(void)
{ {
return platform_driver_register(&corgits_driver); return platform_driver_register(&corgits_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