aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-11-09 17:32:44 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-11-09 17:32:44 -0500
commit3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch)
treed8825be54cefb6ad6707478d719c8e30605bee7b /drivers/input/serio
parent00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (diff)
[DRIVER MODEL] Convert platform drivers to use struct platform_driver
This allows us to eliminate the casts in the drivers, and eventually remove the use of the device_driver function pointer methods for platform device drivers. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/input/serio')
-rw-r--r--drivers/input/serio/i8042.c19
-rw-r--r--drivers/input/serio/rpckbd.c21
2 files changed, 21 insertions, 19 deletions
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 01e186422021..ac86c1d1d83e 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -912,7 +912,7 @@ static long i8042_panic_blink(long count)
912 * Here we try to restore the original BIOS settings 912 * Here we try to restore the original BIOS settings
913 */ 913 */
914 914
915static int i8042_suspend(struct device *dev, pm_message_t state) 915static int i8042_suspend(struct platform_device *dev, pm_message_t state)
916{ 916{
917 del_timer_sync(&i8042_timer); 917 del_timer_sync(&i8042_timer);
918 i8042_controller_reset(); 918 i8042_controller_reset();
@@ -925,7 +925,7 @@ static int i8042_suspend(struct device *dev, pm_message_t state)
925 * Here we try to reset everything back to a state in which suspended 925 * Here we try to reset everything back to a state in which suspended
926 */ 926 */
927 927
928static int i8042_resume(struct device *dev) 928static int i8042_resume(struct platform_device *dev)
929{ 929{
930 int i; 930 int i;
931 931
@@ -964,17 +964,18 @@ static int i8042_resume(struct device *dev)
964 * because otherwise BIOSes will be confused. 964 * because otherwise BIOSes will be confused.
965 */ 965 */
966 966
967static void i8042_shutdown(struct device *dev) 967static void i8042_shutdown(struct platform_device *dev)
968{ 968{
969 i8042_controller_cleanup(); 969 i8042_controller_cleanup();
970} 970}
971 971
972static struct device_driver i8042_driver = { 972static struct platform_driver i8042_driver = {
973 .name = "i8042",
974 .bus = &platform_bus_type,
975 .suspend = i8042_suspend, 973 .suspend = i8042_suspend,
976 .resume = i8042_resume, 974 .resume = i8042_resume,
977 .shutdown = i8042_shutdown, 975 .shutdown = i8042_shutdown,
976 .driver = {
977 .name = "i8042",
978 },
978}; 979};
979 980
980static int __init i8042_create_kbd_port(void) 981static int __init i8042_create_kbd_port(void)
@@ -1078,7 +1079,7 @@ static int __init i8042_init(void)
1078 goto err_platform_exit; 1079 goto err_platform_exit;
1079 } 1080 }
1080 1081
1081 err = driver_register(&i8042_driver); 1082 err = platform_driver_register(&i8042_driver);
1082 if (err) 1083 if (err)
1083 goto err_controller_cleanup; 1084 goto err_controller_cleanup;
1084 1085
@@ -1126,7 +1127,7 @@ static int __init i8042_init(void)
1126 err_unregister_device: 1127 err_unregister_device:
1127 platform_device_unregister(i8042_platform_device); 1128 platform_device_unregister(i8042_platform_device);
1128 err_unregister_driver: 1129 err_unregister_driver:
1129 driver_unregister(&i8042_driver); 1130 platform_driver_unregister(&i8042_driver);
1130 err_controller_cleanup: 1131 err_controller_cleanup:
1131 i8042_controller_cleanup(); 1132 i8042_controller_cleanup();
1132 err_platform_exit: 1133 err_platform_exit:
@@ -1148,7 +1149,7 @@ static void __exit i8042_exit(void)
1148 del_timer_sync(&i8042_timer); 1149 del_timer_sync(&i8042_timer);
1149 1150
1150 platform_device_unregister(i8042_platform_device); 1151 platform_device_unregister(i8042_platform_device);
1151 driver_unregister(&i8042_driver); 1152 platform_driver_unregister(&i8042_driver);
1152 1153
1153 i8042_platform_exit(); 1154 i8042_platform_exit();
1154 1155
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c
index 52c49258f8a4..a3bd11589bc3 100644
--- a/drivers/input/serio/rpckbd.c
+++ b/drivers/input/serio/rpckbd.c
@@ -107,7 +107,7 @@ static void rpckbd_close(struct serio *port)
107 * Allocate and initialize serio structure for subsequent registration 107 * Allocate and initialize serio structure for subsequent registration
108 * with serio core. 108 * with serio core.
109 */ 109 */
110static int __devinit rpckbd_probe(struct device *dev) 110static int __devinit rpckbd_probe(struct platform_device *dev)
111{ 111{
112 struct serio *serio; 112 struct serio *serio;
113 113
@@ -120,37 +120,38 @@ static int __devinit rpckbd_probe(struct device *dev)
120 serio->write = rpckbd_write; 120 serio->write = rpckbd_write;
121 serio->open = rpckbd_open; 121 serio->open = rpckbd_open;
122 serio->close = rpckbd_close; 122 serio->close = rpckbd_close;
123 serio->dev.parent = dev; 123 serio->dev.parent = &dev->dev;
124 strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name)); 124 strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name));
125 strlcpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys)); 125 strlcpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys));
126 126
127 dev_set_drvdata(dev, serio); 127 platform_set_drvdata(dev, serio);
128 serio_register_port(serio); 128 serio_register_port(serio);
129 return 0; 129 return 0;
130} 130}
131 131
132static int __devexit rpckbd_remove(struct device *dev) 132static int __devexit rpckbd_remove(struct platform_device *dev)
133{ 133{
134 struct serio *serio = dev_get_drvdata(dev); 134 struct serio *serio = platform_get_drvdata(dev);
135 serio_unregister_port(serio); 135 serio_unregister_port(serio);
136 return 0; 136 return 0;
137} 137}
138 138
139static struct device_driver rpckbd_driver = { 139static struct platform_driver rpckbd_driver = {
140 .name = "kart",
141 .bus = &platform_bus_type,
142 .probe = rpckbd_probe, 140 .probe = rpckbd_probe,
143 .remove = __devexit_p(rpckbd_remove), 141 .remove = __devexit_p(rpckbd_remove),
142 .driver = {
143 .name = "kart",
144 },
144}; 145};
145 146
146static int __init rpckbd_init(void) 147static int __init rpckbd_init(void)
147{ 148{
148 return driver_register(&rpckbd_driver); 149 return platform_driver_register(&rpckbd_driver);
149} 150}
150 151
151static void __exit rpckbd_exit(void) 152static void __exit rpckbd_exit(void)
152{ 153{
153 driver_unregister(&rpckbd_driver); 154 platform_driver_unregister(&rpckbd_driver);
154} 155}
155 156
156module_init(rpckbd_init); 157module_init(rpckbd_init);