From 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 Mon Sep 17 00:00:00 2001 From: Russell King Date: Wed, 9 Nov 2005 22:32:44 +0000 Subject: [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 Acked-by: Greg Kroah-Hartman --- drivers/video/dnfb.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/video/dnfb.c') diff --git a/drivers/video/dnfb.c b/drivers/video/dnfb.c index 957a3ada2b7..5abd3cb0067 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) * Initialization */ -static int __devinit dnfb_probe(struct device *device) +static int __devinit dnfb_probe(struct platform_device *dev) { - struct platform_device *dev = to_platform_device(device); struct fb_info *info; int err = 0; @@ -257,7 +256,7 @@ static int __devinit dnfb_probe(struct device *device) framebuffer_release(info); return err; } - dev_set_drvdata(&dev->dev, info); + platform_set_drvdata(dev, info); /* now we have registered we can safely setup the hardware */ out_8(AP_CONTROL_3A, RESET_CREG); @@ -271,10 +270,11 @@ static int __devinit dnfb_probe(struct device *device) return err; } -static struct device_driver dnfb_driver = { - .name = "dnfb", - .bus = &platform_bus_type, +static struct platform_driver dnfb_driver = { .probe = dnfb_probe, + .driver = { + .name = "dnfb", + }, }; static struct platform_device dnfb_device = { @@ -288,12 +288,12 @@ int __init dnfb_init(void) if (fb_get_options("dnfb", NULL)) return -ENODEV; - ret = driver_register(&dnfb_driver); + ret = platform_driver_register(&dnfb_driver); if (!ret) { ret = platform_device_register(&dnfb_device); if (ret) - driver_unregister(&dnfb_driver); + platform_driver_unregister(&dnfb_driver); } return ret; } -- cgit v1.2.3