drivers/watchdog: don't check resource with devm_ioremap_resource
devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
ac066a5c1c
commit
937192a7cf
|
@ -248,11 +248,6 @@ static int ath79_wdt_probe(struct platform_device *pdev)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
if (!res) {
|
|
||||||
dev_err(&pdev->dev, "no memory resource found\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
wdt_base = devm_ioremap_resource(&pdev->dev, res);
|
wdt_base = devm_ioremap_resource(&pdev->dev, res);
|
||||||
if (IS_ERR(wdt_base))
|
if (IS_ERR(wdt_base))
|
||||||
return PTR_ERR(wdt_base);
|
return PTR_ERR(wdt_base);
|
||||||
|
|
|
@ -217,11 +217,6 @@ static int davinci_wdt_probe(struct platform_device *pdev)
|
||||||
dev_info(dev, "heartbeat %d sec\n", heartbeat);
|
dev_info(dev, "heartbeat %d sec\n", heartbeat);
|
||||||
|
|
||||||
wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
if (wdt_mem == NULL) {
|
|
||||||
dev_err(dev, "failed to get memory region resource\n");
|
|
||||||
return -ENOENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
wdt_base = devm_ioremap_resource(dev, wdt_mem);
|
wdt_base = devm_ioremap_resource(dev, wdt_mem);
|
||||||
if (IS_ERR(wdt_base))
|
if (IS_ERR(wdt_base))
|
||||||
return PTR_ERR(wdt_base);
|
return PTR_ERR(wdt_base);
|
||||||
|
|
|
@ -257,11 +257,6 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
if (!res) {
|
|
||||||
dev_err(&pdev->dev, "can't get device resources\n");
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
imx2_wdt.base = devm_ioremap_resource(&pdev->dev, res);
|
imx2_wdt.base = devm_ioremap_resource(&pdev->dev, res);
|
||||||
if (IS_ERR(imx2_wdt.base))
|
if (IS_ERR(imx2_wdt.base))
|
||||||
return PTR_ERR(imx2_wdt.base);
|
return PTR_ERR(imx2_wdt.base);
|
||||||
|
|
Loading…
Reference in New Issue