Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30291
b: refs/heads/master
c: ae6d321
h: refs/heads/master
i:
  30289: 682dc11
  30287: 67ecc91
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Jun 26, 2006
1 parent a4e0a99 commit ede9ed9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 20cecf6a6ade62e3a721eb31540f22126df7462b
refs/heads/master: ae6d3218760f3cc28192de1f7ff594be744495b4
40 changes: 23 additions & 17 deletions trunk/drivers/video/vga16fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1334,9 +1334,8 @@ static int vga16fb_setup(char *options)
}
#endif

static int __init vga16fb_probe(struct device *device)
static int __init vga16fb_probe(struct platform_device *dev)
{
struct platform_device *dev = to_platform_device(device);
struct fb_info *info;
struct vga16fb_par *par;
int i;
Expand Down Expand Up @@ -1403,7 +1402,7 @@ static int __init vga16fb_probe(struct device *device)

printk(KERN_INFO "fb%d: %s frame buffer device\n",
info->node, info->fix.id);
dev_set_drvdata(device, info);
platform_set_drvdata(dev, info);

return 0;

Expand All @@ -1417,9 +1416,9 @@ static int __init vga16fb_probe(struct device *device)
return ret;
}

static int vga16fb_remove(struct device *device)
static int vga16fb_remove(struct platform_device *dev)
{
struct fb_info *info = dev_get_drvdata(device);
struct fb_info *info = platform_get_drvdata(dev);

if (info) {
unregister_framebuffer(info);
Expand All @@ -1432,16 +1431,15 @@ static int vga16fb_remove(struct device *device)
return 0;
}

static struct device_driver vga16fb_driver = {
.name = "vga16fb",
.bus = &platform_bus_type,
static struct platform_driver vga16fb_driver = {
.probe = vga16fb_probe,
.remove = vga16fb_remove,
.driver = {
.name = "vga16fb",
},
};

static struct platform_device vga16fb_device = {
.name = "vga16fb",
};
static struct platform_device *vga16fb_device;

static int __init vga16fb_init(void)
{
Expand All @@ -1454,21 +1452,29 @@ static int __init vga16fb_init(void)

vga16fb_setup(option);
#endif
ret = driver_register(&vga16fb_driver);
ret = platform_driver_register(&vga16fb_driver);

if (!ret) {
ret = platform_device_register(&vga16fb_device);
if (ret)
driver_unregister(&vga16fb_driver);
vga16fb_device = platform_device_alloc("vga16fb", 0);

if (vga16fb_device)
ret = platform_device_add(vga16fb_device);
else
ret = -ENOMEM;

if (ret) {
platform_device_put(vga16fb_device);
platform_driver_unregister(&vga16fb_driver);
}
}

return ret;
}

static void __exit vga16fb_exit(void)
{
platform_device_unregister(&vga16fb_device);
driver_unregister(&vga16fb_driver);
platform_device_unregister(vga16fb_device);
platform_driver_unregister(&vga16fb_driver);
}

MODULE_LICENSE("GPL");
Expand Down

0 comments on commit ede9ed9

Please sign in to comment.