diff options
Diffstat (limited to 'drivers/video/sgivwfb.c')
-rw-r--r-- | drivers/video/sgivwfb.c | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c index 8413907b379a..7054660767e4 100644 --- a/drivers/video/sgivwfb.c +++ b/drivers/video/sgivwfb.c @@ -18,6 +18,8 @@ #include <linux/fb.h> #include <linux/init.h> #include <linux/ioport.h> +#include <linux/platform_device.h> + #include <asm/io.h> #include <asm/mtrr.h> @@ -124,7 +126,6 @@ static struct fb_ops sgivwfb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, .fb_mmap = sgivwfb_mmap, }; @@ -749,13 +750,8 @@ int __init sgivwfb_setup(char *options) /* * Initialisation */ -static void sgivwfb_release(struct device *device) -{ -} - -static int __init sgivwfb_probe(struct device *device) +static int __init sgivwfb_probe(struct platform_device *dev) { - struct platform_device *dev = to_platform_device(device); struct sgivw_par *par; struct fb_info *info; char *monitor; @@ -816,7 +812,7 @@ static int __init sgivwfb_probe(struct device *device) goto fail_register_framebuffer; } - dev_set_drvdata(&dev->dev, info); + platform_set_drvdata(dev, info); printk(KERN_INFO "fb%d: SGI DBE frame buffer device, using %ldK of video memory at %#lx\n", info->node, sgivwfb_mem_size >> 10, sgivwfb_mem_phys); @@ -834,9 +830,9 @@ fail_ioremap_regs: return -ENXIO; } -static int sgivwfb_remove(struct device *device) +static int sgivwfb_remove(struct platform_device *dev) { - struct fb_info *info = dev_get_drvdata(device); + struct fb_info *info = platform_get_drvdata(dev); if (info) { struct sgivw_par *par = info->par; @@ -850,20 +846,15 @@ static int sgivwfb_remove(struct device *device) return 0; } -static struct device_driver sgivwfb_driver = { - .name = "sgivwfb", - .bus = &platform_bus_type, +static struct platform_driver sgivwfb_driver = { .probe = sgivwfb_probe, .remove = sgivwfb_remove, + .driver = { + .name = "sgivwfb", + }, }; -static struct platform_device sgivwfb_device = { - .name = "sgivwfb", - .id = 0, - .dev = { - .release = sgivwfb_release, - } -}; +static struct platform_device *sgivwfb_device; int __init sgivwfb_init(void) { @@ -876,11 +867,17 @@ int __init sgivwfb_init(void) return -ENODEV; sgivwfb_setup(option); #endif - ret = driver_register(&sgivwfb_driver); + ret = platform_driver_register(&sgivwfb_driver); if (!ret) { - ret = platform_device_register(&sgivwfb_device); - if (ret) - driver_unregister(&sgivwfb_driver); + sgivwfb_device = platform_device_alloc("sgivwfb", 0); + if (sgivwfb_device) { + ret = platform_device_add(sgivwfb_device); + } else + ret = -ENOMEM; + if (ret) { + platform_driver_unregister(&sgivwfb_driver); + platform_device_put(sgivwfb_device); + } } return ret; } @@ -892,8 +889,8 @@ MODULE_LICENSE("GPL"); static void __exit sgivwfb_exit(void) { - platform_device_unregister(&sgivwfb_device); - driver_unregister(&sgivwfb_driver); + platform_device_unregister(sgivwfb_device); + platform_driver_unregister(&sgivwfb_driver); } module_exit(sgivwfb_exit); |