.fops = &omap_wdt_fops
};
-static int __init omap_wdt_probe(struct device *dev)
+static int __init omap_wdt_probe(struct platform_device *pdev)
{
- struct platform_device *pdev = to_platform_device(dev);
struct resource *res, *mem;
int ret;
if (mem == NULL)
return -EBUSY;
- dev_set_drvdata(dev, mem);
+ platform_set_drvdata(pdev, mem);
omap_wdt_users = 0;
if (cpu_is_omap16xx()) {
- armwdt_ck = clk_get(dev, "armwdt_ck");
+ armwdt_ck = clk_get(&pdev->dev, "armwdt_ck");
if (IS_ERR(armwdt_ck)) {
ret = PTR_ERR(armwdt_ck);
armwdt_ck = NULL;
}
if (cpu_is_omap24xx()) {
- mpu_wdt_ick = clk_get(dev, "mpu_wdt_ick");
+ mpu_wdt_ick = clk_get(&pdev->dev, "mpu_wdt_ick");
if (IS_ERR(mpu_wdt_ick)) {
ret = PTR_ERR(mpu_wdt_ick);
mpu_wdt_ick = NULL;
goto fail;
}
- mpu_wdt_fck = clk_get(dev, "mpu_wdt_fck");
+ mpu_wdt_fck = clk_get(&pdev->dev, "mpu_wdt_fck");
if (IS_ERR(mpu_wdt_fck)) {
ret = PTR_ERR(mpu_wdt_fck);
mpu_wdt_fck = NULL;
omap_wdt_disable();
omap_wdt_adjust_timeout(timer_margin);
- omap_wdt_miscdev.dev = dev;
+ omap_wdt_miscdev.dev = &pdev->dev;
ret = misc_register(&omap_wdt_miscdev);
if (ret)
goto fail;
return ret;
}
-static void omap_wdt_shutdown(struct device *dev)
+static void omap_wdt_shutdown(struct platform_device *pdev)
{
omap_wdt_disable();
}
-static int __exit omap_wdt_remove(struct device *dev)
+static int omap_wdt_remove(struct platform_device *pdev)
{
- struct resource *mem = dev_get_drvdata(dev);
+ struct resource *mem = platform_get_drvdata(pdev);
misc_deregister(&omap_wdt_miscdev);
release_resource(mem);
if (armwdt_ck)
* may not play well enough with NOWAYOUT...
*/
-static int omap_wdt_suspend(struct device *dev, pm_message_t state)
+static int omap_wdt_suspend(struct platform_device *pdev, pm_message_t state)
{
if (omap_wdt_users)
omap_wdt_disable();
return 0;
}
-static int omap_wdt_resume(struct device *dev)
+static int omap_wdt_resume(struct platform_device *pdev)
{
if (omap_wdt_users) {
omap_wdt_enable();
#define omap_wdt_resume NULL
#endif
-static struct device_driver omap_wdt_driver = {
- .name = "omap_wdt",
- .bus = &platform_bus_type,
- .probe = omap_wdt_probe,
- .shutdown = omap_wdt_shutdown,
- .remove = __exit_p(omap_wdt_remove),
- .suspend = omap_wdt_suspend,
- .resume = omap_wdt_resume,
+static struct platform_driver omap_wdt_driver = {
+ .probe = omap_wdt_probe,
+ .remove = omap_wdt_remove,
+ .shutdown = omap_wdt_shutdown,
+ .suspend = omap_wdt_suspend,
+ .resume = omap_wdt_resume,
+ .driver = {
+ .owner = THIS_MODULE,
+ .name = "omap-wdt",
+ },
};
static int __init omap_wdt_init(void)
{
- return driver_register(&omap_wdt_driver);
+ return platform_driver_register(&omap_wdt_driver);
}
static void __exit omap_wdt_exit(void)
{
- driver_unregister(&omap_wdt_driver);
+ platform_driver_unregister(&omap_wdt_driver);
}
module_init(omap_wdt_init);