aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-11-09 17:32:44 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-11-09 17:32:44 -0500
commit3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch)
treed8825be54cefb6ad6707478d719c8e30605bee7b /drivers/video
parent00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (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')
-rw-r--r--drivers/video/acornfb.c13
-rw-r--r--drivers/video/arcfb.c22
-rw-r--r--drivers/video/backlight/corgi_bl.c21
-rw-r--r--drivers/video/dnfb.c16
-rw-r--r--drivers/video/epson1355fb.c24
-rw-r--r--drivers/video/gbefb.c25
-rw-r--r--drivers/video/imxfb.c45
-rw-r--r--drivers/video/pxafb.c51
-rw-r--r--drivers/video/q40fb.c14
-rw-r--r--drivers/video/s1d13xxxfb.c49
-rw-r--r--drivers/video/s3c2410fb.c47
-rw-r--r--drivers/video/sa1100fb.c25
-rw-r--r--drivers/video/sgivwfb.c22
-rw-r--r--drivers/video/vesafb.c14
-rw-r--r--drivers/video/vfb.c22
-rw-r--r--drivers/video/w100fb.c46
16 files changed, 228 insertions, 228 deletions
diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c
index 193b482570c7..750cebb18306 100644
--- a/drivers/video/acornfb.c
+++ b/drivers/video/acornfb.c
@@ -1279,7 +1279,7 @@ free_unused_pages(unsigned int virtual_start, unsigned int virtual_end)
1279 printk("acornfb: freed %dK memory\n", mb_freed); 1279 printk("acornfb: freed %dK memory\n", mb_freed);
1280} 1280}
1281 1281
1282static int __init acornfb_probe(struct device *dev) 1282static int __init acornfb_probe(struct platform_device *dev)
1283{ 1283{
1284 unsigned long size; 1284 unsigned long size;
1285 u_int h_sync, v_sync; 1285 u_int h_sync, v_sync;
@@ -1292,7 +1292,7 @@ static int __init acornfb_probe(struct device *dev)
1292 1292
1293 acornfb_init_fbinfo(); 1293 acornfb_init_fbinfo();
1294 1294
1295 current_par.dev = dev; 1295 current_par.dev = &dev->dev;
1296 1296
1297 if (current_par.montype == -1) 1297 if (current_par.montype == -1)
1298 current_par.montype = acornfb_detect_monitortype(); 1298 current_par.montype = acornfb_detect_monitortype();
@@ -1453,15 +1453,16 @@ static int __init acornfb_probe(struct device *dev)
1453 return 0; 1453 return 0;
1454} 1454}
1455 1455
1456static struct device_driver acornfb_driver = { 1456static struct platform_driver acornfb_driver = {
1457 .name = "acornfb",
1458 .bus = &platform_bus_type,
1459 .probe = acornfb_probe, 1457 .probe = acornfb_probe,
1458 .driver = {
1459 .name = "acornfb",
1460 },
1460}; 1461};
1461 1462
1462static int __init acornfb_init(void) 1463static int __init acornfb_init(void)
1463{ 1464{
1464 return driver_register(&acornfb_driver); 1465 return platform_driver_register(&acornfb_driver);
1465} 1466}
1466 1467
1467module_init(acornfb_init); 1468module_init(acornfb_init);
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index a1fc8bbb1090..080db812ca48 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -514,9 +514,8 @@ static struct fb_ops arcfb_ops = {
514 .fb_ioctl = arcfb_ioctl, 514 .fb_ioctl = arcfb_ioctl,
515}; 515};
516 516
517static int __init arcfb_probe(struct device *device) 517static int __init arcfb_probe(struct platform_device *dev)
518{ 518{
519 struct platform_device *dev = to_platform_device(device);
520 struct fb_info *info; 519 struct fb_info *info;
521 int retval = -ENOMEM; 520 int retval = -ENOMEM;
522 int videomemorysize; 521 int videomemorysize;
@@ -559,7 +558,7 @@ static int __init arcfb_probe(struct device *device)
559 retval = register_framebuffer(info); 558 retval = register_framebuffer(info);
560 if (retval < 0) 559 if (retval < 0)
561 goto err1; 560 goto err1;
562 dev_set_drvdata(&dev->dev, info); 561 platform_set_drvdata(dev, info);
563 if (irq) { 562 if (irq) {
564 par->irq = irq; 563 par->irq = irq;
565 if (request_irq(par->irq, &arcfb_interrupt, SA_SHIRQ, 564 if (request_irq(par->irq, &arcfb_interrupt, SA_SHIRQ,
@@ -600,9 +599,9 @@ err:
600 return retval; 599 return retval;
601} 600}
602 601
603static int arcfb_remove(struct device *device) 602static int arcfb_remove(struct platform_device *dev)
604{ 603{
605 struct fb_info *info = dev_get_drvdata(device); 604 struct fb_info *info = platform_get_drvdata(dev);
606 605
607 if (info) { 606 if (info) {
608 unregister_framebuffer(info); 607 unregister_framebuffer(info);
@@ -612,11 +611,12 @@ static int arcfb_remove(struct device *device)
612 return 0; 611 return 0;
613} 612}
614 613
615static struct device_driver arcfb_driver = { 614static struct platform_driver arcfb_driver = {
616 .name = "arcfb",
617 .bus = &platform_bus_type,
618 .probe = arcfb_probe, 615 .probe = arcfb_probe,
619 .remove = arcfb_remove, 616 .remove = arcfb_remove,
617 .driver = {
618 .name = "arcfb",
619 },
620}; 620};
621 621
622static struct platform_device *arcfb_device; 622static struct platform_device *arcfb_device;
@@ -628,7 +628,7 @@ static int __init arcfb_init(void)
628 if (!arcfb_enable) 628 if (!arcfb_enable)
629 return -ENXIO; 629 return -ENXIO;
630 630
631 ret = driver_register(&arcfb_driver); 631 ret = platform_driver_register(&arcfb_driver);
632 if (!ret) { 632 if (!ret) {
633 arcfb_device = platform_device_alloc("arcfb", 0); 633 arcfb_device = platform_device_alloc("arcfb", 0);
634 if (arcfb_device) { 634 if (arcfb_device) {
@@ -638,7 +638,7 @@ static int __init arcfb_init(void)
638 } 638 }
639 if (ret) { 639 if (ret) {
640 platform_device_put(arcfb_device); 640 platform_device_put(arcfb_device);
641 driver_unregister(&arcfb_driver); 641 platform_driver_unregister(&arcfb_driver);
642 } 642 }
643 } 643 }
644 return ret; 644 return ret;
@@ -648,7 +648,7 @@ static int __init arcfb_init(void)
648static void __exit arcfb_exit(void) 648static void __exit arcfb_exit(void)
649{ 649{
650 platform_device_unregister(arcfb_device); 650 platform_device_unregister(arcfb_device);
651 driver_unregister(&arcfb_driver); 651 platform_driver_unregister(&arcfb_driver);
652} 652}
653 653
654module_param(num_cols, ulong, 0); 654module_param(num_cols, ulong, 0);
diff --git a/drivers/video/backlight/corgi_bl.c b/drivers/video/backlight/corgi_bl.c
index 4867498f68e8..bc492f26c5a9 100644
--- a/drivers/video/backlight/corgi_bl.c
+++ b/drivers/video/backlight/corgi_bl.c
@@ -73,13 +73,13 @@ static void corgibl_blank(int blank)
73} 73}
74 74
75#ifdef CONFIG_PM 75#ifdef CONFIG_PM
76static int corgibl_suspend(struct device *dev, pm_message_t state) 76static int corgibl_suspend(struct platform_device *dev, pm_message_t state)
77{ 77{
78 corgibl_blank(FB_BLANK_POWERDOWN); 78 corgibl_blank(FB_BLANK_POWERDOWN);
79 return 0; 79 return 0;
80} 80}
81 81
82static int corgibl_resume(struct device *dev) 82static int corgibl_resume(struct platform_device *dev)
83{ 83{
84 corgibl_blank(FB_BLANK_UNBLANK); 84 corgibl_blank(FB_BLANK_UNBLANK);
85 return 0; 85 return 0;
@@ -137,9 +137,9 @@ static struct backlight_properties corgibl_data = {
137 137
138static struct backlight_device *corgi_backlight_device; 138static struct backlight_device *corgi_backlight_device;
139 139
140static int __init corgibl_probe(struct device *dev) 140static int __init corgibl_probe(struct platform_device *pdev)
141{ 141{
142 struct corgibl_machinfo *machinfo = dev->platform_data; 142 struct corgibl_machinfo *machinfo = pdev->dev.platform_data;
143 143
144 corgibl_data.max_brightness = machinfo->max_intensity; 144 corgibl_data.max_brightness = machinfo->max_intensity;
145 corgibl_mach_set_intensity = machinfo->set_bl_intensity; 145 corgibl_mach_set_intensity = machinfo->set_bl_intensity;
@@ -156,7 +156,7 @@ static int __init corgibl_probe(struct device *dev)
156 return 0; 156 return 0;
157} 157}
158 158
159static int corgibl_remove(struct device *dev) 159static int corgibl_remove(struct platform_device *dev)
160{ 160{
161 backlight_device_unregister(corgi_backlight_device); 161 backlight_device_unregister(corgi_backlight_device);
162 162
@@ -166,23 +166,24 @@ static int corgibl_remove(struct device *dev)
166 return 0; 166 return 0;
167} 167}
168 168
169static struct device_driver corgibl_driver = { 169static struct platform_driver corgibl_driver = {
170 .name = "corgi-bl",
171 .bus = &platform_bus_type,
172 .probe = corgibl_probe, 170 .probe = corgibl_probe,
173 .remove = corgibl_remove, 171 .remove = corgibl_remove,
174 .suspend = corgibl_suspend, 172 .suspend = corgibl_suspend,
175 .resume = corgibl_resume, 173 .resume = corgibl_resume,
174 .driver = {
175 .name = "corgi-bl",
176 },
176}; 177};
177 178
178static int __init corgibl_init(void) 179static int __init corgibl_init(void)
179{ 180{
180 return driver_register(&corgibl_driver); 181 return platform_driver_register(&corgibl_driver);
181} 182}
182 183
183static void __exit corgibl_exit(void) 184static void __exit corgibl_exit(void)
184{ 185{
185 driver_unregister(&corgibl_driver); 186 platform_driver_unregister(&corgibl_driver);
186} 187}
187 188
188module_init(corgibl_init); 189module_init(corgibl_init);
diff --git a/drivers/video/dnfb.c b/drivers/video/dnfb.c
index 957a3ada2b75..5abd3cb00671 100644
--- a/drivers/video/dnfb.c
+++ b/drivers/video/dnfb.c
@@ -227,9 +227,8 @@ void dnfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
227 * Initialization 227 * Initialization
228 */ 228 */
229 229
230static int __devinit dnfb_probe(struct device *device) 230static int __devinit dnfb_probe(struct platform_device *dev)
231{ 231{
232 struct platform_device *dev = to_platform_device(device);
233 struct fb_info *info; 232 struct fb_info *info;
234 int err = 0; 233 int err = 0;
235 234
@@ -257,7 +256,7 @@ static int __devinit dnfb_probe(struct device *device)
257 framebuffer_release(info); 256 framebuffer_release(info);
258 return err; 257 return err;
259 } 258 }
260 dev_set_drvdata(&dev->dev, info); 259 platform_set_drvdata(dev, info);
261 260
262 /* now we have registered we can safely setup the hardware */ 261 /* now we have registered we can safely setup the hardware */
263 out_8(AP_CONTROL_3A, RESET_CREG); 262 out_8(AP_CONTROL_3A, RESET_CREG);
@@ -271,10 +270,11 @@ static int __devinit dnfb_probe(struct device *device)
271 return err; 270 return err;
272} 271}
273 272
274static struct device_driver dnfb_driver = { 273static struct platform_driver dnfb_driver = {
275 .name = "dnfb",
276 .bus = &platform_bus_type,
277 .probe = dnfb_probe, 274 .probe = dnfb_probe,
275 .driver = {
276 .name = "dnfb",
277 },
278}; 278};
279 279
280static struct platform_device dnfb_device = { 280static struct platform_device dnfb_device = {
@@ -288,12 +288,12 @@ int __init dnfb_init(void)
288 if (fb_get_options("dnfb", NULL)) 288 if (fb_get_options("dnfb", NULL))
289 return -ENODEV; 289 return -ENODEV;
290 290
291 ret = driver_register(&dnfb_driver); 291 ret = platform_driver_register(&dnfb_driver);
292 292
293 if (!ret) { 293 if (!ret) {
294 ret = platform_device_register(&dnfb_device); 294 ret = platform_device_register(&dnfb_device);
295 if (ret) 295 if (ret)
296 driver_unregister(&dnfb_driver); 296 platform_driver_unregister(&dnfb_driver);
297 } 297 }
298 return ret; 298 return ret;
299} 299}
diff --git a/drivers/video/epson1355fb.c b/drivers/video/epson1355fb.c
index 6a81a1dd8f3d..3b0e71383448 100644
--- a/drivers/video/epson1355fb.c
+++ b/drivers/video/epson1355fb.c
@@ -609,9 +609,9 @@ static void epson1355fb_platform_release(struct device *device)
609{ 609{
610} 610}
611 611
612static int epson1355fb_remove(struct device *device) 612static int epson1355fb_remove(struct platform_device *dev)
613{ 613{
614 struct fb_info *info = dev_get_drvdata(device); 614 struct fb_info *info = platform_get_drvdata(dev);
615 struct epson1355_par *par = info->par; 615 struct epson1355_par *par = info->par;
616 616
617 backlight_enable(0); 617 backlight_enable(0);
@@ -632,9 +632,8 @@ static int epson1355fb_remove(struct device *device)
632 return 0; 632 return 0;
633} 633}
634 634
635int __init epson1355fb_probe(struct device *device) 635int __init epson1355fb_probe(struct platform_device *dev)
636{ 636{
637 struct platform_device *dev = to_platform_device(device);
638 struct epson1355_par *default_par; 637 struct epson1355_par *default_par;
639 struct fb_info *info; 638 struct fb_info *info;
640 u8 revision; 639 u8 revision;
@@ -713,7 +712,7 @@ int __init epson1355fb_probe(struct device *device)
713 /* 712 /*
714 * Our driver data. 713 * Our driver data.
715 */ 714 */
716 dev_set_drvdata(&dev->dev, info); 715 platform_set_drvdata(dev, info);
717 716
718 printk(KERN_INFO "fb%d: %s frame buffer device\n", 717 printk(KERN_INFO "fb%d: %s frame buffer device\n",
719 info->node, info->fix.id); 718 info->node, info->fix.id);
@@ -721,15 +720,16 @@ int __init epson1355fb_probe(struct device *device)
721 return 0; 720 return 0;
722 721
723 bail: 722 bail:
724 epson1355fb_remove(device); 723 epson1355fb_remove(dev);
725 return rc; 724 return rc;
726} 725}
727 726
728static struct device_driver epson1355fb_driver = { 727static struct platform_driver epson1355fb_driver = {
729 .name = "epson1355fb",
730 .bus = &platform_bus_type,
731 .probe = epson1355fb_probe, 728 .probe = epson1355fb_probe,
732 .remove = epson1355fb_remove, 729 .remove = epson1355fb_remove,
730 .driver = {
731 .name = "epson1355fb",
732 },
733}; 733};
734 734
735static struct platform_device epson1355fb_device = { 735static struct platform_device epson1355fb_device = {
@@ -747,11 +747,11 @@ int __init epson1355fb_init(void)
747 if (fb_get_options("epson1355fb", NULL)) 747 if (fb_get_options("epson1355fb", NULL))
748 return -ENODEV; 748 return -ENODEV;
749 749
750 ret = driver_register(&epson1355fb_driver); 750 ret = platform_driver_register(&epson1355fb_driver);
751 if (!ret) { 751 if (!ret) {
752 ret = platform_device_register(&epson1355fb_device); 752 ret = platform_device_register(&epson1355fb_device);
753 if (ret) 753 if (ret)
754 driver_unregister(&epson1355fb_driver); 754 platform_driver_unregister(&epson1355fb_driver);
755 } 755 }
756 return ret; 756 return ret;
757} 757}
@@ -762,7 +762,7 @@ module_init(epson1355fb_init);
762static void __exit epson1355fb_exit(void) 762static void __exit epson1355fb_exit(void)
763{ 763{
764 platform_device_unregister(&epson1355fb_device); 764 platform_device_unregister(&epson1355fb_device);
765 driver_unregister(&epson1355fb_driver); 765 platform_driver_unregister(&epson1355fb_driver);
766} 766}
767 767
768/* ------------------------------------------------------------------------- */ 768/* ------------------------------------------------------------------------- */
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);
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index e20b9f3a255f..5924cc225c95 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -423,18 +423,18 @@ static void imxfb_setup_gpio(struct imxfb_info *fbi)
423 * Power management hooks. Note that we won't be called from IRQ context, 423 * Power management hooks. Note that we won't be called from IRQ context,
424 * unlike the blank functions above, so we may sleep. 424 * unlike the blank functions above, so we may sleep.
425 */ 425 */
426static int imxfb_suspend(struct device *dev, pm_message_t state) 426static int imxfb_suspend(struct platform_device *dev, pm_message_t state)
427{ 427{
428 struct imxfb_info *fbi = dev_get_drvdata(dev); 428 struct imxfb_info *fbi = platform_get_drvdata(dev);
429 pr_debug("%s\n",__FUNCTION__); 429 pr_debug("%s\n",__FUNCTION__);
430 430
431 imxfb_disable_controller(fbi); 431 imxfb_disable_controller(fbi);
432 return 0; 432 return 0;
433} 433}
434 434
435static int imxfb_resume(struct device *dev) 435static int imxfb_resume(struct platform_device *dev)
436{ 436{
437 struct imxfb_info *fbi = dev_get_drvdata(dev); 437 struct imxfb_info *fbi = platform_get_drvdata(dev);
438 pr_debug("%s\n",__FUNCTION__); 438 pr_debug("%s\n",__FUNCTION__);
439 439
440 imxfb_enable_controller(fbi); 440 imxfb_enable_controller(fbi);
@@ -538,9 +538,8 @@ static int __init imxfb_map_video_memory(struct fb_info *info)
538 return fbi->map_cpu ? 0 : -ENOMEM; 538 return fbi->map_cpu ? 0 : -ENOMEM;
539} 539}
540 540
541static int __init imxfb_probe(struct device *dev) 541static int __init imxfb_probe(struct platform_device *pdev)
542{ 542{
543 struct platform_device *pdev = to_platform_device(dev);
544 struct imxfb_info *fbi; 543 struct imxfb_info *fbi;
545 struct fb_info *info; 544 struct fb_info *info;
546 struct imxfb_mach_info *inf; 545 struct imxfb_mach_info *inf;
@@ -553,21 +552,21 @@ static int __init imxfb_probe(struct device *dev)
553 if(!res) 552 if(!res)
554 return -ENODEV; 553 return -ENODEV;
555 554
556 inf = dev->platform_data; 555 inf = pdev->dev.platform_data;
557 if(!inf) { 556 if(!inf) {
558 dev_err(dev,"No platform_data available\n"); 557 dev_err(dev,"No platform_data available\n");
559 return -ENOMEM; 558 return -ENOMEM;
560 } 559 }
561 560
562 info = framebuffer_alloc(sizeof(struct imxfb_info), dev); 561 info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev);
563 if(!info) 562 if(!info)
564 return -ENOMEM; 563 return -ENOMEM;
565 564
566 fbi = info->par; 565 fbi = info->par;
567 566
568 dev_set_drvdata(dev, info); 567 platform_set_drvdata(pdev, info);
569 568
570 ret = imxfb_init_fbinfo(dev); 569 ret = imxfb_init_fbinfo(&pdev->dev);
571 if( ret < 0 ) 570 if( ret < 0 )
572 goto failed_init; 571 goto failed_init;
573 572
@@ -621,22 +620,21 @@ failed_register:
621 fb_dealloc_cmap(&info->cmap); 620 fb_dealloc_cmap(&info->cmap);
622failed_cmap: 621failed_cmap:
623 if (!inf->fixed_screen_cpu) 622 if (!inf->fixed_screen_cpu)
624 dma_free_writecombine(dev,fbi->map_size,fbi->map_cpu, 623 dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu,
625 fbi->map_dma); 624 fbi->map_dma);
626failed_map: 625failed_map:
627 kfree(info->pseudo_palette); 626 kfree(info->pseudo_palette);
628failed_regs: 627failed_regs:
629 release_mem_region(res->start, res->end - res->start); 628 release_mem_region(res->start, res->end - res->start);
630failed_init: 629failed_init:
631 dev_set_drvdata(dev, NULL); 630 platform_set_drvdata(pdev, NULL);
632 framebuffer_release(info); 631 framebuffer_release(info);
633 return ret; 632 return ret;
634} 633}
635 634
636static int imxfb_remove(struct device *dev) 635static int imxfb_remove(struct platform_device *pdev)
637{ 636{
638 struct platform_device *pdev = to_platform_device(dev); 637 struct fb_info *info = platform_get_drvdata(pdev);
639 struct fb_info *info = dev_get_drvdata(dev);
640 struct imxfb_info *fbi = info->par; 638 struct imxfb_info *fbi = info->par;
641 struct resource *res; 639 struct resource *res;
642 640
@@ -651,36 +649,37 @@ static int imxfb_remove(struct device *dev)
651 framebuffer_release(info); 649 framebuffer_release(info);
652 650
653 release_mem_region(res->start, res->end - res->start + 1); 651 release_mem_region(res->start, res->end - res->start + 1);
654 dev_set_drvdata(dev, NULL); 652 platform_set_drvdata(pdev, NULL);
655 653
656 return 0; 654 return 0;
657} 655}
658 656
659void imxfb_shutdown(struct device * dev) 657void imxfb_shutdown(struct platform_device * dev)
660{ 658{
661 struct fb_info *info = dev_get_drvdata(dev); 659 struct fb_info *info = platform_get_drvdata(dev);
662 struct imxfb_info *fbi = info->par; 660 struct imxfb_info *fbi = info->par;
663 imxfb_disable_controller(fbi); 661 imxfb_disable_controller(fbi);
664} 662}
665 663
666static struct device_driver imxfb_driver = { 664static struct platform_driver imxfb_driver = {
667 .name = "imx-fb",
668 .bus = &platform_bus_type,
669 .probe = imxfb_probe, 665 .probe = imxfb_probe,
670 .suspend = imxfb_suspend, 666 .suspend = imxfb_suspend,
671 .resume = imxfb_resume, 667 .resume = imxfb_resume,
672 .remove = imxfb_remove, 668 .remove = imxfb_remove,
673 .shutdown = imxfb_shutdown, 669 .shutdown = imxfb_shutdown,
670 .driver = {
671 .name = "imx-fb",
672 },
674}; 673};
675 674
676int __init imxfb_init(void) 675int __init imxfb_init(void)
677{ 676{
678 return driver_register(&imxfb_driver); 677 return platform_driver_register(&imxfb_driver);
679} 678}
680 679
681static void __exit imxfb_cleanup(void) 680static void __exit imxfb_cleanup(void)
682{ 681{
683 driver_unregister(&imxfb_driver); 682 platform_driver_unregister(&imxfb_driver);
684} 683}
685 684
686module_init(imxfb_init); 685module_init(imxfb_init);
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index f305a5b77b23..7b4cd250bec8 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -980,17 +980,17 @@ pxafb_freq_policy(struct notifier_block *nb, unsigned long val, void *data)
980 * Power management hooks. Note that we won't be called from IRQ context, 980 * Power management hooks. Note that we won't be called from IRQ context,
981 * unlike the blank functions above, so we may sleep. 981 * unlike the blank functions above, so we may sleep.
982 */ 982 */
983static int pxafb_suspend(struct device *dev, pm_message_t state) 983static int pxafb_suspend(struct platform_device *dev, pm_message_t state)
984{ 984{
985 struct pxafb_info *fbi = dev_get_drvdata(dev); 985 struct pxafb_info *fbi = platform_get_drvdata(dev);
986 986
987 set_ctrlr_state(fbi, C_DISABLE_PM); 987 set_ctrlr_state(fbi, C_DISABLE_PM);
988 return 0; 988 return 0;
989} 989}
990 990
991static int pxafb_resume(struct device *dev) 991static int pxafb_resume(struct platform_device *dev)
992{ 992{
993 struct pxafb_info *fbi = dev_get_drvdata(dev); 993 struct pxafb_info *fbi = platform_get_drvdata(dev);
994 994
995 set_ctrlr_state(fbi, C_ENABLE_PM); 995 set_ctrlr_state(fbi, C_ENABLE_PM);
996 return 0; 996 return 0;
@@ -1268,7 +1268,7 @@ static int __init pxafb_parse_options(struct device *dev, char *options)
1268} 1268}
1269#endif 1269#endif
1270 1270
1271int __init pxafb_probe(struct device *dev) 1271int __init pxafb_probe(struct platform_device *dev)
1272{ 1272{
1273 struct pxafb_info *fbi; 1273 struct pxafb_info *fbi;
1274 struct pxafb_mach_info *inf; 1274 struct pxafb_mach_info *inf;
@@ -1276,14 +1276,14 @@ int __init pxafb_probe(struct device *dev)
1276 1276
1277 dev_dbg(dev, "pxafb_probe\n"); 1277 dev_dbg(dev, "pxafb_probe\n");
1278 1278
1279 inf = dev->platform_data; 1279 inf = dev->dev.platform_data;
1280 ret = -ENOMEM; 1280 ret = -ENOMEM;
1281 fbi = NULL; 1281 fbi = NULL;
1282 if (!inf) 1282 if (!inf)
1283 goto failed; 1283 goto failed;
1284 1284
1285#ifdef CONFIG_FB_PXA_PARAMETERS 1285#ifdef CONFIG_FB_PXA_PARAMETERS
1286 ret = pxafb_parse_options(dev, g_options); 1286 ret = pxafb_parse_options(&dev->dev, g_options);
1287 if (ret < 0) 1287 if (ret < 0)
1288 goto failed; 1288 goto failed;
1289#endif 1289#endif
@@ -1293,36 +1293,36 @@ int __init pxafb_probe(struct device *dev)
1293 * a warning is given. */ 1293 * a warning is given. */
1294 1294
1295 if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK) 1295 if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK)
1296 dev_warn(dev, "machine LCCR0 setting contains illegal bits: %08x\n", 1296 dev_warn(&dev->dev, "machine LCCR0 setting contains illegal bits: %08x\n",
1297 inf->lccr0 & LCCR0_INVALID_CONFIG_MASK); 1297 inf->lccr0 & LCCR0_INVALID_CONFIG_MASK);
1298 if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK) 1298 if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK)
1299 dev_warn(dev, "machine LCCR3 setting contains illegal bits: %08x\n", 1299 dev_warn(&dev->dev, "machine LCCR3 setting contains illegal bits: %08x\n",
1300 inf->lccr3 & LCCR3_INVALID_CONFIG_MASK); 1300 inf->lccr3 & LCCR3_INVALID_CONFIG_MASK);
1301 if (inf->lccr0 & LCCR0_DPD && 1301 if (inf->lccr0 & LCCR0_DPD &&
1302 ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas || 1302 ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas ||
1303 (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl || 1303 (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl ||
1304 (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono)) 1304 (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono))
1305 dev_warn(dev, "Double Pixel Data (DPD) mode is only valid in passive mono" 1305 dev_warn(&dev->dev, "Double Pixel Data (DPD) mode is only valid in passive mono"
1306 " single panel mode\n"); 1306 " single panel mode\n");
1307 if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act && 1307 if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act &&
1308 (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual) 1308 (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual)
1309 dev_warn(dev, "Dual panel only valid in passive mode\n"); 1309 dev_warn(&dev->dev, "Dual panel only valid in passive mode\n");
1310 if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas && 1310 if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas &&
1311 (inf->upper_margin || inf->lower_margin)) 1311 (inf->upper_margin || inf->lower_margin))
1312 dev_warn(dev, "Upper and lower margins must be 0 in passive mode\n"); 1312 dev_warn(&dev->dev, "Upper and lower margins must be 0 in passive mode\n");
1313#endif 1313#endif
1314 1314
1315 dev_dbg(dev, "got a %dx%dx%d LCD\n",inf->xres, inf->yres, inf->bpp); 1315 dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n",inf->xres, inf->yres, inf->bpp);
1316 if (inf->xres == 0 || inf->yres == 0 || inf->bpp == 0) { 1316 if (inf->xres == 0 || inf->yres == 0 || inf->bpp == 0) {
1317 dev_err(dev, "Invalid resolution or bit depth\n"); 1317 dev_err(&dev->dev, "Invalid resolution or bit depth\n");
1318 ret = -EINVAL; 1318 ret = -EINVAL;
1319 goto failed; 1319 goto failed;
1320 } 1320 }
1321 pxafb_backlight_power = inf->pxafb_backlight_power; 1321 pxafb_backlight_power = inf->pxafb_backlight_power;
1322 pxafb_lcd_power = inf->pxafb_lcd_power; 1322 pxafb_lcd_power = inf->pxafb_lcd_power;
1323 fbi = pxafb_init_fbinfo(dev); 1323 fbi = pxafb_init_fbinfo(&dev->dev);
1324 if (!fbi) { 1324 if (!fbi) {
1325 dev_err(dev, "Failed to initialize framebuffer device\n"); 1325 dev_err(&dev->dev, "Failed to initialize framebuffer device\n");
1326 ret = -ENOMEM; // only reason for pxafb_init_fbinfo to fail is kmalloc 1326 ret = -ENOMEM; // only reason for pxafb_init_fbinfo to fail is kmalloc
1327 goto failed; 1327 goto failed;
1328 } 1328 }
@@ -1330,14 +1330,14 @@ int __init pxafb_probe(struct device *dev)
1330 /* Initialize video memory */ 1330 /* Initialize video memory */
1331 ret = pxafb_map_video_memory(fbi); 1331 ret = pxafb_map_video_memory(fbi);
1332 if (ret) { 1332 if (ret) {
1333 dev_err(dev, "Failed to allocate video RAM: %d\n", ret); 1333 dev_err(&dev->dev, "Failed to allocate video RAM: %d\n", ret);
1334 ret = -ENOMEM; 1334 ret = -ENOMEM;
1335 goto failed; 1335 goto failed;
1336 } 1336 }
1337 1337
1338 ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi); 1338 ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi);
1339 if (ret) { 1339 if (ret) {
1340 dev_err(dev, "request_irq failed: %d\n", ret); 1340 dev_err(&dev->dev, "request_irq failed: %d\n", ret);
1341 ret = -EBUSY; 1341 ret = -EBUSY;
1342 goto failed; 1342 goto failed;
1343 } 1343 }
@@ -1349,11 +1349,11 @@ int __init pxafb_probe(struct device *dev)
1349 pxafb_check_var(&fbi->fb.var, &fbi->fb); 1349 pxafb_check_var(&fbi->fb.var, &fbi->fb);
1350 pxafb_set_par(&fbi->fb); 1350 pxafb_set_par(&fbi->fb);
1351 1351
1352 dev_set_drvdata(dev, fbi); 1352 platform_set_drvdata(dev, fbi);
1353 1353
1354 ret = register_framebuffer(&fbi->fb); 1354 ret = register_framebuffer(&fbi->fb);
1355 if (ret < 0) { 1355 if (ret < 0) {
1356 dev_err(dev, "Failed to register framebuffer device: %d\n", ret); 1356 dev_err(&dev->dev, "Failed to register framebuffer device: %d\n", ret);
1357 goto failed; 1357 goto failed;
1358 } 1358 }
1359 1359
@@ -1376,19 +1376,20 @@ int __init pxafb_probe(struct device *dev)
1376 return 0; 1376 return 0;
1377 1377
1378failed: 1378failed:
1379 dev_set_drvdata(dev, NULL); 1379 platform_set_drvdata(dev, NULL);
1380 kfree(fbi); 1380 kfree(fbi);
1381 return ret; 1381 return ret;
1382} 1382}
1383 1383
1384static struct device_driver pxafb_driver = { 1384static struct platform_driver pxafb_driver = {
1385 .name = "pxa2xx-fb",
1386 .bus = &platform_bus_type,
1387 .probe = pxafb_probe, 1385 .probe = pxafb_probe,
1388#ifdef CONFIG_PM 1386#ifdef CONFIG_PM
1389 .suspend = pxafb_suspend, 1387 .suspend = pxafb_suspend,
1390 .resume = pxafb_resume, 1388 .resume = pxafb_resume,
1391#endif 1389#endif
1390 .driver = {
1391 .name = "pxa2xx-fb",
1392 },
1392}; 1393};
1393 1394
1394#ifndef MODULE 1395#ifndef MODULE
@@ -1415,7 +1416,7 @@ int __devinit pxafb_init(void)
1415 return -ENODEV; 1416 return -ENODEV;
1416 pxafb_setup(option); 1417 pxafb_setup(option);
1417#endif 1418#endif
1418 return driver_register(&pxafb_driver); 1419 return platform_driver_register(&pxafb_driver);
1419} 1420}
1420 1421
1421module_init(pxafb_init); 1422module_init(pxafb_init);
diff --git a/drivers/video/q40fb.c b/drivers/video/q40fb.c
index bfc41f2c902a..fc91dbf896d2 100644
--- a/drivers/video/q40fb.c
+++ b/drivers/video/q40fb.c
@@ -86,9 +86,8 @@ static struct fb_ops q40fb_ops = {
86 .fb_imageblit = cfb_imageblit, 86 .fb_imageblit = cfb_imageblit,
87}; 87};
88 88
89static int __init q40fb_probe(struct device *device) 89static int __init q40fb_probe(struct platform_device *dev)
90{ 90{
91 struct platform_device *dev = to_platform_device(device);
92 struct fb_info *info; 91 struct fb_info *info;
93 92
94 if (!MACH_IS_Q40) 93 if (!MACH_IS_Q40)
@@ -128,10 +127,11 @@ static int __init q40fb_probe(struct device *device)
128 return 0; 127 return 0;
129} 128}
130 129
131static struct device_driver q40fb_driver = { 130static struct platform_driver q40fb_driver = {
132 .name = "q40fb",
133 .bus = &platform_bus_type,
134 .probe = q40fb_probe, 131 .probe = q40fb_probe,
132 .driver = {
133 .name = "q40fb",
134 },
135}; 135};
136 136
137static struct platform_device q40fb_device = { 137static struct platform_device q40fb_device = {
@@ -145,12 +145,12 @@ int __init q40fb_init(void)
145 if (fb_get_options("q40fb", NULL)) 145 if (fb_get_options("q40fb", NULL))
146 return -ENODEV; 146 return -ENODEV;
147 147
148 ret = driver_register(&q40fb_driver); 148 ret = platform_driver_register(&q40fb_driver);
149 149
150 if (!ret) { 150 if (!ret) {
151 ret = platform_device_register(&q40fb_device); 151 ret = platform_device_register(&q40fb_device);
152 if (ret) 152 if (ret)
153 driver_unregister(&q40fb_driver); 153 platform_driver_unregister(&q40fb_driver);
154 } 154 }
155 return ret; 155 return ret;
156} 156}
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c
index 3edbd14c5c46..e5d0f92eeae3 100644
--- a/drivers/video/s1d13xxxfb.c
+++ b/drivers/video/s1d13xxxfb.c
@@ -503,10 +503,9 @@ s1d13xxxfb_fetch_hw_state(struct fb_info *info)
503 503
504 504
505static int 505static int
506s1d13xxxfb_remove(struct device *dev) 506s1d13xxxfb_remove(struct platform_device *pdev)
507{ 507{
508 struct fb_info *info = dev_get_drvdata(dev); 508 struct fb_info *info = platform_get_drvdata(pdev);
509 struct platform_device *pdev = to_platform_device(dev);
510 struct s1d13xxxfb_par *par = NULL; 509 struct s1d13xxxfb_par *par = NULL;
511 510
512 if (info) { 511 if (info) {
@@ -534,9 +533,8 @@ s1d13xxxfb_remove(struct device *dev)
534} 533}
535 534
536static int __devinit 535static int __devinit
537s1d13xxxfb_probe(struct device *dev) 536s1d13xxxfb_probe(struct platform_device *pdev)
538{ 537{
539 struct platform_device *pdev = to_platform_device(dev);
540 struct s1d13xxxfb_par *default_par; 538 struct s1d13xxxfb_par *default_par;
541 struct fb_info *info; 539 struct fb_info *info;
542 struct s1d13xxxfb_pdata *pdata = NULL; 540 struct s1d13xxxfb_pdata *pdata = NULL;
@@ -548,8 +546,8 @@ s1d13xxxfb_probe(struct device *dev)
548 printk(KERN_INFO "Epson S1D13XXX FB Driver\n"); 546 printk(KERN_INFO "Epson S1D13XXX FB Driver\n");
549 547
550 /* enable platform-dependent hardware glue, if any */ 548 /* enable platform-dependent hardware glue, if any */
551 if (dev->platform_data) 549 if (pdev->dev.platform_data)
552 pdata = dev->platform_data; 550 pdata = pdev->dev.platform_data;
553 551
554 if (pdata && pdata->platform_init_video) 552 if (pdata && pdata->platform_init_video)
555 pdata->platform_init_video(); 553 pdata->platform_init_video();
@@ -572,14 +570,14 @@ s1d13xxxfb_probe(struct device *dev)
572 570
573 if (!request_mem_region(pdev->resource[0].start, 571 if (!request_mem_region(pdev->resource[0].start,
574 pdev->resource[0].end - pdev->resource[0].start +1, "s1d13xxxfb mem")) { 572 pdev->resource[0].end - pdev->resource[0].start +1, "s1d13xxxfb mem")) {
575 dev_dbg(dev, "request_mem_region failed\n"); 573 dev_dbg(&pdev->dev, "request_mem_region failed\n");
576 ret = -EBUSY; 574 ret = -EBUSY;
577 goto bail; 575 goto bail;
578 } 576 }
579 577
580 if (!request_mem_region(pdev->resource[1].start, 578 if (!request_mem_region(pdev->resource[1].start,
581 pdev->resource[1].end - pdev->resource[1].start +1, "s1d13xxxfb regs")) { 579 pdev->resource[1].end - pdev->resource[1].start +1, "s1d13xxxfb regs")) {
582 dev_dbg(dev, "request_mem_region failed\n"); 580 dev_dbg(&pdev->dev, "request_mem_region failed\n");
583 ret = -EBUSY; 581 ret = -EBUSY;
584 goto bail; 582 goto bail;
585 } 583 }
@@ -640,7 +638,7 @@ s1d13xxxfb_probe(struct device *dev)
640 goto bail; 638 goto bail;
641 } 639 }
642 640
643 dev_set_drvdata(&pdev->dev, info); 641 platform_set_drvdata(pdev, info);
644 642
645 printk(KERN_INFO "fb%d: %s frame buffer device\n", 643 printk(KERN_INFO "fb%d: %s frame buffer device\n",
646 info->node, info->fix.id); 644 info->node, info->fix.id);
@@ -648,15 +646,15 @@ s1d13xxxfb_probe(struct device *dev)
648 return 0; 646 return 0;
649 647
650bail: 648bail:
651 s1d13xxxfb_remove(dev); 649 s1d13xxxfb_remove(pdev);
652 return ret; 650 return ret;
653 651
654} 652}
655 653
656#ifdef CONFIG_PM 654#ifdef CONFIG_PM
657static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state) 655static int s1d13xxxfb_suspend(struct platform_device *dev, pm_message_t state)
658{ 656{
659 struct fb_info *info = dev_get_drvdata(dev); 657 struct fb_info *info = platform_get_drvdata(dev);
660 struct s1d13xxxfb_par *s1dfb = info->par; 658 struct s1d13xxxfb_par *s1dfb = info->par;
661 struct s1d13xxxfb_pdata *pdata = NULL; 659 struct s1d13xxxfb_pdata *pdata = NULL;
662 660
@@ -664,8 +662,8 @@ static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state)
664 lcd_enable(s1dfb, 0); 662 lcd_enable(s1dfb, 0);
665 crt_enable(s1dfb, 0); 663 crt_enable(s1dfb, 0);
666 664
667 if (dev->platform_data) 665 if (dev->dev.platform_data)
668 pdata = dev->platform_data; 666 pdata = dev->dev.platform_data;
669 667
670#if 0 668#if 0
671 if (!s1dfb->disp_save) 669 if (!s1dfb->disp_save)
@@ -701,9 +699,9 @@ static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state)
701 return 0; 699 return 0;
702} 700}
703 701
704static int s1d13xxxfb_resume(struct device *dev) 702static int s1d13xxxfb_resume(struct platform_device *dev)
705{ 703{
706 struct fb_info *info = dev_get_drvdata(dev); 704 struct fb_info *info = platform_get_drvdata(dev);
707 struct s1d13xxxfb_par *s1dfb = info->par; 705 struct s1d13xxxfb_par *s1dfb = info->par;
708 struct s1d13xxxfb_pdata *pdata = NULL; 706 struct s1d13xxxfb_pdata *pdata = NULL;
709 707
@@ -714,8 +712,8 @@ static int s1d13xxxfb_resume(struct device *dev)
714 while ((s1d13xxxfb_readreg(s1dfb, S1DREG_PS_STATUS) & 0x01)) 712 while ((s1d13xxxfb_readreg(s1dfb, S1DREG_PS_STATUS) & 0x01))
715 udelay(10); 713 udelay(10);
716 714
717 if (dev->platform_data) 715 if (dev->dev.platform_data)
718 pdata = dev->platform_data; 716 pdata = dev->dev.platform_data;
719 717
720 if (s1dfb->regs_save) { 718 if (s1dfb->regs_save) {
721 /* will write RO regs, *should* get away with it :) */ 719 /* will write RO regs, *should* get away with it :) */
@@ -741,15 +739,16 @@ static int s1d13xxxfb_resume(struct device *dev)
741} 739}
742#endif /* CONFIG_PM */ 740#endif /* CONFIG_PM */
743 741
744static struct device_driver s1d13xxxfb_driver = { 742static struct platform_driver s1d13xxxfb_driver = {
745 .name = S1D_DEVICENAME,
746 .bus = &platform_bus_type,
747 .probe = s1d13xxxfb_probe, 743 .probe = s1d13xxxfb_probe,
748 .remove = s1d13xxxfb_remove, 744 .remove = s1d13xxxfb_remove,
749#ifdef CONFIG_PM 745#ifdef CONFIG_PM
750 .suspend = s1d13xxxfb_suspend, 746 .suspend = s1d13xxxfb_suspend,
751 .resume = s1d13xxxfb_resume 747 .resume = s1d13xxxfb_resume,
752#endif 748#endif
749 .driver = {
750 .name = S1D_DEVICENAME,
751 },
753}; 752};
754 753
755 754
@@ -759,14 +758,14 @@ s1d13xxxfb_init(void)
759 if (fb_get_options("s1d13xxxfb", NULL)) 758 if (fb_get_options("s1d13xxxfb", NULL))
760 return -ENODEV; 759 return -ENODEV;
761 760
762 return driver_register(&s1d13xxxfb_driver); 761 return platform_driver_register(&s1d13xxxfb_driver);
763} 762}
764 763
765 764
766static void __exit 765static void __exit
767s1d13xxxfb_exit(void) 766s1d13xxxfb_exit(void)
768{ 767{
769 driver_unregister(&s1d13xxxfb_driver); 768 platform_driver_unregister(&s1d13xxxfb_driver);
770} 769}
771 770
772module_init(s1d13xxxfb_init); 771module_init(s1d13xxxfb_init);
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 855a6778b9eb..ce6e749db3a7 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -634,19 +634,18 @@ static irqreturn_t s3c2410fb_irq(int irq, void *dev_id, struct pt_regs *r)
634 634
635static char driver_name[]="s3c2410fb"; 635static char driver_name[]="s3c2410fb";
636 636
637int __init s3c2410fb_probe(struct device *dev) 637int __init s3c2410fb_probe(struct platform_device *pdev)
638{ 638{
639 struct s3c2410fb_info *info; 639 struct s3c2410fb_info *info;
640 struct fb_info *fbinfo; 640 struct fb_info *fbinfo;
641 struct platform_device *pdev = to_platform_device(dev);
642 struct s3c2410fb_hw *mregs; 641 struct s3c2410fb_hw *mregs;
643 int ret; 642 int ret;
644 int irq; 643 int irq;
645 int i; 644 int i;
646 645
647 mach_info = dev->platform_data; 646 mach_info = pdev->dev.platform_data;
648 if (mach_info == NULL) { 647 if (mach_info == NULL) {
649 dev_err(dev,"no platform data for lcd, cannot attach\n"); 648 dev_err(&pdev->dev,"no platform data for lcd, cannot attach\n");
650 return -EINVAL; 649 return -EINVAL;
651 } 650 }
652 651
@@ -654,11 +653,11 @@ int __init s3c2410fb_probe(struct device *dev)
654 653
655 irq = platform_get_irq(pdev, 0); 654 irq = platform_get_irq(pdev, 0);
656 if (irq < 0) { 655 if (irq < 0) {
657 dev_err(dev, "no irq for device\n"); 656 dev_err(&pdev->dev, "no irq for device\n");
658 return -ENOENT; 657 return -ENOENT;
659 } 658 }
660 659
661 fbinfo = framebuffer_alloc(sizeof(struct s3c2410fb_info), dev); 660 fbinfo = framebuffer_alloc(sizeof(struct s3c2410fb_info), &pdev->dev);
662 if (!fbinfo) { 661 if (!fbinfo) {
663 return -ENOMEM; 662 return -ENOMEM;
664 } 663 }
@@ -666,7 +665,7 @@ int __init s3c2410fb_probe(struct device *dev)
666 665
667 info = fbinfo->par; 666 info = fbinfo->par;
668 info->fb = fbinfo; 667 info->fb = fbinfo;
669 dev_set_drvdata(dev, fbinfo); 668 platform_set_drvdata(pdev, fbinfo);
670 669
671 s3c2410fb_init_registers(info); 670 s3c2410fb_init_registers(info);
672 671
@@ -676,7 +675,7 @@ int __init s3c2410fb_probe(struct device *dev)
676 675
677 memcpy(&info->regs, &mach_info->regs, sizeof(info->regs)); 676 memcpy(&info->regs, &mach_info->regs, sizeof(info->regs));
678 677
679 info->mach_info = dev->platform_data; 678 info->mach_info = pdev->dev.platform_data;
680 679
681 fbinfo->fix.type = FB_TYPE_PACKED_PIXELS; 680 fbinfo->fix.type = FB_TYPE_PACKED_PIXELS;
682 fbinfo->fix.type_aux = 0; 681 fbinfo->fix.type_aux = 0;
@@ -735,7 +734,7 @@ int __init s3c2410fb_probe(struct device *dev)
735 734
736 ret = request_irq(irq, s3c2410fb_irq, SA_INTERRUPT, pdev->name, info); 735 ret = request_irq(irq, s3c2410fb_irq, SA_INTERRUPT, pdev->name, info);
737 if (ret) { 736 if (ret) {
738 dev_err(dev, "cannot get irq %d - err %d\n", irq, ret); 737 dev_err(&pdev->dev, "cannot get irq %d - err %d\n", irq, ret);
739 ret = -EBUSY; 738 ret = -EBUSY;
740 goto release_mem; 739 goto release_mem;
741 } 740 }
@@ -773,7 +772,7 @@ int __init s3c2410fb_probe(struct device *dev)
773 } 772 }
774 773
775 /* create device files */ 774 /* create device files */
776 device_create_file(dev, &dev_attr_debug); 775 device_create_file(&pdev->dev, &dev_attr_debug);
777 776
778 printk(KERN_INFO "fb%d: %s frame buffer device\n", 777 printk(KERN_INFO "fb%d: %s frame buffer device\n",
779 fbinfo->node, fbinfo->fix.id); 778 fbinfo->node, fbinfo->fix.id);
@@ -816,10 +815,9 @@ static void s3c2410fb_stop_lcd(void)
816/* 815/*
817 * Cleanup 816 * Cleanup
818 */ 817 */
819static int s3c2410fb_remove(struct device *dev) 818static int s3c2410fb_remove(struct platform_device *pdev)
820{ 819{
821 struct platform_device *pdev = to_platform_device(dev); 820 struct fb_info *fbinfo = platform_get_drvdata(pdev);
822 struct fb_info *fbinfo = dev_get_drvdata(dev);
823 struct s3c2410fb_info *info = fbinfo->par; 821 struct s3c2410fb_info *info = fbinfo->par;
824 int irq; 822 int irq;
825 823
@@ -847,9 +845,9 @@ static int s3c2410fb_remove(struct device *dev)
847 845
848/* suspend and resume support for the lcd controller */ 846/* suspend and resume support for the lcd controller */
849 847
850static int s3c2410fb_suspend(struct device *dev, pm_message_t state) 848static int s3c2410fb_suspend(struct platform_device *dev, pm_message_t state)
851{ 849{
852 struct fb_info *fbinfo = dev_get_drvdata(dev); 850 struct fb_info *fbinfo = platform_get_drvdata(dev);
853 struct s3c2410fb_info *info = fbinfo->par; 851 struct s3c2410fb_info *info = fbinfo->par;
854 852
855 s3c2410fb_stop_lcd(); 853 s3c2410fb_stop_lcd();
@@ -864,9 +862,9 @@ static int s3c2410fb_suspend(struct device *dev, pm_message_t state)
864 return 0; 862 return 0;
865} 863}
866 864
867static int s3c2410fb_resume(struct device *dev) 865static int s3c2410fb_resume(struct platform_device *dev)
868{ 866{
869 struct fb_info *fbinfo = dev_get_drvdata(dev); 867 struct fb_info *fbinfo = platform_get_drvdata(dev);
870 struct s3c2410fb_info *info = fbinfo->par; 868 struct s3c2410fb_info *info = fbinfo->par;
871 869
872 clk_enable(info->clk); 870 clk_enable(info->clk);
@@ -882,24 +880,25 @@ static int s3c2410fb_resume(struct device *dev)
882#define s3c2410fb_resume NULL 880#define s3c2410fb_resume NULL
883#endif 881#endif
884 882
885static struct device_driver s3c2410fb_driver = { 883static struct platform_driver s3c2410fb_driver = {
886 .name = "s3c2410-lcd",
887 .owner = THIS_MODULE,
888 .bus = &platform_bus_type,
889 .probe = s3c2410fb_probe, 884 .probe = s3c2410fb_probe,
885 .remove = s3c2410fb_remove,
890 .suspend = s3c2410fb_suspend, 886 .suspend = s3c2410fb_suspend,
891 .resume = s3c2410fb_resume, 887 .resume = s3c2410fb_resume,
892 .remove = s3c2410fb_remove 888 .driver = {
889 .name = "s3c2410-lcd",
890 .owner = THIS_MODULE,
891 },
893}; 892};
894 893
895int __devinit s3c2410fb_init(void) 894int __devinit s3c2410fb_init(void)
896{ 895{
897 return driver_register(&s3c2410fb_driver); 896 return platform_driver_register(&s3c2410fb_driver);
898} 897}
899 898
900static void __exit s3c2410fb_cleanup(void) 899static void __exit s3c2410fb_cleanup(void)
901{ 900{
902 driver_unregister(&s3c2410fb_driver); 901 platform_driver_unregister(&s3c2410fb_driver);
903} 902}
904 903
905 904
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index a5184575cfae..2ea1354e439f 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -1308,17 +1308,17 @@ sa1100fb_freq_policy(struct notifier_block *nb, unsigned long val,
1308 * Power management hooks. Note that we won't be called from IRQ context, 1308 * Power management hooks. Note that we won't be called from IRQ context,
1309 * unlike the blank functions above, so we may sleep. 1309 * unlike the blank functions above, so we may sleep.
1310 */ 1310 */
1311static int sa1100fb_suspend(struct device *dev, pm_message_t state) 1311static int sa1100fb_suspend(struct platform_device *dev, pm_message_t state)
1312{ 1312{
1313 struct sa1100fb_info *fbi = dev_get_drvdata(dev); 1313 struct sa1100fb_info *fbi = platform_get_drvdata(dev);
1314 1314
1315 set_ctrlr_state(fbi, C_DISABLE_PM); 1315 set_ctrlr_state(fbi, C_DISABLE_PM);
1316 return 0; 1316 return 0;
1317} 1317}
1318 1318
1319static int sa1100fb_resume(struct device *dev) 1319static int sa1100fb_resume(struct platform_device *dev)
1320{ 1320{
1321 struct sa1100fb_info *fbi = dev_get_drvdata(dev); 1321 struct sa1100fb_info *fbi = platform_get_drvdata(dev);
1322 1322
1323 set_ctrlr_state(fbi, C_ENABLE_PM); 1323 set_ctrlr_state(fbi, C_ENABLE_PM);
1324 return 0; 1324 return 0;
@@ -1452,7 +1452,7 @@ static struct sa1100fb_info * __init sa1100fb_init_fbinfo(struct device *dev)
1452 return fbi; 1452 return fbi;
1453} 1453}
1454 1454
1455static int __init sa1100fb_probe(struct device *dev) 1455static int __init sa1100fb_probe(struct platform_device *pdev)
1456{ 1456{
1457 struct sa1100fb_info *fbi; 1457 struct sa1100fb_info *fbi;
1458 int ret; 1458 int ret;
@@ -1460,7 +1460,7 @@ static int __init sa1100fb_probe(struct device *dev)
1460 if (!request_mem_region(0xb0100000, 0x10000, "LCD")) 1460 if (!request_mem_region(0xb0100000, 0x10000, "LCD"))
1461 return -EBUSY; 1461 return -EBUSY;
1462 1462
1463 fbi = sa1100fb_init_fbinfo(dev); 1463 fbi = sa1100fb_init_fbinfo(&pdev->dev);
1464 ret = -ENOMEM; 1464 ret = -ENOMEM;
1465 if (!fbi) 1465 if (!fbi)
1466 goto failed; 1466 goto failed;
@@ -1488,7 +1488,7 @@ static int __init sa1100fb_probe(struct device *dev)
1488 */ 1488 */
1489 sa1100fb_check_var(&fbi->fb.var, &fbi->fb); 1489 sa1100fb_check_var(&fbi->fb.var, &fbi->fb);
1490 1490
1491 dev_set_drvdata(dev, fbi); 1491 platform_set_drvdata(pdev, fbi);
1492 1492
1493 ret = register_framebuffer(&fbi->fb); 1493 ret = register_framebuffer(&fbi->fb);
1494 if (ret < 0) 1494 if (ret < 0)
@@ -1505,18 +1505,19 @@ static int __init sa1100fb_probe(struct device *dev)
1505 return 0; 1505 return 0;
1506 1506
1507failed: 1507failed:
1508 dev_set_drvdata(dev, NULL); 1508 platform_set_drvdata(pdev, NULL);
1509 kfree(fbi); 1509 kfree(fbi);
1510 release_mem_region(0xb0100000, 0x10000); 1510 release_mem_region(0xb0100000, 0x10000);
1511 return ret; 1511 return ret;
1512} 1512}
1513 1513
1514static struct device_driver sa1100fb_driver = { 1514static struct platform_driver sa1100fb_driver = {
1515 .name = "sa11x0-fb",
1516 .bus = &platform_bus_type,
1517 .probe = sa1100fb_probe, 1515 .probe = sa1100fb_probe,
1518 .suspend = sa1100fb_suspend, 1516 .suspend = sa1100fb_suspend,
1519 .resume = sa1100fb_resume, 1517 .resume = sa1100fb_resume,
1518 .driver = {
1519 .name = "sa11x0-fb",
1520 },
1520}; 1521};
1521 1522
1522int __init sa1100fb_init(void) 1523int __init sa1100fb_init(void)
@@ -1524,7 +1525,7 @@ int __init sa1100fb_init(void)
1524 if (fb_get_options("sa1100fb", NULL)) 1525 if (fb_get_options("sa1100fb", NULL))
1525 return -ENODEV; 1526 return -ENODEV;
1526 1527
1527 return driver_register(&sa1100fb_driver); 1528 return platform_driver_register(&sa1100fb_driver);
1528} 1529}
1529 1530
1530int __init sa1100fb_setup(char *options) 1531int __init sa1100fb_setup(char *options)
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 */
753static int __init sgivwfb_probe(struct device *device) 753static 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
834static int sgivwfb_remove(struct device *device) 833static 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
850static struct device_driver sgivwfb_driver = { 849static 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
857static struct platform_device *sgivwfb_device; 857static 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");
890static void __exit sgivwfb_exit(void) 890static 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
896module_exit(sgivwfb_exit); 896module_exit(sgivwfb_exit);
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c
index e25eae1a78c1..2c3aa2fcfd91 100644
--- a/drivers/video/vesafb.c
+++ b/drivers/video/vesafb.c
@@ -245,9 +245,8 @@ static int __init vesafb_setup(char *options)
245 return 0; 245 return 0;
246} 246}
247 247
248static int __init vesafb_probe(struct device *device) 248static int __init vesafb_probe(struct platform_device *dev)
249{ 249{
250 struct platform_device *dev = to_platform_device(device);
251 struct fb_info *info; 250 struct fb_info *info;
252 int i, err; 251 int i, err;
253 unsigned int size_vmode; 252 unsigned int size_vmode;
@@ -480,10 +479,11 @@ err:
480 return err; 479 return err;
481} 480}
482 481
483static struct device_driver vesafb_driver = { 482static struct platform_driver vesafb_driver = {
484 .name = "vesafb",
485 .bus = &platform_bus_type,
486 .probe = vesafb_probe, 483 .probe = vesafb_probe,
484 .driver = {
485 .name = "vesafb",
486 },
487}; 487};
488 488
489static struct platform_device vesafb_device = { 489static struct platform_device vesafb_device = {
@@ -498,12 +498,12 @@ static int __init vesafb_init(void)
498 /* ignore error return of fb_get_options */ 498 /* ignore error return of fb_get_options */
499 fb_get_options("vesafb", &option); 499 fb_get_options("vesafb", &option);
500 vesafb_setup(option); 500 vesafb_setup(option);
501 ret = driver_register(&vesafb_driver); 501 ret = platform_driver_register(&vesafb_driver);
502 502
503 if (!ret) { 503 if (!ret) {
504 ret = platform_device_register(&vesafb_device); 504 ret = platform_device_register(&vesafb_device);
505 if (ret) 505 if (ret)
506 driver_unregister(&vesafb_driver); 506 platform_driver_unregister(&vesafb_driver);
507 } 507 }
508 return ret; 508 return ret;
509} 509}
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c
index 8794dc5d2466..ffa1ad474226 100644
--- a/drivers/video/vfb.c
+++ b/drivers/video/vfb.c
@@ -403,9 +403,8 @@ static void vfb_platform_release(struct device *device)
403 // This is called when the reference count goes to zero. 403 // This is called when the reference count goes to zero.
404} 404}
405 405
406static int __init vfb_probe(struct device *device) 406static int __init vfb_probe(struct platform_device *dev)
407{ 407{
408 struct platform_device *dev = to_platform_device(device);
409 struct fb_info *info; 408 struct fb_info *info;
410 int retval = -ENOMEM; 409 int retval = -ENOMEM;
411 410
@@ -447,7 +446,7 @@ static int __init vfb_probe(struct device *device)
447 retval = register_framebuffer(info); 446 retval = register_framebuffer(info);
448 if (retval < 0) 447 if (retval < 0)
449 goto err2; 448 goto err2;
450 dev_set_drvdata(&dev->dev, info); 449 platform_set_drvdata(dev, info);
451 450
452 printk(KERN_INFO 451 printk(KERN_INFO
453 "fb%d: Virtual frame buffer device, using %ldK of video memory\n", 452 "fb%d: Virtual frame buffer device, using %ldK of video memory\n",
@@ -462,9 +461,9 @@ err:
462 return retval; 461 return retval;
463} 462}
464 463
465static int vfb_remove(struct device *device) 464static int vfb_remove(struct platform_device *dev)
466{ 465{
467 struct fb_info *info = dev_get_drvdata(device); 466 struct fb_info *info = platform_get_drvdata(dev);
468 467
469 if (info) { 468 if (info) {
470 unregister_framebuffer(info); 469 unregister_framebuffer(info);
@@ -474,11 +473,12 @@ static int vfb_remove(struct device *device)
474 return 0; 473 return 0;
475} 474}
476 475
477static struct device_driver vfb_driver = { 476static struct platform_driver vfb_driver = {
478 .name = "vfb",
479 .bus = &platform_bus_type,
480 .probe = vfb_probe, 477 .probe = vfb_probe,
481 .remove = vfb_remove, 478 .remove = vfb_remove,
479 .driver = {
480 .name = "vfb",
481 },
482}; 482};
483 483
484static struct platform_device vfb_device = { 484static struct platform_device vfb_device = {
@@ -504,12 +504,12 @@ static int __init vfb_init(void)
504 if (!vfb_enable) 504 if (!vfb_enable)
505 return -ENXIO; 505 return -ENXIO;
506 506
507 ret = driver_register(&vfb_driver); 507 ret = platform_driver_register(&vfb_driver);
508 508
509 if (!ret) { 509 if (!ret) {
510 ret = platform_device_register(&vfb_device); 510 ret = platform_device_register(&vfb_device);
511 if (ret) 511 if (ret)
512 driver_unregister(&vfb_driver); 512 platform_driver_unregister(&vfb_driver);
513 } 513 }
514 return ret; 514 return ret;
515} 515}
@@ -520,7 +520,7 @@ module_init(vfb_init);
520static void __exit vfb_exit(void) 520static void __exit vfb_exit(void)
521{ 521{
522 platform_device_unregister(&vfb_device); 522 platform_device_unregister(&vfb_device);
523 driver_unregister(&vfb_driver); 523 platform_driver_unregister(&vfb_driver);
524} 524}
525 525
526module_exit(vfb_exit); 526module_exit(vfb_exit);
diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c
index 48e70f153c4b..daa46051f55d 100644
--- a/drivers/video/w100fb.c
+++ b/drivers/video/w100fb.c
@@ -437,9 +437,9 @@ static void w100fb_restore_vidmem(struct w100fb_par *par)
437 } 437 }
438} 438}
439 439
440static int w100fb_suspend(struct device *dev, pm_message_t state) 440static int w100fb_suspend(struct platform_device *dev, pm_message_t state)
441{ 441{
442 struct fb_info *info = dev_get_drvdata(dev); 442 struct fb_info *info = platform_get_drvdata(dev);
443 struct w100fb_par *par=info->par; 443 struct w100fb_par *par=info->par;
444 struct w100_tg_info *tg = par->mach->tg; 444 struct w100_tg_info *tg = par->mach->tg;
445 445
@@ -452,9 +452,9 @@ static int w100fb_suspend(struct device *dev, pm_message_t state)
452 return 0; 452 return 0;
453} 453}
454 454
455static int w100fb_resume(struct device *dev) 455static int w100fb_resume(struct platform_device *dev)
456{ 456{
457 struct fb_info *info = dev_get_drvdata(dev); 457 struct fb_info *info = platform_get_drvdata(dev);
458 struct w100fb_par *par=info->par; 458 struct w100fb_par *par=info->par;
459 struct w100_tg_info *tg = par->mach->tg; 459 struct w100_tg_info *tg = par->mach->tg;
460 460
@@ -473,13 +473,12 @@ static int w100fb_resume(struct device *dev)
473#endif 473#endif
474 474
475 475
476int __init w100fb_probe(struct device *dev) 476int __init w100fb_probe(struct platform_device *pdev)
477{ 477{
478 int err = -EIO; 478 int err = -EIO;
479 struct w100fb_mach_info *inf; 479 struct w100fb_mach_info *inf;
480 struct fb_info *info = NULL; 480 struct fb_info *info = NULL;
481 struct w100fb_par *par; 481 struct w100fb_par *par;
482 struct platform_device *pdev = to_platform_device(dev);
483 struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 482 struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
484 unsigned int chip_id; 483 unsigned int chip_id;
485 484
@@ -522,9 +521,9 @@ int __init w100fb_probe(struct device *dev)
522 } 521 }
523 522
524 par = info->par; 523 par = info->par;
525 dev_set_drvdata(dev, info); 524 platform_set_drvdata(pdev, info);
526 525
527 inf = dev->platform_data; 526 inf = pdev->dev.platform_data;
528 par->chip_id = chip_id; 527 par->chip_id = chip_id;
529 par->mach = inf; 528 par->mach = inf;
530 par->fastpll_mode = 0; 529 par->fastpll_mode = 0;
@@ -600,10 +599,10 @@ int __init w100fb_probe(struct device *dev)
600 goto out; 599 goto out;
601 } 600 }
602 601
603 device_create_file(dev, &dev_attr_fastpllclk); 602 device_create_file(&pdev->dev, &dev_attr_fastpllclk);
604 device_create_file(dev, &dev_attr_reg_read); 603 device_create_file(&pdev->dev, &dev_attr_reg_read);
605 device_create_file(dev, &dev_attr_reg_write); 604 device_create_file(&pdev->dev, &dev_attr_reg_write);
606 device_create_file(dev, &dev_attr_flip); 605 device_create_file(&pdev->dev, &dev_attr_flip);
607 606
608 printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id); 607 printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id);
609 return 0; 608 return 0;
@@ -622,15 +621,15 @@ out:
622} 621}
623 622
624 623
625static int w100fb_remove(struct device *dev) 624static int w100fb_remove(struct platform_device *pdev)
626{ 625{
627 struct fb_info *info = dev_get_drvdata(dev); 626 struct fb_info *info = platform_get_drvdata(pdev);
628 struct w100fb_par *par=info->par; 627 struct w100fb_par *par=info->par;
629 628
630 device_remove_file(dev, &dev_attr_fastpllclk); 629 device_remove_file(&pdev->dev, &dev_attr_fastpllclk);
631 device_remove_file(dev, &dev_attr_reg_read); 630 device_remove_file(&pdev->dev, &dev_attr_reg_read);
632 device_remove_file(dev, &dev_attr_reg_write); 631 device_remove_file(&pdev->dev, &dev_attr_reg_write);
633 device_remove_file(dev, &dev_attr_flip); 632 device_remove_file(&pdev->dev, &dev_attr_flip);
634 633
635 unregister_framebuffer(info); 634 unregister_framebuffer(info);
636 635
@@ -1448,23 +1447,24 @@ static void w100_vsync(void)
1448 writel(0x00000002, remapped_regs + mmGEN_INT_STATUS); 1447 writel(0x00000002, remapped_regs + mmGEN_INT_STATUS);
1449} 1448}
1450 1449
1451static struct device_driver w100fb_driver = { 1450static struct platform_driver w100fb_driver = {
1452 .name = "w100fb",
1453 .bus = &platform_bus_type,
1454 .probe = w100fb_probe, 1451 .probe = w100fb_probe,
1455 .remove = w100fb_remove, 1452 .remove = w100fb_remove,
1456 .suspend = w100fb_suspend, 1453 .suspend = w100fb_suspend,
1457 .resume = w100fb_resume, 1454 .resume = w100fb_resume,
1455 .driver = {
1456 .name = "w100fb",
1457 },
1458}; 1458};
1459 1459
1460int __devinit w100fb_init(void) 1460int __devinit w100fb_init(void)
1461{ 1461{
1462 return driver_register(&w100fb_driver); 1462 return platform_driver_register(&w100fb_driver);
1463} 1463}
1464 1464
1465void __exit w100fb_cleanup(void) 1465void __exit w100fb_cleanup(void)
1466{ 1466{
1467 driver_unregister(&w100fb_driver); 1467 platform_driver_unregister(&w100fb_driver);
1468} 1468}
1469 1469
1470module_init(w100fb_init); 1470module_init(w100fb_init);