aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Cherian <george.cherian@ti.com>2014-06-10 00:40:08 -0400
committerWim Van Sebroeck <wim@iguana.be>2014-08-05 16:42:56 -0400
commit2cdf25bb574c20efde0340ffa90f08d1609ef97c (patch)
treea87cdbf19254def17b66ad7c31067bb056fd1d28
parent37f152915fba723de7e5bf43ade3bd971977b724 (diff)
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>
-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)
230 if (pdev->id != -1) 230 if (pdev->id != -1)
231 return -EINVAL; 231 return -EINVAL;
232 232
233 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
234 if (unlikely(!res))
235 return -EINVAL;
236
237 wdt = devm_kzalloc(&pdev->dev, sizeof(struct sh_wdt), GFP_KERNEL); 233 wdt = devm_kzalloc(&pdev->dev, sizeof(struct sh_wdt), GFP_KERNEL);
238 if (unlikely(!wdt)) 234 if (unlikely(!wdt))
239 return -ENOMEM; 235 return -ENOMEM;
@@ -249,6 +245,7 @@ static int sh_wdt_probe(struct platform_device *pdev)
249 wdt->clk = NULL; 245 wdt->clk = NULL;
250 } 246 }
251 247
248 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
252 wdt->base = devm_ioremap_resource(wdt->dev, res); 249 wdt->base = devm_ioremap_resource(wdt->dev, res);
253 if (IS_ERR(wdt->base)) 250 if (IS_ERR(wdt->base))
254 return PTR_ERR(wdt->base); 251 return PTR_ERR(wdt->base);