diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-11-09 17:32:44 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-09 17:32:44 -0500 |
commit | 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch) | |
tree | d8825be54cefb6ad6707478d719c8e30605bee7b /drivers/video/sgivwfb.c | |
parent | 00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (diff) |
[DRIVER MODEL] Convert platform drivers to use struct platform_driver
This allows us to eliminate the casts in the drivers, and eventually
remove the use of the device_driver function pointer methods for
platform device drivers.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/video/sgivwfb.c')
-rw-r--r-- | drivers/video/sgivwfb.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c index 2e8769dd345a..7054660767e4 100644 --- a/drivers/video/sgivwfb.c +++ b/drivers/video/sgivwfb.c | |||
@@ -750,9 +750,8 @@ int __init sgivwfb_setup(char *options) | |||
750 | /* | 750 | /* |
751 | * Initialisation | 751 | * Initialisation |
752 | */ | 752 | */ |
753 | static int __init sgivwfb_probe(struct device *device) | 753 | static int __init sgivwfb_probe(struct platform_device *dev) |
754 | { | 754 | { |
755 | struct platform_device *dev = to_platform_device(device); | ||
756 | struct sgivw_par *par; | 755 | struct sgivw_par *par; |
757 | struct fb_info *info; | 756 | struct fb_info *info; |
758 | char *monitor; | 757 | char *monitor; |
@@ -813,7 +812,7 @@ static int __init sgivwfb_probe(struct device *device) | |||
813 | goto fail_register_framebuffer; | 812 | goto fail_register_framebuffer; |
814 | } | 813 | } |
815 | 814 | ||
816 | dev_set_drvdata(&dev->dev, info); | 815 | platform_set_drvdata(dev, info); |
817 | 816 | ||
818 | printk(KERN_INFO "fb%d: SGI DBE frame buffer device, using %ldK of video memory at %#lx\n", | 817 | printk(KERN_INFO "fb%d: SGI DBE frame buffer device, using %ldK of video memory at %#lx\n", |
819 | info->node, sgivwfb_mem_size >> 10, sgivwfb_mem_phys); | 818 | info->node, sgivwfb_mem_size >> 10, sgivwfb_mem_phys); |
@@ -831,9 +830,9 @@ fail_ioremap_regs: | |||
831 | return -ENXIO; | 830 | return -ENXIO; |
832 | } | 831 | } |
833 | 832 | ||
834 | static int sgivwfb_remove(struct device *device) | 833 | static int sgivwfb_remove(struct platform_device *dev) |
835 | { | 834 | { |
836 | struct fb_info *info = dev_get_drvdata(device); | 835 | struct fb_info *info = platform_get_drvdata(dev); |
837 | 836 | ||
838 | if (info) { | 837 | if (info) { |
839 | struct sgivw_par *par = info->par; | 838 | struct sgivw_par *par = info->par; |
@@ -847,11 +846,12 @@ static int sgivwfb_remove(struct device *device) | |||
847 | return 0; | 846 | return 0; |
848 | } | 847 | } |
849 | 848 | ||
850 | static struct device_driver sgivwfb_driver = { | 849 | static struct platform_driver sgivwfb_driver = { |
851 | .name = "sgivwfb", | ||
852 | .bus = &platform_bus_type, | ||
853 | .probe = sgivwfb_probe, | 850 | .probe = sgivwfb_probe, |
854 | .remove = sgivwfb_remove, | 851 | .remove = sgivwfb_remove, |
852 | .driver = { | ||
853 | .name = "sgivwfb", | ||
854 | }, | ||
855 | }; | 855 | }; |
856 | 856 | ||
857 | static struct platform_device *sgivwfb_device; | 857 | static struct platform_device *sgivwfb_device; |
@@ -867,7 +867,7 @@ int __init sgivwfb_init(void) | |||
867 | return -ENODEV; | 867 | return -ENODEV; |
868 | sgivwfb_setup(option); | 868 | sgivwfb_setup(option); |
869 | #endif | 869 | #endif |
870 | ret = driver_register(&sgivwfb_driver); | 870 | ret = platform_driver_register(&sgivwfb_driver); |
871 | if (!ret) { | 871 | if (!ret) { |
872 | sgivwfb_device = platform_device_alloc("sgivwfb", 0); | 872 | sgivwfb_device = platform_device_alloc("sgivwfb", 0); |
873 | if (sgivwfb_device) { | 873 | if (sgivwfb_device) { |
@@ -875,7 +875,7 @@ int __init sgivwfb_init(void) | |||
875 | } else | 875 | } else |
876 | ret = -ENOMEM; | 876 | ret = -ENOMEM; |
877 | if (ret) { | 877 | if (ret) { |
878 | driver_unregister(&sgivwfb_driver); | 878 | platform_driver_unregister(&sgivwfb_driver); |
879 | platform_device_put(sgivwfb_device); | 879 | platform_device_put(sgivwfb_device); |
880 | } | 880 | } |
881 | } | 881 | } |
@@ -890,7 +890,7 @@ MODULE_LICENSE("GPL"); | |||
890 | static void __exit sgivwfb_exit(void) | 890 | static void __exit sgivwfb_exit(void) |
891 | { | 891 | { |
892 | platform_device_unregister(sgivwfb_device); | 892 | platform_device_unregister(sgivwfb_device); |
893 | driver_unregister(&sgivwfb_driver); | 893 | platform_driver_unregister(&sgivwfb_driver); |
894 | } | 894 | } |
895 | 895 | ||
896 | module_exit(sgivwfb_exit); | 896 | module_exit(sgivwfb_exit); |