Ideally, device/driver must be completely ready while we register it with any
framework. This includes allocating resources, registering irqs, etc. Currently
for mpcore_wdt irq is requested after it is registered as a misc device.
So, this patch moves request_irq before registration of misc device.
Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxx>
---
drivers/watchdog/mpcore_wdt.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c
index 1e9c3d3..db379f7 100644
--- a/drivers/watchdog/mpcore_wdt.c
+++ b/drivers/watchdog/mpcore_wdt.c
@@ -340,6 +340,13 @@ static int __devinit mpcore_wdt_probe(struct platform_device *pdev)
goto err_free;
}
+ ret = request_irq(wdt->irq, mpcore_wdt_fire, 0, "mpcore_wdt", wdt);
+ if (ret) {
+ dev_printk(KERN_ERR, wdt->dev,
+ "cannot register IRQ%d for watchdog\n", wdt->irq);
+ goto err_irq;
+ }
+
mpcore_wdt_miscdev.parent = &pdev->dev;
ret = misc_register(&mpcore_wdt_miscdev);
if (ret) {
@@ -349,22 +356,15 @@ static int __devinit mpcore_wdt_probe(struct platform_device *pdev)
goto err_misc;
}
- ret = request_irq(wdt->irq, mpcore_wdt_fire, 0, "mpcore_wdt", wdt);
- if (ret) {
- dev_printk(KERN_ERR, wdt->dev,
- "cannot register IRQ%d for watchdog\n", wdt->irq);
- goto err_irq;
- }
-
mpcore_wdt_stop(wdt);
platform_set_drvdata(pdev, wdt);
mpcore_wdt_pdev = pdev;
return 0;
-err_irq:
- misc_deregister(&mpcore_wdt_miscdev);
err_misc:
+ free_irq(wdt->irq, wdt);
+err_irq:
iounmap(wdt->base);
err_free:
kfree(wdt);
--
1.7.8.110.g4cb5d
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Site Home]
[Linux ARM Kernel]
[Linux ARM]
[Linux Omap]
[Fedora ARM]
[IETF Annouce]
[Security]
[Bugtraq]
[Linux]
[Linux OMAP]
[Linux MIPS]
[ECOS]
[Tools]
[DDR & Rambus]
[Asterisk Internet PBX]
[Linux API]
[Monitors]