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 | |
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')
-rw-r--r-- | drivers/input/keyboard/corgikbd.c | 29 | ||||
-rw-r--r-- | drivers/input/keyboard/spitzkbd.c | 29 | ||||
-rw-r--r-- | drivers/input/serio/i8042.c | 19 | ||||
-rw-r--r-- | drivers/input/serio/rpckbd.c | 21 | ||||
-rw-r--r-- | drivers/input/touchscreen/corgi_ts.c | 32 |
5 files changed, 67 insertions, 63 deletions
diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c index d00d14bb637a..64672d491222 100644 --- a/drivers/input/keyboard/corgikbd.c +++ b/drivers/input/keyboard/corgikbd.c | |||
@@ -259,17 +259,17 @@ static void corgikbd_hinge_timer(unsigned long data) | |||
259 | } | 259 | } |
260 | 260 | ||
261 | #ifdef CONFIG_PM | 261 | #ifdef CONFIG_PM |
262 | static int corgikbd_suspend(struct device *dev, pm_message_t state) | 262 | static int corgikbd_suspend(struct platform_device *dev, pm_message_t state) |
263 | { | 263 | { |
264 | struct corgikbd *corgikbd = dev_get_drvdata(dev); | 264 | struct corgikbd *corgikbd = platform_get_drvdata(dev); |
265 | corgikbd->suspended = 1; | 265 | corgikbd->suspended = 1; |
266 | 266 | ||
267 | return 0; | 267 | return 0; |
268 | } | 268 | } |
269 | 269 | ||
270 | static int corgikbd_resume(struct device *dev) | 270 | static int corgikbd_resume(struct platform_device *dev) |
271 | { | 271 | { |
272 | struct corgikbd *corgikbd = dev_get_drvdata(dev); | 272 | struct corgikbd *corgikbd = platform_get_drvdata(dev); |
273 | 273 | ||
274 | /* Upon resume, ignore the suspend key for a short while */ | 274 | /* Upon resume, ignore the suspend key for a short while */ |
275 | corgikbd->suspend_jiffies=jiffies; | 275 | corgikbd->suspend_jiffies=jiffies; |
@@ -282,7 +282,7 @@ static int corgikbd_resume(struct device *dev) | |||
282 | #define corgikbd_resume NULL | 282 | #define corgikbd_resume NULL |
283 | #endif | 283 | #endif |
284 | 284 | ||
285 | static int __init corgikbd_probe(struct device *dev) | 285 | static int __init corgikbd_probe(struct platform_device *pdev) |
286 | { | 286 | { |
287 | struct corgikbd *corgikbd; | 287 | struct corgikbd *corgikbd; |
288 | struct input_dev *input_dev; | 288 | struct input_dev *input_dev; |
@@ -296,7 +296,7 @@ static int __init corgikbd_probe(struct device *dev) | |||
296 | return -ENOMEM; | 296 | return -ENOMEM; |
297 | } | 297 | } |
298 | 298 | ||
299 | dev_set_drvdata(dev, corgikbd); | 299 | platform_set_drvdata(pdev, corgikbd); |
300 | 300 | ||
301 | corgikbd->input = input_dev; | 301 | corgikbd->input = input_dev; |
302 | spin_lock_init(&corgikbd->lock); | 302 | spin_lock_init(&corgikbd->lock); |
@@ -321,7 +321,7 @@ static int __init corgikbd_probe(struct device *dev) | |||
321 | input_dev->id.vendor = 0x0001; | 321 | input_dev->id.vendor = 0x0001; |
322 | input_dev->id.product = 0x0001; | 322 | input_dev->id.product = 0x0001; |
323 | input_dev->id.version = 0x0100; | 323 | input_dev->id.version = 0x0100; |
324 | input_dev->cdev.dev = dev; | 324 | input_dev->cdev.dev = &pdev->dev; |
325 | input_dev->private = corgikbd; | 325 | input_dev->private = corgikbd; |
326 | 326 | ||
327 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW); | 327 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW); |
@@ -356,10 +356,10 @@ static int __init corgikbd_probe(struct device *dev) | |||
356 | return 0; | 356 | return 0; |
357 | } | 357 | } |
358 | 358 | ||
359 | static int corgikbd_remove(struct device *dev) | 359 | static int corgikbd_remove(struct platform_device *pdev) |
360 | { | 360 | { |
361 | int i; | 361 | int i; |
362 | struct corgikbd *corgikbd = dev_get_drvdata(dev); | 362 | struct corgikbd *corgikbd = platform_get_drvdata(pdev); |
363 | 363 | ||
364 | for (i = 0; i < CORGI_KEY_SENSE_NUM; i++) | 364 | for (i = 0; i < CORGI_KEY_SENSE_NUM; i++) |
365 | free_irq(CORGI_IRQ_GPIO_KEY_SENSE(i), corgikbd); | 365 | free_irq(CORGI_IRQ_GPIO_KEY_SENSE(i), corgikbd); |
@@ -374,23 +374,24 @@ static int corgikbd_remove(struct device *dev) | |||
374 | return 0; | 374 | return 0; |
375 | } | 375 | } |
376 | 376 | ||
377 | static struct device_driver corgikbd_driver = { | 377 | static struct platform_driver corgikbd_driver = { |
378 | .name = "corgi-keyboard", | ||
379 | .bus = &platform_bus_type, | ||
380 | .probe = corgikbd_probe, | 378 | .probe = corgikbd_probe, |
381 | .remove = corgikbd_remove, | 379 | .remove = corgikbd_remove, |
382 | .suspend = corgikbd_suspend, | 380 | .suspend = corgikbd_suspend, |
383 | .resume = corgikbd_resume, | 381 | .resume = corgikbd_resume, |
382 | .driver = { | ||
383 | .name = "corgi-keyboard", | ||
384 | }, | ||
384 | }; | 385 | }; |
385 | 386 | ||
386 | static int __devinit corgikbd_init(void) | 387 | static int __devinit corgikbd_init(void) |
387 | { | 388 | { |
388 | return driver_register(&corgikbd_driver); | 389 | return platform_driver_register(&corgikbd_driver); |
389 | } | 390 | } |
390 | 391 | ||
391 | static void __exit corgikbd_exit(void) | 392 | static void __exit corgikbd_exit(void) |
392 | { | 393 | { |
393 | driver_unregister(&corgikbd_driver); | 394 | platform_driver_unregister(&corgikbd_driver); |
394 | } | 395 | } |
395 | 396 | ||
396 | module_init(corgikbd_init); | 397 | module_init(corgikbd_init); |
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c index 0fa38a559cdf..6a15fe3bc527 100644 --- a/drivers/input/keyboard/spitzkbd.c +++ b/drivers/input/keyboard/spitzkbd.c | |||
@@ -309,10 +309,10 @@ static void spitzkbd_hinge_timer(unsigned long data) | |||
309 | } | 309 | } |
310 | 310 | ||
311 | #ifdef CONFIG_PM | 311 | #ifdef CONFIG_PM |
312 | static int spitzkbd_suspend(struct device *dev, pm_message_t state) | 312 | static int spitzkbd_suspend(struct platform_device *dev, pm_message_t state) |
313 | { | 313 | { |
314 | int i; | 314 | int i; |
315 | struct spitzkbd *spitzkbd = dev_get_drvdata(dev); | 315 | struct spitzkbd *spitzkbd = platform_get_drvdata(dev); |
316 | spitzkbd->suspended = 1; | 316 | spitzkbd->suspended = 1; |
317 | 317 | ||
318 | /* Set Strobe lines as inputs - *except* strobe line 0 leave this | 318 | /* Set Strobe lines as inputs - *except* strobe line 0 leave this |
@@ -323,10 +323,10 @@ static int spitzkbd_suspend(struct device *dev, pm_message_t state) | |||
323 | return 0; | 323 | return 0; |
324 | } | 324 | } |
325 | 325 | ||
326 | static int spitzkbd_resume(struct device *dev) | 326 | static int spitzkbd_resume(struct platform_device *dev) |
327 | { | 327 | { |
328 | int i; | 328 | int i; |
329 | struct spitzkbd *spitzkbd = dev_get_drvdata(dev); | 329 | struct spitzkbd *spitzkbd = platform_get_drvdata(dev); |
330 | 330 | ||
331 | for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++) | 331 | for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++) |
332 | pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH); | 332 | pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH); |
@@ -342,7 +342,7 @@ static int spitzkbd_resume(struct device *dev) | |||
342 | #define spitzkbd_resume NULL | 342 | #define spitzkbd_resume NULL |
343 | #endif | 343 | #endif |
344 | 344 | ||
345 | static int __init spitzkbd_probe(struct device *dev) | 345 | static int __init spitzkbd_probe(struct platform_device *dev) |
346 | { | 346 | { |
347 | struct spitzkbd *spitzkbd; | 347 | struct spitzkbd *spitzkbd; |
348 | struct input_dev *input_dev; | 348 | struct input_dev *input_dev; |
@@ -358,7 +358,7 @@ static int __init spitzkbd_probe(struct device *dev) | |||
358 | return -ENOMEM; | 358 | return -ENOMEM; |
359 | } | 359 | } |
360 | 360 | ||
361 | dev_set_drvdata(dev, spitzkbd); | 361 | platform_set_drvdata(dev, spitzkbd); |
362 | strcpy(spitzkbd->phys, "spitzkbd/input0"); | 362 | strcpy(spitzkbd->phys, "spitzkbd/input0"); |
363 | 363 | ||
364 | spin_lock_init(&spitzkbd->lock); | 364 | spin_lock_init(&spitzkbd->lock); |
@@ -380,7 +380,7 @@ static int __init spitzkbd_probe(struct device *dev) | |||
380 | input_dev->private = spitzkbd; | 380 | input_dev->private = spitzkbd; |
381 | input_dev->name = "Spitz Keyboard"; | 381 | input_dev->name = "Spitz Keyboard"; |
382 | input_dev->phys = spitzkbd->phys; | 382 | input_dev->phys = spitzkbd->phys; |
383 | input_dev->cdev.dev = dev; | 383 | input_dev->cdev.dev = &dev->dev; |
384 | 384 | ||
385 | input_dev->id.bustype = BUS_HOST; | 385 | input_dev->id.bustype = BUS_HOST; |
386 | input_dev->id.vendor = 0x0001; | 386 | input_dev->id.vendor = 0x0001; |
@@ -437,10 +437,10 @@ static int __init spitzkbd_probe(struct device *dev) | |||
437 | return 0; | 437 | return 0; |
438 | } | 438 | } |
439 | 439 | ||
440 | static int spitzkbd_remove(struct device *dev) | 440 | static int spitzkbd_remove(struct platform_device *dev) |
441 | { | 441 | { |
442 | int i; | 442 | int i; |
443 | struct spitzkbd *spitzkbd = dev_get_drvdata(dev); | 443 | struct spitzkbd *spitzkbd = platform_get_drvdata(dev); |
444 | 444 | ||
445 | for (i = 0; i < SPITZ_KEY_SENSE_NUM; i++) | 445 | for (i = 0; i < SPITZ_KEY_SENSE_NUM; i++) |
446 | free_irq(IRQ_GPIO(spitz_senses[i]), spitzkbd); | 446 | free_irq(IRQ_GPIO(spitz_senses[i]), spitzkbd); |
@@ -460,23 +460,24 @@ static int spitzkbd_remove(struct device *dev) | |||
460 | return 0; | 460 | return 0; |
461 | } | 461 | } |
462 | 462 | ||
463 | static struct device_driver spitzkbd_driver = { | 463 | static struct platform_driver spitzkbd_driver = { |
464 | .name = "spitz-keyboard", | ||
465 | .bus = &platform_bus_type, | ||
466 | .probe = spitzkbd_probe, | 464 | .probe = spitzkbd_probe, |
467 | .remove = spitzkbd_remove, | 465 | .remove = spitzkbd_remove, |
468 | .suspend = spitzkbd_suspend, | 466 | .suspend = spitzkbd_suspend, |
469 | .resume = spitzkbd_resume, | 467 | .resume = spitzkbd_resume, |
468 | .driver = { | ||
469 | .name = "spitz-keyboard", | ||
470 | }, | ||
470 | }; | 471 | }; |
471 | 472 | ||
472 | static int __devinit spitzkbd_init(void) | 473 | static int __devinit spitzkbd_init(void) |
473 | { | 474 | { |
474 | return driver_register(&spitzkbd_driver); | 475 | return platform_driver_register(&spitzkbd_driver); |
475 | } | 476 | } |
476 | 477 | ||
477 | static void __exit spitzkbd_exit(void) | 478 | static void __exit spitzkbd_exit(void) |
478 | { | 479 | { |
479 | driver_unregister(&spitzkbd_driver); | 480 | platform_driver_unregister(&spitzkbd_driver); |
480 | } | 481 | } |
481 | 482 | ||
482 | module_init(spitzkbd_init); | 483 | module_init(spitzkbd_init); |
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 | ||
915 | static int i8042_suspend(struct device *dev, pm_message_t state) | 915 | static 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 | ||
928 | static int i8042_resume(struct device *dev) | 928 | static 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 | ||
967 | static void i8042_shutdown(struct device *dev) | 967 | static void i8042_shutdown(struct platform_device *dev) |
968 | { | 968 | { |
969 | i8042_controller_cleanup(); | 969 | i8042_controller_cleanup(); |
970 | } | 970 | } |
971 | 971 | ||
972 | static struct device_driver i8042_driver = { | 972 | static 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 | ||
980 | static int __init i8042_create_kbd_port(void) | 981 | static 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 | */ |
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); |
diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c index 15e88eeae8d6..1042987856f7 100644 --- a/drivers/input/touchscreen/corgi_ts.c +++ b/drivers/input/touchscreen/corgi_ts.c | |||
@@ -231,9 +231,9 @@ static irqreturn_t ts_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
231 | } | 231 | } |
232 | 232 | ||
233 | #ifdef CONFIG_PM | 233 | #ifdef CONFIG_PM |
234 | static int corgits_suspend(struct device *dev, pm_message_t state) | 234 | static int corgits_suspend(struct platform_device *dev, pm_message_t state) |
235 | { | 235 | { |
236 | struct corgi_ts *corgi_ts = dev_get_drvdata(dev); | 236 | struct corgi_ts *corgi_ts = platform_get_drvdata(dev); |
237 | 237 | ||
238 | if (corgi_ts->pendown) { | 238 | if (corgi_ts->pendown) { |
239 | del_timer_sync(&corgi_ts->timer); | 239 | del_timer_sync(&corgi_ts->timer); |
@@ -248,9 +248,9 @@ static int corgits_suspend(struct device *dev, pm_message_t state) | |||
248 | return 0; | 248 | return 0; |
249 | } | 249 | } |
250 | 250 | ||
251 | static int corgits_resume(struct device *dev) | 251 | static int corgits_resume(struct platform_device *dev) |
252 | { | 252 | { |
253 | struct corgi_ts *corgi_ts = dev_get_drvdata(dev); | 253 | struct corgi_ts *corgi_ts = platform_get_drvdata(dev); |
254 | 254 | ||
255 | corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS); | 255 | corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS); |
256 | /* Enable Falling Edge */ | 256 | /* Enable Falling Edge */ |
@@ -264,10 +264,9 @@ static int corgits_resume(struct device *dev) | |||
264 | #define corgits_resume NULL | 264 | #define corgits_resume NULL |
265 | #endif | 265 | #endif |
266 | 266 | ||
267 | static int __init corgits_probe(struct device *dev) | 267 | static int __init corgits_probe(struct platform_device *pdev) |
268 | { | 268 | { |
269 | struct corgi_ts *corgi_ts; | 269 | struct corgi_ts *corgi_ts; |
270 | struct platform_device *pdev = to_platform_device(dev); | ||
271 | struct input_dev *input_dev; | 270 | struct input_dev *input_dev; |
272 | int err = -ENOMEM; | 271 | int err = -ENOMEM; |
273 | 272 | ||
@@ -276,9 +275,9 @@ static int __init corgits_probe(struct device *dev) | |||
276 | if (!corgi_ts || !input_dev) | 275 | if (!corgi_ts || !input_dev) |
277 | goto fail; | 276 | goto fail; |
278 | 277 | ||
279 | dev_set_drvdata(dev, corgi_ts); | 278 | platform_set_drvdata(pdev, corgi_ts); |
280 | 279 | ||
281 | corgi_ts->machinfo = dev->platform_data; | 280 | corgi_ts->machinfo = pdev->dev.platform_data; |
282 | corgi_ts->irq_gpio = platform_get_irq(pdev, 0); | 281 | corgi_ts->irq_gpio = platform_get_irq(pdev, 0); |
283 | 282 | ||
284 | if (corgi_ts->irq_gpio < 0) { | 283 | if (corgi_ts->irq_gpio < 0) { |
@@ -298,7 +297,7 @@ static int __init corgits_probe(struct device *dev) | |||
298 | input_dev->id.vendor = 0x0001; | 297 | input_dev->id.vendor = 0x0001; |
299 | input_dev->id.product = 0x0002; | 298 | input_dev->id.product = 0x0002; |
300 | input_dev->id.version = 0x0100; | 299 | input_dev->id.version = 0x0100; |
301 | input_dev->cdev.dev = dev; | 300 | input_dev->cdev.dev = &pdev->dev; |
302 | input_dev->private = corgi_ts; | 301 | input_dev->private = corgi_ts; |
303 | 302 | ||
304 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); | 303 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); |
@@ -339,9 +338,9 @@ static int __init corgits_probe(struct device *dev) | |||
339 | 338 | ||
340 | } | 339 | } |
341 | 340 | ||
342 | static int corgits_remove(struct device *dev) | 341 | static int corgits_remove(struct platform_device *pdev) |
343 | { | 342 | { |
344 | struct corgi_ts *corgi_ts = dev_get_drvdata(dev); | 343 | struct corgi_ts *corgi_ts = platform_get_drvdata(pdev); |
345 | 344 | ||
346 | free_irq(corgi_ts->irq_gpio, NULL); | 345 | free_irq(corgi_ts->irq_gpio, NULL); |
347 | del_timer_sync(&corgi_ts->timer); | 346 | del_timer_sync(&corgi_ts->timer); |
@@ -351,23 +350,24 @@ static int corgits_remove(struct device *dev) | |||
351 | return 0; | 350 | return 0; |
352 | } | 351 | } |
353 | 352 | ||
354 | static struct device_driver corgits_driver = { | 353 | static struct platform_driver corgits_driver = { |
355 | .name = "corgi-ts", | ||
356 | .bus = &platform_bus_type, | ||
357 | .probe = corgits_probe, | 354 | .probe = corgits_probe, |
358 | .remove = corgits_remove, | 355 | .remove = corgits_remove, |
359 | .suspend = corgits_suspend, | 356 | .suspend = corgits_suspend, |
360 | .resume = corgits_resume, | 357 | .resume = corgits_resume, |
358 | .driver = { | ||
359 | .name = "corgi-ts", | ||
360 | }, | ||
361 | }; | 361 | }; |
362 | 362 | ||
363 | static int __devinit corgits_init(void) | 363 | static int __devinit corgits_init(void) |
364 | { | 364 | { |
365 | return driver_register(&corgits_driver); | 365 | return platform_driver_register(&corgits_driver); |
366 | } | 366 | } |
367 | 367 | ||
368 | static void __exit corgits_exit(void) | 368 | static void __exit corgits_exit(void) |
369 | { | 369 | { |
370 | driver_unregister(&corgits_driver); | 370 | platform_driver_unregister(&corgits_driver); |
371 | } | 371 | } |
372 | 372 | ||
373 | module_init(corgits_init); | 373 | module_init(corgits_init); |