/*
* 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;
- if (!dev || level != SUSPEND_DISABLE)
+ if (!dev)
return 0;
if (si->open) {
/*
* 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;
- if (!dev || level != RESUME_ENABLE)
+ if (!dev)
return 0;
if (si->open) {
#define omap1610_irda_resume NULL
#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 omap1610_irda *si;
unsigned int baudrate_mask;
err = register_netdev(dev);
if (!err)
- dev_set_drvdata(&pdev->dev, dev);
+ platform_set_drvdata(pdev, dev);
else
free_netdev(dev);
- err_mem_1:
+ err_mem_1:
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
if (machine_is_omap_h3())
cancel_delayed_work(&set_h3_gpio_expa_work);
#endif
- if (dev) {
+ if (pdev) {
unregister_netdev(dev);
free_netdev(dev);
}
return 0;
}
-static struct device_driver omap1610ir_driver = {
- .name = "omap1610-ir",
- .bus = &platform_bus_type,
- .probe = omap1610_irda_probe,
- .remove = omap1610_irda_remove,
- .suspend = omap1610_irda_suspend,
- .resume = omap1610_irda_resume,
+static struct platform_driver omap1610ir_driver = {
+ .probe = omap1610_irda_probe,
+ .remove = omap1610_irda_remove,
+ .suspend = omap1610_irda_suspend,
+ .resume = omap1610_irda_resume,
+ .driver = {
+ .name = "omap1610-ir",
+ },
};
+static char __initdata banner[] = "OMAP1610 IrDA driver\n";
+
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)
{
- driver_unregister(&omap1610ir_driver);
+ platform_driver_unregister(&omap1610ir_driver);
}
module_init(omap1610_irda_init);