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/video/backlight | |
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/video/backlight')
-rw-r--r-- | drivers/video/backlight/corgi_bl.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/video/backlight/corgi_bl.c b/drivers/video/backlight/corgi_bl.c index 4867498f68e8..bc492f26c5a9 100644 --- a/drivers/video/backlight/corgi_bl.c +++ b/drivers/video/backlight/corgi_bl.c | |||
@@ -73,13 +73,13 @@ static void corgibl_blank(int blank) | |||
73 | } | 73 | } |
74 | 74 | ||
75 | #ifdef CONFIG_PM | 75 | #ifdef CONFIG_PM |
76 | static int corgibl_suspend(struct device *dev, pm_message_t state) | 76 | static int corgibl_suspend(struct platform_device *dev, pm_message_t state) |
77 | { | 77 | { |
78 | corgibl_blank(FB_BLANK_POWERDOWN); | 78 | corgibl_blank(FB_BLANK_POWERDOWN); |
79 | return 0; | 79 | return 0; |
80 | } | 80 | } |
81 | 81 | ||
82 | static int corgibl_resume(struct device *dev) | 82 | static int corgibl_resume(struct platform_device *dev) |
83 | { | 83 | { |
84 | corgibl_blank(FB_BLANK_UNBLANK); | 84 | corgibl_blank(FB_BLANK_UNBLANK); |
85 | return 0; | 85 | return 0; |
@@ -137,9 +137,9 @@ static struct backlight_properties corgibl_data = { | |||
137 | 137 | ||
138 | static struct backlight_device *corgi_backlight_device; | 138 | static struct backlight_device *corgi_backlight_device; |
139 | 139 | ||
140 | static int __init corgibl_probe(struct device *dev) | 140 | static int __init corgibl_probe(struct platform_device *pdev) |
141 | { | 141 | { |
142 | struct corgibl_machinfo *machinfo = dev->platform_data; | 142 | struct corgibl_machinfo *machinfo = pdev->dev.platform_data; |
143 | 143 | ||
144 | corgibl_data.max_brightness = machinfo->max_intensity; | 144 | corgibl_data.max_brightness = machinfo->max_intensity; |
145 | corgibl_mach_set_intensity = machinfo->set_bl_intensity; | 145 | corgibl_mach_set_intensity = machinfo->set_bl_intensity; |
@@ -156,7 +156,7 @@ static int __init corgibl_probe(struct device *dev) | |||
156 | return 0; | 156 | return 0; |
157 | } | 157 | } |
158 | 158 | ||
159 | static int corgibl_remove(struct device *dev) | 159 | static int corgibl_remove(struct platform_device *dev) |
160 | { | 160 | { |
161 | backlight_device_unregister(corgi_backlight_device); | 161 | backlight_device_unregister(corgi_backlight_device); |
162 | 162 | ||
@@ -166,23 +166,24 @@ static int corgibl_remove(struct device *dev) | |||
166 | return 0; | 166 | return 0; |
167 | } | 167 | } |
168 | 168 | ||
169 | static struct device_driver corgibl_driver = { | 169 | static struct platform_driver corgibl_driver = { |
170 | .name = "corgi-bl", | ||
171 | .bus = &platform_bus_type, | ||
172 | .probe = corgibl_probe, | 170 | .probe = corgibl_probe, |
173 | .remove = corgibl_remove, | 171 | .remove = corgibl_remove, |
174 | .suspend = corgibl_suspend, | 172 | .suspend = corgibl_suspend, |
175 | .resume = corgibl_resume, | 173 | .resume = corgibl_resume, |
174 | .driver = { | ||
175 | .name = "corgi-bl", | ||
176 | }, | ||
176 | }; | 177 | }; |
177 | 178 | ||
178 | static int __init corgibl_init(void) | 179 | static int __init corgibl_init(void) |
179 | { | 180 | { |
180 | return driver_register(&corgibl_driver); | 181 | return platform_driver_register(&corgibl_driver); |
181 | } | 182 | } |
182 | 183 | ||
183 | static void __exit corgibl_exit(void) | 184 | static void __exit corgibl_exit(void) |
184 | { | 185 | { |
185 | driver_unregister(&corgibl_driver); | 186 | platform_driver_unregister(&corgibl_driver); |
186 | } | 187 | } |
187 | 188 | ||
188 | module_init(corgibl_init); | 189 | module_init(corgibl_init); |