aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/gbefb.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-11-11 12:24:26 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-11 12:24:26 -0500
commit5643f000c1e10ab991182478b76550e1364c3570 (patch)
tree950b2f61a5dd742de1c668ba968a9c8a99f1eab6 /drivers/video/gbefb.c
parent177294d19174cf92de22434bb1fc9a8ecdbbe658 (diff)
parent3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (diff)
Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel
Diffstat (limited to 'drivers/video/gbefb.c')
-rw-r--r--drivers/video/gbefb.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index 9d5e4f342110..d744c51807b7 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -1105,12 +1105,11 @@ int __init gbefb_setup(char *options)
1105 return 0; 1105 return 0;
1106} 1106}
1107 1107
1108static int __init gbefb_probe(struct device *dev) 1108static int __init gbefb_probe(struct platform_device *p_dev)
1109{ 1109{
1110 int i, ret = 0; 1110 int i, ret = 0;
1111 struct fb_info *info; 1111 struct fb_info *info;
1112 struct gbefb_par *par; 1112 struct gbefb_par *par;
1113 struct platform_device *p_dev = to_platform_device(dev);
1114#ifndef MODULE 1113#ifndef MODULE
1115 char *options = NULL; 1114 char *options = NULL;
1116#endif 1115#endif
@@ -1204,8 +1203,8 @@ static int __init gbefb_probe(struct device *dev)
1204 goto out_gbe_unmap; 1203 goto out_gbe_unmap;
1205 } 1204 }
1206 1205
1207 dev_set_drvdata(&p_dev->dev, info); 1206 platform_set_drvdata(p_dev, info);
1208 gbefb_create_sysfs(dev); 1207 gbefb_create_sysfs(&p_dev->dev);
1209 1208
1210 printk(KERN_INFO "fb%d: %s rev %d @ 0x%08x using %dkB memory\n", 1209 printk(KERN_INFO "fb%d: %s rev %d @ 0x%08x using %dkB memory\n",
1211 info->node, info->fix.id, gbe_revision, (unsigned) GBE_BASE, 1210 info->node, info->fix.id, gbe_revision, (unsigned) GBE_BASE,
@@ -1231,10 +1230,9 @@ out_release_framebuffer:
1231 return ret; 1230 return ret;
1232} 1231}
1233 1232
1234static int __devexit gbefb_remove(struct device* dev) 1233static int __devexit gbefb_remove(struct platform_device* p_dev)
1235{ 1234{
1236 struct platform_device *p_dev = to_platform_device(dev); 1235 struct fb_info *info = platform_get_drvdata(p_dev);
1237 struct fb_info *info = dev_get_drvdata(&p_dev->dev);
1238 1236
1239 unregister_framebuffer(info); 1237 unregister_framebuffer(info);
1240 gbe_turn_off(); 1238 gbe_turn_off();
@@ -1252,18 +1250,19 @@ static int __devexit gbefb_remove(struct device* dev)
1252 return 0; 1250 return 0;
1253} 1251}
1254 1252
1255static struct device_driver gbefb_driver = { 1253static struct platform_driver gbefb_driver = {
1256 .name = "gbefb",
1257 .bus = &platform_bus_type,
1258 .probe = gbefb_probe, 1254 .probe = gbefb_probe,
1259 .remove = __devexit_p(gbefb_remove), 1255 .remove = __devexit_p(gbefb_remove),
1256 .driver = {
1257 .name = "gbefb",
1258 },
1260}; 1259};
1261 1260
1262static struct platform_device *gbefb_device; 1261static struct platform_device *gbefb_device;
1263 1262
1264int __init gbefb_init(void) 1263int __init gbefb_init(void)
1265{ 1264{
1266 int ret = driver_register(&gbefb_driver); 1265 int ret = platform_driver_register(&gbefb_driver);
1267 if (!ret) { 1266 if (!ret) {
1268 gbefb_device = platform_device_alloc("gbefb", 0); 1267 gbefb_device = platform_device_alloc("gbefb", 0);
1269 if (gbefb_device) { 1268 if (gbefb_device) {
@@ -1273,7 +1272,7 @@ int __init gbefb_init(void)
1273 } 1272 }
1274 if (ret) { 1273 if (ret) {
1275 platform_device_put(gbefb_device); 1274 platform_device_put(gbefb_device);
1276 driver_unregister(&gbefb_driver); 1275 platform_driver_unregister(&gbefb_driver);
1277 } 1276 }
1278 } 1277 }
1279 return ret; 1278 return ret;
@@ -1282,7 +1281,7 @@ int __init gbefb_init(void)
1282void __exit gbefb_exit(void) 1281void __exit gbefb_exit(void)
1283{ 1282{
1284 platform_device_unregister(gbefb_device); 1283 platform_device_unregister(gbefb_device);
1285 driver_unregister(&gbefb_driver); 1284 platform_driver_unregister(&gbefb_driver);
1286} 1285}
1287 1286
1288module_init(gbefb_init); 1287module_init(gbefb_init);