diff options
author | Jingoo Han <jg1.han@samsung.com> | 2014-02-11 21:41:54 +0900 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2014-03-31 13:24:14 +0200 |
commit | 4f6120b014c6a981a57a8951e01acfead1a57069 (patch) | |
tree | 87f85a6d6ab757c0b0ecaaee723b0762cf30210d /drivers/watchdog | |
parent | a17fb5cbee5dffcb93aeb4b71e2ef9e0eeec0bc2 (diff) |
watchdog: ep93xx_wdt: Use devm_ioremap_resource()
Use devm_ioremap_resource() in order to make the code simpler,
and remove redundant return value check of platform_get_resource()
because the value is checked by devm_ioremap_resource().
Signed-off-by: Jingoo Han <jg1.han@samsung.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/ep93xx_wdt.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/watchdog/ep93xx_wdt.c b/drivers/watchdog/ep93xx_wdt.c index d1d07f2f69df..5e4f3dea85f5 100644 --- a/drivers/watchdog/ep93xx_wdt.c +++ b/drivers/watchdog/ep93xx_wdt.c @@ -118,16 +118,9 @@ static int ep93xx_wdt_probe(struct platform_device *pdev) int err; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENXIO; - - if (!devm_request_mem_region(&pdev->dev, res->start, - resource_size(res), pdev->name)) - return -EBUSY; - - mmio_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); - if (!mmio_base) - return -ENXIO; + mmio_base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(mmio_base)) + return PTR_ERR(mmio_base); if (timeout < 1 || timeout > 3600) { timeout = WDT_TIMEOUT; |