“e4da3fbfbd1de56d2367653e3823e6445e49f8a9”上不存在“...include/git@gitcode.net:openeuler/raspberrypi-kernel.git”
提交 2cdf25bb 编写于 作者: G George Cherian 提交者: Wim Van Sebroeck

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: NGeorge Cherian <george.cherian@ti.com>
Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
上级 37f15291
...@@ -230,10 +230,6 @@ static int sh_wdt_probe(struct platform_device *pdev) ...@@ -230,10 +230,6 @@ static int sh_wdt_probe(struct platform_device *pdev)
if (pdev->id != -1) if (pdev->id != -1)
return -EINVAL; return -EINVAL;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (unlikely(!res))
return -EINVAL;
wdt = devm_kzalloc(&pdev->dev, sizeof(struct sh_wdt), GFP_KERNEL); wdt = devm_kzalloc(&pdev->dev, sizeof(struct sh_wdt), GFP_KERNEL);
if (unlikely(!wdt)) if (unlikely(!wdt))
return -ENOMEM; return -ENOMEM;
...@@ -249,6 +245,7 @@ static int sh_wdt_probe(struct platform_device *pdev) ...@@ -249,6 +245,7 @@ static int sh_wdt_probe(struct platform_device *pdev)
wdt->clk = NULL; wdt->clk = NULL;
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
wdt->base = devm_ioremap_resource(wdt->dev, res); wdt->base = devm_ioremap_resource(wdt->dev, res);
if (IS_ERR(wdt->base)) if (IS_ERR(wdt->base))
return PTR_ERR(wdt->base); return PTR_ERR(wdt->base);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册