diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-11-09 17:32:44 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-09 17:32:44 -0500 |
commit | 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch) | |
tree | d8825be54cefb6ad6707478d719c8e30605bee7b /drivers/input/serio/rpckbd.c | |
parent | 00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (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/rpckbd.c')
-rw-r--r-- | drivers/input/serio/rpckbd.c | 21 |
1 files changed, 11 insertions, 10 deletions
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 | */ |
110 | static int __devinit rpckbd_probe(struct device *dev) | 110 | static 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 | ||
132 | static int __devexit rpckbd_remove(struct device *dev) | 132 | static 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 | ||
139 | static struct device_driver rpckbd_driver = { | 139 | static 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 | ||
146 | static int __init rpckbd_init(void) | 147 | static int __init rpckbd_init(void) |
147 | { | 148 | { |
148 | return driver_register(&rpckbd_driver); | 149 | return platform_driver_register(&rpckbd_driver); |
149 | } | 150 | } |
150 | 151 | ||
151 | static void __exit rpckbd_exit(void) | 152 | static void __exit rpckbd_exit(void) |
152 | { | 153 | { |
153 | driver_unregister(&rpckbd_driver); | 154 | platform_driver_unregister(&rpckbd_driver); |
154 | } | 155 | } |
155 | 156 | ||
156 | module_init(rpckbd_init); | 157 | module_init(rpckbd_init); |