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/dnfb.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/video/dnfb.c')
-rw-r--r-- | drivers/video/dnfb.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/video/dnfb.c b/drivers/video/dnfb.c index 957a3ada2b75..5abd3cb00671 100644 --- a/drivers/video/dnfb.c +++ b/drivers/video/dnfb.c | |||
@@ -227,9 +227,8 @@ void dnfb_copyarea(struct fb_info *info, const struct fb_copyarea *area) | |||
227 | * Initialization | 227 | * Initialization |
228 | */ | 228 | */ |
229 | 229 | ||
230 | static int __devinit dnfb_probe(struct device *device) | 230 | static int __devinit dnfb_probe(struct platform_device *dev) |
231 | { | 231 | { |
232 | struct platform_device *dev = to_platform_device(device); | ||
233 | struct fb_info *info; | 232 | struct fb_info *info; |
234 | int err = 0; | 233 | int err = 0; |
235 | 234 | ||
@@ -257,7 +256,7 @@ static int __devinit dnfb_probe(struct device *device) | |||
257 | framebuffer_release(info); | 256 | framebuffer_release(info); |
258 | return err; | 257 | return err; |
259 | } | 258 | } |
260 | dev_set_drvdata(&dev->dev, info); | 259 | platform_set_drvdata(dev, info); |
261 | 260 | ||
262 | /* now we have registered we can safely setup the hardware */ | 261 | /* now we have registered we can safely setup the hardware */ |
263 | out_8(AP_CONTROL_3A, RESET_CREG); | 262 | out_8(AP_CONTROL_3A, RESET_CREG); |
@@ -271,10 +270,11 @@ static int __devinit dnfb_probe(struct device *device) | |||
271 | return err; | 270 | return err; |
272 | } | 271 | } |
273 | 272 | ||
274 | static struct device_driver dnfb_driver = { | 273 | static struct platform_driver dnfb_driver = { |
275 | .name = "dnfb", | ||
276 | .bus = &platform_bus_type, | ||
277 | .probe = dnfb_probe, | 274 | .probe = dnfb_probe, |
275 | .driver = { | ||
276 | .name = "dnfb", | ||
277 | }, | ||
278 | }; | 278 | }; |
279 | 279 | ||
280 | static struct platform_device dnfb_device = { | 280 | static struct platform_device dnfb_device = { |
@@ -288,12 +288,12 @@ int __init dnfb_init(void) | |||
288 | if (fb_get_options("dnfb", NULL)) | 288 | if (fb_get_options("dnfb", NULL)) |
289 | return -ENODEV; | 289 | return -ENODEV; |
290 | 290 | ||
291 | ret = driver_register(&dnfb_driver); | 291 | ret = platform_driver_register(&dnfb_driver); |
292 | 292 | ||
293 | if (!ret) { | 293 | if (!ret) { |
294 | ret = platform_device_register(&dnfb_device); | 294 | ret = platform_device_register(&dnfb_device); |
295 | if (ret) | 295 | if (ret) |
296 | driver_unregister(&dnfb_driver); | 296 | platform_driver_unregister(&dnfb_driver); |
297 | } | 297 | } |
298 | return ret; | 298 | return ret; |
299 | } | 299 | } |