diff options
Diffstat (limited to 'drivers/watchdog/bcm63xx_wdt.c')
| -rw-r--r-- | drivers/watchdog/bcm63xx_wdt.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/watchdog/bcm63xx_wdt.c b/drivers/watchdog/bcm63xx_wdt.c index 8379dc32fd9..5a8e879a430 100644 --- a/drivers/watchdog/bcm63xx_wdt.c +++ b/drivers/watchdog/bcm63xx_wdt.c @@ -15,7 +15,7 @@ #include <linux/bitops.h> #include <linux/errno.h> #include <linux/fs.h> -#include <linux/init.h> +#include <linux/io.h> #include <linux/kernel.h> #include <linux/miscdevice.h> #include <linux/module.h> @@ -44,7 +44,6 @@ static struct { void __iomem *regs; struct timer_list timer; - int default_ticks; unsigned long inuse; atomic_t ticks; } bcm63xx_wdt_device; @@ -236,7 +235,7 @@ static struct miscdevice bcm63xx_wdt_miscdev = { }; -static int __devinit bcm63xx_wdt_probe(struct platform_device *pdev) +static int bcm63xx_wdt_probe(struct platform_device *pdev) { int ret; struct resource *r; @@ -249,7 +248,8 @@ static int __devinit bcm63xx_wdt_probe(struct platform_device *pdev) return -ENODEV; } - bcm63xx_wdt_device.regs = ioremap_nocache(r->start, resource_size(r)); + bcm63xx_wdt_device.regs = devm_ioremap_nocache(&pdev->dev, r->start, + resource_size(r)); if (!bcm63xx_wdt_device.regs) { dev_err(&pdev->dev, "failed to remap I/O resources\n"); return -ENXIO; @@ -258,7 +258,7 @@ static int __devinit bcm63xx_wdt_probe(struct platform_device *pdev) ret = bcm63xx_timer_register(TIMER_WDT_ID, bcm63xx_wdt_isr, NULL); if (ret < 0) { dev_err(&pdev->dev, "failed to register wdt timer isr\n"); - goto unmap; + return ret; } if (bcm63xx_wdt_settimeout(wdt_time)) { @@ -281,19 +281,16 @@ static int __devinit bcm63xx_wdt_probe(struct platform_device *pdev) unregister_timer: bcm63xx_timer_unregister(TIMER_WDT_ID); -unmap: - iounmap(bcm63xx_wdt_device.regs); return ret; } -static int __devexit bcm63xx_wdt_remove(struct platform_device *pdev) +static int bcm63xx_wdt_remove(struct platform_device *pdev) { if (!nowayout) bcm63xx_wdt_pause(); misc_deregister(&bcm63xx_wdt_miscdev); bcm63xx_timer_unregister(TIMER_WDT_ID); - iounmap(bcm63xx_wdt_device.regs); return 0; } @@ -302,9 +299,9 @@ static void bcm63xx_wdt_shutdown(struct platform_device *pdev) bcm63xx_wdt_pause(); } -static struct platform_driver bcm63xx_wdt = { +static struct platform_driver bcm63xx_wdt_driver = { .probe = bcm63xx_wdt_probe, - .remove = __devexit_p(bcm63xx_wdt_remove), + .remove = bcm63xx_wdt_remove, .shutdown = bcm63xx_wdt_shutdown, .driver = { .owner = THIS_MODULE, @@ -312,11 +309,10 @@ static struct platform_driver bcm63xx_wdt = { } }; -module_platform_driver(bcm63xx_wdt); +module_platform_driver(bcm63xx_wdt_driver); MODULE_AUTHOR("Miguel Gaio <miguel.gaio@efixo.com>"); MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>"); MODULE_DESCRIPTION("Driver for the Broadcom BCM63xx SoC watchdog"); MODULE_LICENSE("GPL"); -MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); MODULE_ALIAS("platform:bcm63xx-wdt"); |
