X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fvideo%2Fvfb.c;h=77eed1fd994366d4140ae74d319eee2a94fe396d;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=a9b99b01bd8e377f2656058bd29b09accb7ef6ea;hpb=41689045f6a3cbe0550e1d34e9cc20d2e8c432ba;p=linux-2.6.git diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c index a9b99b01b..77eed1fd9 100644 --- a/drivers/video/vfb.c +++ b/drivers/video/vfb.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -397,6 +398,12 @@ 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. + dev_err(device, "This driver is broken, please bug the authors so they will fix it.\n"); +} + static int __init vfb_probe(struct platform_device *dev) { struct fb_info *info; @@ -475,7 +482,13 @@ static struct platform_driver vfb_driver = { }, }; -static struct platform_device *vfb_device; +static struct platform_device vfb_device = { + .name = "vfb", + .id = 0, + .dev = { + .release = vfb_platform_release, + } +}; static int __init vfb_init(void) { @@ -495,19 +508,10 @@ static int __init vfb_init(void) ret = platform_driver_register(&vfb_driver); 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); + ret = platform_device_register(&vfb_device); + if (ret) platform_driver_unregister(&vfb_driver); - } } - return ret; } @@ -516,7 +520,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); }