diff options
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/arcfb.c | 25 | ||||
-rw-r--r-- | drivers/video/gbefb.c | 18 | ||||
-rw-r--r-- | drivers/video/sgivwfb.c | 24 |
3 files changed, 33 insertions, 34 deletions
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c index 126daff1c84..6aa9f824c18 100644 --- a/drivers/video/arcfb.c +++ b/drivers/video/arcfb.c @@ -502,10 +502,6 @@ static ssize_t arcfb_write(struct file *file, const char *buf, size_t count, return err; } -static void arcfb_platform_release(struct device *device) -{ -} - static struct fb_ops arcfb_ops = { .owner = THIS_MODULE, .fb_open = arcfb_open, @@ -624,13 +620,7 @@ static struct device_driver arcfb_driver = { .remove = arcfb_remove, }; -static struct platform_device arcfb_device = { - .name = "arcfb", - .id = 0, - .dev = { - .release = arcfb_platform_release, - } -}; +static struct platform_device *arcfb_device; static int __init arcfb_init(void) { @@ -641,9 +631,16 @@ static int __init arcfb_init(void) ret = driver_register(&arcfb_driver); if (!ret) { - ret = platform_device_register(&arcfb_device); - if (ret) + arcfb_device = platform_device_alloc("arcfb", 0); + if (arcfb_device) { + ret = platform_device_add(arcfb_device); + } else { + ret = -ENOMEM; + } + if (ret) { + platform_device_put(arcfb_device); driver_unregister(&arcfb_driver); + } } return ret; @@ -651,7 +648,7 @@ static int __init arcfb_init(void) static void __exit arcfb_exit(void) { - platform_device_unregister(&arcfb_device); + platform_device_unregister(arcfb_device); driver_unregister(&arcfb_driver); } diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c index 316bfe99481..ed853bef19e 100644 --- a/drivers/video/gbefb.c +++ b/drivers/video/gbefb.c @@ -1260,24 +1260,30 @@ static struct device_driver gbefb_driver = { .remove = __devexit_p(gbefb_remove), }; -static struct platform_device gbefb_device = { - .name = "gbefb", -}; +static struct platform_device *gbefb_device; int __init gbefb_init(void) { int ret = driver_register(&gbefb_driver); if (!ret) { - ret = platform_device_register(&gbefb_device); - if (ret) + gbefb_device = platform_device_alloc("gbefb", 0); + if (gbefb_device) { + ret = platform_device_add(gbefb_device); + } else { + ret = -ENOMEM; + } + if (ret) { + platform_device_put(gbefb_device); driver_unregister(&gbefb_driver); + } } return ret; } void __exit gbefb_exit(void) { - driver_unregister(&gbefb_driver); + platform_device_unregister(gbefb_device); + driver_unregister(&gbefb_driver); } module_init(gbefb_init); diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c index cf5106eab2d..5ce81f44c76 100644 --- a/drivers/video/sgivwfb.c +++ b/drivers/video/sgivwfb.c @@ -751,10 +751,6 @@ int __init sgivwfb_setup(char *options) /* * Initialisation */ -static void sgivwfb_release(struct device *device) -{ -} - static int __init sgivwfb_probe(struct device *device) { struct platform_device *dev = to_platform_device(device); @@ -859,13 +855,7 @@ static struct device_driver sgivwfb_driver = { .remove = sgivwfb_remove, }; -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) { @@ -880,9 +870,15 @@ int __init sgivwfb_init(void) #endif ret = driver_register(&sgivwfb_driver); if (!ret) { - ret = platform_device_register(&sgivwfb_device); - if (ret) + sgivwfb_device = platform_device_alloc("sgivwfb", 0); + if (sgivwfb_device) { + ret = platform_device_add(sgivwfb_device); + } else + ret = -ENOMEM; + if (ret) { driver_unregister(&sgivwfb_driver); + platform_device_put(sgivwfb_device); + } } return ret; } @@ -894,7 +890,7 @@ MODULE_LICENSE("GPL"); static void __exit sgivwfb_exit(void) { - platform_device_unregister(&sgivwfb_device); + platform_device_unregister(sgivwfb_device); driver_unregister(&sgivwfb_driver); } |