Commit 4f6120b0 authored by Jingoo Han's avatar Jingoo Han Committed by Wim Van Sebroeck

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: default avatarJingoo Han <jg1.han@samsung.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent a17fb5cb
...@@ -118,16 +118,9 @@ static int ep93xx_wdt_probe(struct platform_device *pdev) ...@@ -118,16 +118,9 @@ static int ep93xx_wdt_probe(struct platform_device *pdev)
int err; int err;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) mmio_base = devm_ioremap_resource(&pdev->dev, res);
return -ENXIO; if (IS_ERR(mmio_base))
return PTR_ERR(mmio_base);
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;
if (timeout < 1 || timeout > 3600) { if (timeout < 1 || timeout > 3600) {
timeout = WDT_TIMEOUT; timeout = WDT_TIMEOUT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment