Commit f8113416 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: i8042 - use platform_driver_probe

i8042 is not hot-pluggable and we create the device when we register
the driver, so let's save some memory by using platform_device_probe
and using __init instead of __devinit.
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 386b3849
...@@ -541,7 +541,7 @@ static int i8042_set_mux_mode(bool multiplex, unsigned char *mux_version) ...@@ -541,7 +541,7 @@ static int i8042_set_mux_mode(bool multiplex, unsigned char *mux_version)
* LCS/Telegraphics. * LCS/Telegraphics.
*/ */
static int __devinit i8042_check_mux(void) static int __init i8042_check_mux(void)
{ {
unsigned char mux_version; unsigned char mux_version;
...@@ -570,10 +570,10 @@ static int __devinit i8042_check_mux(void) ...@@ -570,10 +570,10 @@ static int __devinit i8042_check_mux(void)
/* /*
* The following is used to test AUX IRQ delivery. * The following is used to test AUX IRQ delivery.
*/ */
static struct completion i8042_aux_irq_delivered __devinitdata; static struct completion i8042_aux_irq_delivered __initdata;
static bool i8042_irq_being_tested __devinitdata; static bool i8042_irq_being_tested __initdata;
static irqreturn_t __devinit i8042_aux_test_irq(int irq, void *dev_id) static irqreturn_t __init i8042_aux_test_irq(int irq, void *dev_id)
{ {
unsigned long flags; unsigned long flags;
unsigned char str, data; unsigned char str, data;
...@@ -598,7 +598,7 @@ static irqreturn_t __devinit i8042_aux_test_irq(int irq, void *dev_id) ...@@ -598,7 +598,7 @@ static irqreturn_t __devinit i8042_aux_test_irq(int irq, void *dev_id)
* verifies success by readinng CTR. Used when testing for presence of AUX * verifies success by readinng CTR. Used when testing for presence of AUX
* port. * port.
*/ */
static int __devinit i8042_toggle_aux(bool on) static int __init i8042_toggle_aux(bool on)
{ {
unsigned char param; unsigned char param;
int i; int i;
...@@ -626,7 +626,7 @@ static int __devinit i8042_toggle_aux(bool on) ...@@ -626,7 +626,7 @@ static int __devinit i8042_toggle_aux(bool on)
* the presence of an AUX interface. * the presence of an AUX interface.
*/ */
static int __devinit i8042_check_aux(void) static int __init i8042_check_aux(void)
{ {
int retval = -1; int retval = -1;
bool irq_registered = false; bool irq_registered = false;
...@@ -1060,7 +1060,7 @@ static void i8042_shutdown(struct platform_device *dev) ...@@ -1060,7 +1060,7 @@ static void i8042_shutdown(struct platform_device *dev)
i8042_controller_reset(); i8042_controller_reset();
} }
static int __devinit i8042_create_kbd_port(void) static int __init i8042_create_kbd_port(void)
{ {
struct serio *serio; struct serio *serio;
struct i8042_port *port = &i8042_ports[I8042_KBD_PORT_NO]; struct i8042_port *port = &i8042_ports[I8042_KBD_PORT_NO];
...@@ -1085,7 +1085,7 @@ static int __devinit i8042_create_kbd_port(void) ...@@ -1085,7 +1085,7 @@ static int __devinit i8042_create_kbd_port(void)
return 0; return 0;
} }
static int __devinit i8042_create_aux_port(int idx) static int __init i8042_create_aux_port(int idx)
{ {
struct serio *serio; struct serio *serio;
int port_no = idx < 0 ? I8042_AUX_PORT_NO : I8042_MUX_PORT_NO + idx; int port_no = idx < 0 ? I8042_AUX_PORT_NO : I8042_MUX_PORT_NO + idx;
...@@ -1117,13 +1117,13 @@ static int __devinit i8042_create_aux_port(int idx) ...@@ -1117,13 +1117,13 @@ static int __devinit i8042_create_aux_port(int idx)
return 0; return 0;
} }
static void __devinit i8042_free_kbd_port(void) static void __init i8042_free_kbd_port(void)
{ {
kfree(i8042_ports[I8042_KBD_PORT_NO].serio); kfree(i8042_ports[I8042_KBD_PORT_NO].serio);
i8042_ports[I8042_KBD_PORT_NO].serio = NULL; i8042_ports[I8042_KBD_PORT_NO].serio = NULL;
} }
static void __devinit i8042_free_aux_ports(void) static void __init i8042_free_aux_ports(void)
{ {
int i; int i;
...@@ -1133,7 +1133,7 @@ static void __devinit i8042_free_aux_ports(void) ...@@ -1133,7 +1133,7 @@ static void __devinit i8042_free_aux_ports(void)
} }
} }
static void __devinit i8042_register_ports(void) static void __init i8042_register_ports(void)
{ {
int i; int i;
...@@ -1171,7 +1171,7 @@ static void i8042_free_irqs(void) ...@@ -1171,7 +1171,7 @@ static void i8042_free_irqs(void)
i8042_aux_irq_registered = i8042_kbd_irq_registered = false; i8042_aux_irq_registered = i8042_kbd_irq_registered = false;
} }
static int __devinit i8042_setup_aux(void) static int __init i8042_setup_aux(void)
{ {
int (*aux_enable)(void); int (*aux_enable)(void);
int error; int error;
...@@ -1212,7 +1212,7 @@ static int __devinit i8042_setup_aux(void) ...@@ -1212,7 +1212,7 @@ static int __devinit i8042_setup_aux(void)
return error; return error;
} }
static int __devinit i8042_setup_kbd(void) static int __init i8042_setup_kbd(void)
{ {
int error; int error;
...@@ -1239,7 +1239,7 @@ static int __devinit i8042_setup_kbd(void) ...@@ -1239,7 +1239,7 @@ static int __devinit i8042_setup_kbd(void)
return error; return error;
} }
static int __devinit i8042_probe(struct platform_device *dev) static int __init i8042_probe(struct platform_device *dev)
{ {
int error; int error;
...@@ -1299,7 +1299,6 @@ static struct platform_driver i8042_driver = { ...@@ -1299,7 +1299,6 @@ static struct platform_driver i8042_driver = {
.pm = &i8042_pm_ops, .pm = &i8042_pm_ops,
#endif #endif
}, },
.probe = i8042_probe,
.remove = __devexit_p(i8042_remove), .remove = __devexit_p(i8042_remove),
.shutdown = i8042_shutdown, .shutdown = i8042_shutdown,
}; };
...@@ -1318,28 +1317,28 @@ static int __init i8042_init(void) ...@@ -1318,28 +1317,28 @@ static int __init i8042_init(void)
if (err) if (err)
goto err_platform_exit; goto err_platform_exit;
err = platform_driver_register(&i8042_driver);
if (err)
goto err_platform_exit;
i8042_platform_device = platform_device_alloc("i8042", -1); i8042_platform_device = platform_device_alloc("i8042", -1);
if (!i8042_platform_device) { if (!i8042_platform_device) {
err = -ENOMEM; err = -ENOMEM;
goto err_unregister_driver; goto err_platform_exit;
} }
err = platform_device_add(i8042_platform_device); err = platform_device_add(i8042_platform_device);
if (err) if (err)
goto err_free_device; goto err_free_device;
err = platform_driver_probe(&i8042_driver, i8042_probe);
if (err)
goto err_del_device;
panic_blink = i8042_panic_blink; panic_blink = i8042_panic_blink;
return 0; return 0;
err_del_device:
platform_device_del(i8042_platform_device);
err_free_device: err_free_device:
platform_device_put(i8042_platform_device); platform_device_put(i8042_platform_device);
err_unregister_driver:
platform_driver_unregister(&i8042_driver);
err_platform_exit: err_platform_exit:
i8042_platform_exit(); i8042_platform_exit();
...@@ -1348,8 +1347,8 @@ static int __init i8042_init(void) ...@@ -1348,8 +1347,8 @@ static int __init i8042_init(void)
static void __exit i8042_exit(void) static void __exit i8042_exit(void)
{ {
platform_device_unregister(i8042_platform_device);
platform_driver_unregister(&i8042_driver); platform_driver_unregister(&i8042_driver);
platform_device_unregister(i8042_platform_device);
i8042_platform_exit(); i8042_platform_exit();
panic_blink = NULL; panic_blink = NULL;
......
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