Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105550
b: refs/heads/master
c: 84c41ce
h: refs/heads/master
v: v3
  • Loading branch information
Krzysztof Helt authored and Linus Torvalds committed Jul 24, 2008
1 parent 7004b8f commit cb471b0
Show file tree
Hide file tree
Showing 2 changed files with 21 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: a882ef47c7156e8cc47e72f2aa396f2514569c48
refs/heads/master: 84c41ce83e9b2987ccef352f28ba0055b26c8f8e
37 changes: 20 additions & 17 deletions trunk/drivers/video/skeletonfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,13 +675,13 @@ static struct fb_ops xxxfb_ops = {
* Initialization
*/

/* static int __init xxfb_probe (struct device *device) -- for platform devs */
/* static int __init xxfb_probe (struct platform_device *pdev) -- for platform devs */
static int __devinit xxxfb_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
{
struct fb_info *info;
struct xxx_par *par;
struct device* device = &dev->dev; /* for pci drivers */
struct device *device = &dev->dev; /* or &pdev->dev */
int cmap_len, retval;

/*
Expand Down Expand Up @@ -824,18 +824,18 @@ static int __devinit xxxfb_probe(struct pci_dev *dev,
return -EINVAL;
printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node,
info->fix.id);
pci_set_drvdata(dev, info); /* or dev_set_drvdata(device, info) */
pci_set_drvdata(dev, info); /* or platform_set_drvdata(pdev, info) */
return 0;
}

/*
* Cleanup
*/
/* static void __devexit xxxfb_remove(struct device *device) */
/* static void __devexit xxxfb_remove(struct platform_device *pdev) */
static void __devexit xxxfb_remove(struct pci_dev *dev)
{
struct fb_info *info = pci_get_drvdata(dev);
/* or dev_get_drvdata(device); */
/* or platform_get_drvdata(pdev); */

if (info) {
unregister_framebuffer(info);
Expand Down Expand Up @@ -961,18 +961,17 @@ static int xxxfb_resume(struct platform_dev *dev)
#define xxxfb_resume NULL
#endif /* CONFIG_PM */

static struct device_driver xxxfb_driver = {
.name = "xxxfb",
.bus = &platform_bus_type,
static struct platform_device_driver xxxfb_driver = {
.probe = xxxfb_probe,
.remove = xxxfb_remove,
.suspend = xxxfb_suspend, /* optional but recommended */
.resume = xxxfb_resume, /* optional but recommended */
.driver = {
.name = "xxxfb",
},
};

static struct platform_device xxxfb_device = {
.name = "xxxfb",
};
static struct platform_device *xxxfb_device;

#ifndef MODULE
/*
Expand Down Expand Up @@ -1002,21 +1001,25 @@ static int __init xxxfb_init(void)
return -ENODEV;
xxxfb_setup(option);
#endif
ret = driver_register(&xxxfb_driver);
ret = platform_driver_register(&xxxfb_driver);

if (!ret) {
ret = platform_device_register(&xxxfb_device);
if (ret)
driver_unregister(&xxxfb_driver);
xxxfb_device = platform_device_register_simple("xxxfb", 0,
NULL, 0);

if (IS_ERR(xxxfb_device)) {
platform_driver_unregister(&xxxfb_driver);
ret = PTR_ERR(xxxfb_device);
}
}

return ret;
}

static void __exit xxxfb_exit(void)
{
platform_device_unregister(&xxxfb_device);
driver_unregister(&xxxfb_driver);
platform_device_unregister(xxxfb_device);
platform_driver_unregister(&xxxfb_driver);
}
#endif /* CONFIG_PCI */

Expand Down

0 comments on commit cb471b0

Please sign in to comment.