aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/sgivwfb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/sgivwfb.c')
-rw-r--r--drivers/video/sgivwfb.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c
index cf5106eab2d5..5ce81f44c769 100644
--- a/drivers/video/sgivwfb.c
+++ b/drivers/video/sgivwfb.c
@@ -751,10 +751,6 @@ int __init sgivwfb_setup(char *options)
751/* 751/*
752 * Initialisation 752 * Initialisation
753 */ 753 */
754static void sgivwfb_release(struct device *device)
755{
756}
757
758static int __init sgivwfb_probe(struct device *device) 754static int __init sgivwfb_probe(struct device *device)
759{ 755{
760 struct platform_device *dev = to_platform_device(device); 756 struct platform_device *dev = to_platform_device(device);
@@ -859,13 +855,7 @@ static struct device_driver sgivwfb_driver = {
859 .remove = sgivwfb_remove, 855 .remove = sgivwfb_remove,
860}; 856};
861 857
862static struct platform_device sgivwfb_device = { 858static struct platform_device *sgivwfb_device;
863 .name = "sgivwfb",
864 .id = 0,
865 .dev = {
866 .release = sgivwfb_release,
867 }
868};
869 859
870int __init sgivwfb_init(void) 860int __init sgivwfb_init(void)
871{ 861{
@@ -880,9 +870,15 @@ int __init sgivwfb_init(void)
880#endif 870#endif
881 ret = driver_register(&sgivwfb_driver); 871 ret = driver_register(&sgivwfb_driver);
882 if (!ret) { 872 if (!ret) {
883 ret = platform_device_register(&sgivwfb_device); 873 sgivwfb_device = platform_device_alloc("sgivwfb", 0);
884 if (ret) 874 if (sgivwfb_device) {
875 ret = platform_device_add(sgivwfb_device);
876 } else
877 ret = -ENOMEM;
878 if (ret) {
885 driver_unregister(&sgivwfb_driver); 879 driver_unregister(&sgivwfb_driver);
880 platform_device_put(sgivwfb_device);
881 }
886 } 882 }
887 return ret; 883 return ret;
888} 884}
@@ -894,7 +890,7 @@ MODULE_LICENSE("GPL");
894 890
895static void __exit sgivwfb_exit(void) 891static void __exit sgivwfb_exit(void)
896{ 892{
897 platform_device_unregister(&sgivwfb_device); 893 platform_device_unregister(sgivwfb_device);
898 driver_unregister(&sgivwfb_driver); 894 driver_unregister(&sgivwfb_driver);
899} 895}
900 896