mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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 <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
This commit is contained in:
parent
a17fb5cbee
commit
4f6120b014
1 changed files with 3 additions and 10 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue