X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fvideo%2Fvfb.c;fp=drivers%2Fvideo%2Fvfb.c;h=a9b99b01bd8e377f2656058bd29b09accb7ef6ea;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=53208cb58396a8a1a047232f3de9c7ef7dd57f12;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c index 53208cb58..a9b99b01b 100644 --- a/drivers/video/vfb.c +++ b/drivers/video/vfb.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -398,11 +397,6 @@ static int __init vfb_setup(char *options) * Initialisation */ -static void vfb_platform_release(struct device *device) -{ - // This is called when the reference count goes to zero. -} - static int __init vfb_probe(struct platform_device *dev) { struct fb_info *info; @@ -481,13 +475,7 @@ static struct platform_driver vfb_driver = { }, }; -static struct platform_device vfb_device = { - .name = "vfb", - .id = 0, - .dev = { - .release = vfb_platform_release, - } -}; +static struct platform_device *vfb_device; static int __init vfb_init(void) { @@ -507,10 +495,19 @@ static int __init vfb_init(void) ret = platform_driver_register(&vfb_driver); if (!ret) { - ret = platform_device_register(&vfb_device); - if (ret) + vfb_device = platform_device_alloc("vfb", 0); + + if (vfb_device) + ret = platform_device_add(vfb_device); + else + ret = -ENOMEM; + + if (ret) { + platform_device_put(vfb_device); platform_driver_unregister(&vfb_driver); + } } + return ret; } @@ -519,7 +516,7 @@ module_init(vfb_init); #ifdef MODULE static void __exit vfb_exit(void) { - platform_device_unregister(&vfb_device); + platform_device_unregister(vfb_device); platform_driver_unregister(&vfb_driver); }