aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/hdaps.c
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/hwmon/hdaps.c
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/hwmon/hdaps.c')
-rw-r--r--drivers/hwmon/hdaps.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/hwmon/hdaps.c b/drivers/hwmon/hdaps.c
index 1e5dfc7805e2..3bf05d5d0c82 100644
--- a/drivers/hwmon/hdaps.c
+++ b/drivers/hwmon/hdaps.c
@@ -284,7 +284,7 @@ out:
284 284
285/* Device model stuff */ 285/* Device model stuff */
286 286
287static int hdaps_probe(struct device *dev) 287static int hdaps_probe(struct platform_device *dev)
288{ 288{
289 int ret; 289 int ret;
290 290
@@ -296,17 +296,18 @@ static int hdaps_probe(struct device *dev)
296 return 0; 296 return 0;
297} 297}
298 298
299static int hdaps_resume(struct device *dev) 299static int hdaps_resume(struct platform_device *dev)
300{ 300{
301 return hdaps_device_init(); 301 return hdaps_device_init();
302} 302}
303 303
304static struct device_driver hdaps_driver = { 304static struct platform_driver hdaps_driver = {
305 .name = "hdaps",
306 .bus = &platform_bus_type,
307 .owner = THIS_MODULE,
308 .probe = hdaps_probe, 305 .probe = hdaps_probe,
309 .resume = hdaps_resume 306 .resume = hdaps_resume,
307 .driver = {
308 .name = "hdaps",
309 .owner = THIS_MODULE,
310 },
310}; 311};
311 312
312/* Input class stuff */ 313/* Input class stuff */
@@ -550,7 +551,7 @@ static int __init hdaps_init(void)
550 goto out; 551 goto out;
551 } 552 }
552 553
553 ret = driver_register(&hdaps_driver); 554 ret = platform_driver_register(&hdaps_driver);
554 if (ret) 555 if (ret)
555 goto out_region; 556 goto out_region;
556 557
@@ -583,7 +584,7 @@ static int __init hdaps_init(void)
583out_device: 584out_device:
584 platform_device_unregister(pdev); 585 platform_device_unregister(pdev);
585out_driver: 586out_driver:
586 driver_unregister(&hdaps_driver); 587 platform_driver_unregister(&hdaps_driver);
587out_region: 588out_region:
588 release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS); 589 release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS);
589out: 590out:
@@ -597,7 +598,7 @@ static void __exit hdaps_exit(void)
597 input_unregister_device(&hdaps_idev); 598 input_unregister_device(&hdaps_idev);
598 sysfs_remove_group(&pdev->dev.kobj, &hdaps_attribute_group); 599 sysfs_remove_group(&pdev->dev.kobj, &hdaps_attribute_group);
599 platform_device_unregister(pdev); 600 platform_device_unregister(pdev);
600 driver_unregister(&hdaps_driver); 601 platform_driver_unregister(&hdaps_driver);
601 release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS); 602 release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS);
602 603
603 printk(KERN_INFO "hdaps: driver unloaded.\n"); 604 printk(KERN_INFO "hdaps: driver unloaded.\n");