mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-12-06 02:39:06 -05:00
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: George Cherian <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
This commit is contained in:
parent
37f152915f
commit
2cdf25bb57
1 changed files with 1 additions and 4 deletions
|
|
@ -230,10 +230,6 @@ static int sh_wdt_probe(struct platform_device *pdev)
|
|||
if (pdev->id != -1)
|
||||
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);
|
||||
if (unlikely(!wdt))
|
||||
return -ENOMEM;
|
||||
|
|
@ -249,6 +245,7 @@ static int sh_wdt_probe(struct platform_device *pdev)
|
|||
wdt->clk = NULL;
|
||||
}
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
wdt->base = devm_ioremap_resource(wdt->dev, res);
|
||||
if (IS_ERR(wdt->base))
|
||||
return PTR_ERR(wdt->base);
|
||||
|
|
|
|||
Loading…
Reference in a new issue