X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=inline;f=drivers%2Fvideo%2Fvfb.c;h=77eed1fd994366d4140ae74d319eee2a94fe396d;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=b137a3fe07525afed563ff99075adc57deb1d1b2;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c index b137a3fe0..77eed1fd9 100644 --- a/drivers/video/vfb.c +++ b/drivers/video/vfb.c @@ -20,6 +20,8 @@ #include #include #include +#include + #include #include #include @@ -79,7 +81,7 @@ static int vfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info); static int vfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info); -static int vfb_mmap(struct fb_info *info, struct file *file, +static int vfb_mmap(struct fb_info *info, struct vm_area_struct *vma); static struct fb_ops vfb_ops = { @@ -90,7 +92,6 @@ static struct fb_ops vfb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, .fb_mmap = vfb_mmap, }; @@ -367,7 +368,7 @@ static int vfb_pan_display(struct fb_var_screeninfo *var, * Most drivers don't need their own mmap function */ -static int vfb_mmap(struct fb_info *info, struct file *file, +static int vfb_mmap(struct fb_info *info, struct vm_area_struct *vma) { return -EINVAL; @@ -400,11 +401,11 @@ static int __init vfb_setup(char *options) static void vfb_platform_release(struct device *device) { // This is called when the reference count goes to zero. + dev_err(device, "This driver is broken, please bug the authors so they will fix it.\n"); } -static int __init vfb_probe(struct device *device) +static int __init vfb_probe(struct platform_device *dev) { - struct platform_device *dev = to_platform_device(device); struct fb_info *info; int retval = -ENOMEM; @@ -446,7 +447,7 @@ static int __init vfb_probe(struct device *device) retval = register_framebuffer(info); if (retval < 0) goto err2; - dev_set_drvdata(&dev->dev, info); + platform_set_drvdata(dev, info); printk(KERN_INFO "fb%d: Virtual frame buffer device, using %ldK of video memory\n", @@ -461,9 +462,9 @@ err: return retval; } -static int vfb_remove(struct device *device) +static int vfb_remove(struct platform_device *dev) { - struct fb_info *info = dev_get_drvdata(device); + struct fb_info *info = platform_get_drvdata(dev); if (info) { unregister_framebuffer(info); @@ -473,11 +474,12 @@ static int vfb_remove(struct device *device) return 0; } -static struct device_driver vfb_driver = { - .name = "vfb", - .bus = &platform_bus_type, +static struct platform_driver vfb_driver = { .probe = vfb_probe, .remove = vfb_remove, + .driver = { + .name = "vfb", + }, }; static struct platform_device vfb_device = { @@ -503,12 +505,12 @@ static int __init vfb_init(void) if (!vfb_enable) return -ENXIO; - ret = driver_register(&vfb_driver); + ret = platform_driver_register(&vfb_driver); if (!ret) { ret = platform_device_register(&vfb_device); if (ret) - driver_unregister(&vfb_driver); + platform_driver_unregister(&vfb_driver); } return ret; } @@ -519,7 +521,7 @@ module_init(vfb_init); static void __exit vfb_exit(void) { platform_device_unregister(&vfb_device); - driver_unregister(&vfb_driver); + platform_driver_unregister(&vfb_driver); } module_exit(vfb_exit);