Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

George Cherian and committed by
Wim Van Sebroeck
2cdf25bb 37f15291

+1 -4
+1 -4
drivers/watchdog/shwdt.c
··· 230 230 if (pdev->id != -1) 231 231 return -EINVAL; 232 232 233 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 234 - if (unlikely(!res)) 235 - return -EINVAL; 236 - 237 233 wdt = devm_kzalloc(&pdev->dev, sizeof(struct sh_wdt), GFP_KERNEL); 238 234 if (unlikely(!wdt)) 239 235 return -ENOMEM; ··· 245 249 wdt->clk = NULL; 246 250 } 247 251 252 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 248 253 wdt->base = devm_ioremap_resource(wdt->dev, res); 249 254 if (IS_ERR(wdt->base)) 250 255 return PTR_ERR(wdt->base);