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/touchscreen | |
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/touchscreen')
-rw-r--r-- | drivers/input/touchscreen/corgi_ts.c | 32 |
1 files changed, 16 insertions, 16 deletions
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); |