Commit 6cfc676c authored by Komal Shah's avatar Komal Shah Committed by Tony Lindgren

[PATCH] ARM: OMAP: omap1610-ir: Use struct platform_driver and PM updates

omap1610-ir: Use struct platform_driver and PM updates.
Signed-off-by: default avatarKomal Shah <komal_shah802003@yahoo.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 1f99be1c
...@@ -837,12 +837,12 @@ static int omap1610_irda_set_speed(struct net_device *dev, int speed) ...@@ -837,12 +837,12 @@ static int omap1610_irda_set_speed(struct net_device *dev, int speed)
/* /*
* Suspend the IrDA interface. * Suspend the IrDA interface.
*/ */
static int omap1610_irda_suspend(struct device *_dev, u32 state, u32 level) static int omap1610_irda_suspend(struct platform_device *pdev, pm_message_t state)
{ {
struct net_device *dev = dev_get_drvdata(_dev); struct net_device *dev = platform_get_drvdata(pdev);
struct omap1610_irda *si = dev->priv; struct omap1610_irda *si = dev->priv;
if (!dev || level != SUSPEND_DISABLE) if (!dev)
return 0; return 0;
if (si->open) { if (si->open) {
...@@ -859,12 +859,12 @@ static int omap1610_irda_suspend(struct device *_dev, u32 state, u32 level) ...@@ -859,12 +859,12 @@ static int omap1610_irda_suspend(struct device *_dev, u32 state, u32 level)
/* /*
* Resume the IrDA interface. * Resume the IrDA interface.
*/ */
static int omap1610_irda_resume(struct device *_dev, u32 level) static int omap1610_irda_resume(struct platform_device *pdev)
{ {
struct net_device *dev = dev_get_drvdata(_dev); struct net_device *dev = platform_get_drvdata(pdev);
struct omap1610_irda *si= dev->priv; struct omap1610_irda *si= dev->priv;
if (!dev || level != RESUME_ENABLE) if (!dev)
return 0; return 0;
if (si->open) { if (si->open) {
...@@ -897,9 +897,8 @@ static int omap1610_irda_resume(struct device *_dev, u32 level) ...@@ -897,9 +897,8 @@ static int omap1610_irda_resume(struct device *_dev, u32 level)
#define omap1610_irda_resume NULL #define omap1610_irda_resume NULL
#endif #endif
static int omap1610_irda_probe(struct device *_dev) static int omap1610_irda_probe(struct platform_device *pdev)
{ {
struct platform_device *pdev = to_platform_device(_dev);
struct net_device *dev; struct net_device *dev;
struct omap1610_irda *si; struct omap1610_irda *si;
unsigned int baudrate_mask; unsigned int baudrate_mask;
...@@ -943,47 +942,50 @@ static int omap1610_irda_probe(struct device *_dev) ...@@ -943,47 +942,50 @@ static int omap1610_irda_probe(struct device *_dev)
err = register_netdev(dev); err = register_netdev(dev);
if (!err) if (!err)
dev_set_drvdata(&pdev->dev, dev); platform_set_drvdata(pdev, dev);
else else
free_netdev(dev); free_netdev(dev);
err_mem_1: err_mem_1:
return err; return err;
} }
static int omap1610_irda_remove(struct device *_dev) static int omap1610_irda_remove(struct platform_device *pdev)
{ {
struct net_device *dev = dev_get_drvdata(_dev); struct net_device *dev = platform_get_drvdata(pdev);
#ifdef CONFIG_MACH_OMAP_H3 #ifdef CONFIG_MACH_OMAP_H3
if (machine_is_omap_h3()) if (machine_is_omap_h3())
cancel_delayed_work(&set_h3_gpio_expa_work); cancel_delayed_work(&set_h3_gpio_expa_work);
#endif #endif
if (dev) { if (pdev) {
unregister_netdev(dev); unregister_netdev(dev);
free_netdev(dev); free_netdev(dev);
} }
return 0; return 0;
} }
static struct device_driver omap1610ir_driver = { static struct platform_driver omap1610ir_driver = {
.name = "omap1610-ir", .probe = omap1610_irda_probe,
.bus = &platform_bus_type, .remove = omap1610_irda_remove,
.probe = omap1610_irda_probe, .suspend = omap1610_irda_suspend,
.remove = omap1610_irda_remove, .resume = omap1610_irda_resume,
.suspend = omap1610_irda_suspend, .driver = {
.resume = omap1610_irda_resume, .name = "omap1610-ir",
},
}; };
static char __initdata banner[] = "OMAP1610 IrDA driver\n";
static int __init omap1610_irda_init(void) static int __init omap1610_irda_init(void)
{ {
return driver_register(&omap1610ir_driver); printk(banner);
return platform_driver_register(&omap1610ir_driver);
} }
static void __exit omap1610_irda_exit(void) static void __exit omap1610_irda_exit(void)
{ {
driver_unregister(&omap1610ir_driver); platform_driver_unregister(&omap1610ir_driver);
} }
module_init(omap1610_irda_init); module_init(omap1610_irda_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment