summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorGeorge Cherian <george.cherian@ti.com>2014-06-10 10:10:08 +0530
committerWim Van Sebroeck <wim@iguana.be>2014-08-05 22:42:56 +0200
commit2cdf25bb574c20efde0340ffa90f08d1609ef97c (patch)
treea87cdbf19254def17b66ad7c31067bb056fd1d28 /drivers/watchdog
parent37f152915fba723de7e5bf43ade3bd971977b724 (diff)
downloadblackbird-op-linux-2cdf25bb574c20efde0340ffa90f08d1609ef97c.tar.gz
blackbird-op-linux-2cdf25bb574c20efde0340ffa90f08d1609ef97c.zip
watchdog: shwdt: Remove the unnecessary check of resource after platform_get_resource()
devm_ioremap_resource check for a valid resource. Remove the unnecessary check. Also group platform_get_resource and devm_ioremap_resource together for better readability. Signed-off-by: George Cherian <george.cherian@ti.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/shwdt.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/watchdog/shwdt.c b/drivers/watchdog/shwdt.c
index 061756e36cf8..fa89bb30d004 100644
--- a/drivers/watchdog/shwdt.c
+++ b/drivers/watchdog/shwdt.c
@@ -230,10 +230,6 @@ static int sh_wdt_probe(struct platform_device *pdev)
if (pdev->id != -1)
return -EINVAL;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (unlikely(!res))
- return -EINVAL;
-
wdt = devm_kzalloc(&pdev->dev, sizeof(struct sh_wdt), GFP_KERNEL);
if (unlikely(!wdt))
return -ENOMEM;
@@ -249,6 +245,7 @@ static int sh_wdt_probe(struct platform_device *pdev)
wdt->clk = NULL;
}
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
wdt->base = devm_ioremap_resource(wdt->dev, res);
if (IS_ERR(wdt->base))
return PTR_ERR(wdt->base);
OpenPOWER on IntegriCloud