1
0
Fork 0

[POWERPC] XilinxFB: cleanup platform_bus binding to use platform bus API.

Change the platform bus binding to make use of the established
platform_bus API.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andrei Konovalov <akonovalov@ru.mvista.com>
hifive-unleashed-5.1
Grant Likely 2007-10-04 10:48:37 -06:00
parent 264776224d
commit 47473e3158
1 changed files with 16 additions and 16 deletions

View File

@ -339,26 +339,24 @@ static int xilinxfb_release(struct device *dev)
*/ */
static int static int
xilinxfb_drv_probe(struct device *dev) xilinxfb_platform_probe(struct platform_device *pdev)
{ {
struct platform_device *pdev;
struct xilinxfb_platform_data *pdata; struct xilinxfb_platform_data *pdata;
struct resource *res; struct resource *res;
int width_mm; int width_mm;
int height_mm; int height_mm;
int rotate; int rotate;
pdev = to_platform_device(dev);
pdata = pdev->dev.platform_data; pdata = pdev->dev.platform_data;
if (!pdata) { if (!pdata) {
dev_err(dev, "Missing pdata structure\n"); dev_err(&pdev->dev, "Missing pdata structure\n");
return -ENODEV; return -ENODEV;
} }
/* Find the registers address */ /* Find the registers address */
res = platform_get_resource(pdev, IORESOURCE_IO, 0); res = platform_get_resource(pdev, IORESOURCE_IO, 0);
if (!res) { if (!res) {
dev_err(dev, "Couldn't get registers resource\n"); dev_err(&pdev->dev, "Couldn't get registers resource\n");
return -ENODEV; return -ENODEV;
} }
@ -366,22 +364,24 @@ xilinxfb_drv_probe(struct device *dev)
width_mm = pdata->screen_width_mm; width_mm = pdata->screen_width_mm;
rotate = pdata->rotate_screen ? 1 : 0; rotate = pdata->rotate_screen ? 1 : 0;
return xilinxfb_assign(dev, res->start, width_mm, height_mm, rotate); return xilinxfb_assign(&pdev->dev, res->start, width_mm, height_mm,
rotate);
} }
static int static int
xilinxfb_drv_remove(struct device *dev) xilinxfb_platform_remove(struct platform_device *pdev)
{ {
return xilinxfb_release(dev); return xilinxfb_release(&pdev->dev);
} }
static struct device_driver xilinxfb_driver = { static struct platform_driver xilinxfb_platform_driver = {
.name = DRIVER_NAME, .probe = xilinxfb_platform_probe,
.bus = &platform_bus_type, .remove = xilinxfb_platform_remove,
.driver = {
.probe = xilinxfb_drv_probe, .owner = THIS_MODULE,
.remove = xilinxfb_drv_remove .name = DRIVER_NAME,
},
}; };
static int __init static int __init
@ -391,13 +391,13 @@ xilinxfb_init(void)
* No kernel boot options used, * No kernel boot options used,
* so we just need to register the driver * so we just need to register the driver
*/ */
return driver_register(&xilinxfb_driver); return platform_driver_register(&xilinxfb_platform_driver);
} }
static void __exit static void __exit
xilinxfb_cleanup(void) xilinxfb_cleanup(void)
{ {
driver_unregister(&xilinxfb_driver); platform_driver_unregister(&xilinxfb_platform_driver);
} }
module_init(xilinxfb_init); module_init(xilinxfb_init);