* start LCD frame transfer
* 7. register system fb_info structure
*/
-static int omapfb_probe(struct device *dev)
+static int omapfb_probe(struct platform_device *pdev)
{
- struct platform_device *pdev;
struct omapfb_device *fbdev = NULL;
struct fb_info *fbi;
int init_state;
init_state = 0;
- pdev = to_platform_device(dev);
if (pdev->num_resources != 0) {
pr_err("probed for an unknown device\n");
r = -ENODEV;
goto cleanup;
}
- fbi = framebuffer_alloc(sizeof(struct omapfb_device), dev);
+ fbi = framebuffer_alloc(sizeof(struct omapfb_device), &pdev->dev);
if (fbi == NULL) {
pr_err("unable to allocate memory for device info\n");
r = -ENOMEM;
fbdev = (struct omapfb_device *)fbi->par;
fbdev->fb_info = fbi;
- fbdev->dev = dev;
- dev_set_drvdata(dev, fbdev);
+ fbdev->dev = &pdev->dev;
+ platform_set_drvdata(pdev, fbdev);
init_MUTEX(&fbdev->rqueue_sema);
}
/* Called when the device is being detached from the driver */
-static int omapfb_remove(struct device *dev)
+static int omapfb_remove(struct platform_device *pdev)
{
- struct omapfb_device *fbdev = dev_get_drvdata(dev);
+ struct omapfb_device *fbdev = platform_get_drvdata(pdev);
enum omapfb_state saved_state = fbdev->state;
DBGENTER(1);
}
/* PM suspend */
-static int omapfb_suspend(struct device *dev, pm_message_t mesg)
+static int omapfb_suspend(struct platform_device *pdev, pm_message_t mesg)
{
- struct omapfb_device *fbdev = dev_get_drvdata(dev);
+ struct omapfb_device *fbdev = platform_get_drvdata(pdev);
DBGENTER(1);
}
/* PM resume */
-static int omapfb_resume(struct device *dev)
+static int omapfb_resume(struct platform_device *pdev)
{
- struct omapfb_device *fbdev = dev_get_drvdata(dev);
+ struct omapfb_device *fbdev = platform_get_drvdata(pdev);
DBGENTER(1);
return 0;
}
-static struct device_driver omapfb_driver = {
- .name = OMAPFB_DRIVER,
- .bus = &platform_bus_type,
- .probe = omapfb_probe,
- .remove = omapfb_remove,
+static struct platform_driver omapfb_driver = {
+ .probe = omapfb_probe,
+ .remove = omapfb_remove,
.suspend = omapfb_suspend,
- .resume = omapfb_resume
+ .resume = omapfb_resume,
+ .driver = {
+ .name = OMAPFB_DRIVER,
+ .owner = THIS_MODULE,
+ },
};
#ifndef MODULE
}
#endif
/* Register the driver with LDM */
- if (driver_register(&omapfb_driver)) {
+ if (platform_driver_register(&omapfb_driver)) {
pr_err("failed to register omapfb driver\n");
r = -ENODEV;
goto exit;
{
DBGENTER(1);
- driver_unregister(&omapfb_driver);
+ platform_driver_unregister(&omapfb_driver);
DBGLEAVE(1);
}