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/misc/hdpuftrs/hdpu_nexus.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/misc/hdpuftrs/hdpu_nexus.c')
-rw-r--r-- | drivers/misc/hdpuftrs/hdpu_nexus.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/misc/hdpuftrs/hdpu_nexus.c b/drivers/misc/hdpuftrs/hdpu_nexus.c index 165f3405df27..21da8a6ff8a1 100644 --- a/drivers/misc/hdpuftrs/hdpu_nexus.c +++ b/drivers/misc/hdpuftrs/hdpu_nexus.c | |||
@@ -23,19 +23,20 @@ | |||
23 | 23 | ||
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | 25 | ||
26 | static int hdpu_nexus_probe(struct device *ddev); | 26 | static int hdpu_nexus_probe(struct platform_device *pdev); |
27 | static int hdpu_nexus_remove(struct device *ddev); | 27 | static int hdpu_nexus_remove(struct platform_device *pdev); |
28 | 28 | ||
29 | static struct proc_dir_entry *hdpu_slot_id; | 29 | static struct proc_dir_entry *hdpu_slot_id; |
30 | static struct proc_dir_entry *hdpu_chassis_id; | 30 | static struct proc_dir_entry *hdpu_chassis_id; |
31 | static int slot_id = -1; | 31 | static int slot_id = -1; |
32 | static int chassis_id = -1; | 32 | static int chassis_id = -1; |
33 | 33 | ||
34 | static struct device_driver hdpu_nexus_driver = { | 34 | static struct platform_driver hdpu_nexus_driver = { |
35 | .name = HDPU_NEXUS_NAME, | ||
36 | .bus = &platform_bus_type, | ||
37 | .probe = hdpu_nexus_probe, | 35 | .probe = hdpu_nexus_probe, |
38 | .remove = hdpu_nexus_remove, | 36 | .remove = hdpu_nexus_remove, |
37 | .driver = { | ||
38 | .name = HDPU_NEXUS_NAME, | ||
39 | }, | ||
39 | }; | 40 | }; |
40 | 41 | ||
41 | int hdpu_slot_id_read(char *buffer, char **buffer_location, off_t offset, | 42 | int hdpu_slot_id_read(char *buffer, char **buffer_location, off_t offset, |
@@ -56,9 +57,8 @@ int hdpu_chassis_id_read(char *buffer, char **buffer_location, off_t offset, | |||
56 | return sprintf(buffer, "%d\n", chassis_id); | 57 | return sprintf(buffer, "%d\n", chassis_id); |
57 | } | 58 | } |
58 | 59 | ||
59 | static int hdpu_nexus_probe(struct device *ddev) | 60 | static int hdpu_nexus_probe(struct platform_device *pdev) |
60 | { | 61 | { |
61 | struct platform_device *pdev = to_platform_device(ddev); | ||
62 | struct resource *res; | 62 | struct resource *res; |
63 | 63 | ||
64 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 64 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -81,7 +81,7 @@ static int hdpu_nexus_probe(struct device *ddev) | |||
81 | return 0; | 81 | return 0; |
82 | } | 82 | } |
83 | 83 | ||
84 | static int hdpu_nexus_remove(struct device *ddev) | 84 | static int hdpu_nexus_remove(struct platform_device *pdev) |
85 | { | 85 | { |
86 | slot_id = -1; | 86 | slot_id = -1; |
87 | chassis_id = -1; | 87 | chassis_id = -1; |
@@ -95,13 +95,13 @@ static int hdpu_nexus_remove(struct device *ddev) | |||
95 | static int __init nexus_init(void) | 95 | static int __init nexus_init(void) |
96 | { | 96 | { |
97 | int rc; | 97 | int rc; |
98 | rc = driver_register(&hdpu_nexus_driver); | 98 | rc = platform_driver_register(&hdpu_nexus_driver); |
99 | return rc; | 99 | return rc; |
100 | } | 100 | } |
101 | 101 | ||
102 | static void __exit nexus_exit(void) | 102 | static void __exit nexus_exit(void) |
103 | { | 103 | { |
104 | driver_unregister(&hdpu_nexus_driver); | 104 | platform_driver_unregister(&hdpu_nexus_driver); |
105 | } | 105 | } |
106 | 106 | ||
107 | module_init(nexus_init); | 107 | module_init(nexus_init); |