Skip to content

Commit

Permalink
watchdog: mpcore_wdt: Allow platform_get_irq() to fail
Browse files Browse the repository at this point in the history
irq is not necessary for mpcore wdt. Don't return error if it is not passed. But
if it is passed, then request_irq must pass.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  • Loading branch information
Viresh Kumar authored and Wim Van Sebroeck committed Mar 27, 2012
1 parent 75f5a53 commit 60a1aa5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions drivers/watchdog/mpcore_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,15 @@ static int __devinit mpcore_wdt_probe(struct platform_device *pdev)

wdt->dev = &pdev->dev;
wdt->irq = platform_get_irq(pdev, 0);
if (wdt->irq < 0)
return -ENXIO;

ret = devm_request_irq(wdt->dev, 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);
return ret;
if (wdt->irq >= 0) {
ret = devm_request_irq(wdt->dev, 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);
return ret;
}
}

wdt->base = devm_ioremap(wdt->dev, res->start, resource_size(res));
Expand Down

0 comments on commit 60a1aa5

Please sign in to comment.