Skip to contentSkip to conversation

mfd: ipaq-micro: Delete redundant return value check of platform_get_resource()

PATCH Applied Belen Sarabia 2 participants 2 messages Mar 25, 2017 – Mar 27, 2017 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mfd: ipaq-micro: Delete redundant return value check of platform_get_resource()

devm_ioremap_resource does checks on the resource. No need to duplicate this in the driver.

---
Changes in v2:
- Subject line expected by the subsystem.
- Remove one line more.

---
 drivers/mfd/ipaq-micro.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/mfd/ipaq-micro.c +0 -3
index df16fd1..124aad2 100644
@@ -400,9 +400,6 @@ static int __init micro_probe(struct platform_device *pdev)
 	micro->dev = &pdev->dev;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -EINVAL;
-
 	micro->base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(micro->base))
 		return PTR_ERR(micro->base);
Signature · 1 line
1.9.1
Applied
#1 lore raw
Quoted 11 lines · Belen Sarabia

devm_ioremap_resource does checks on the resource. No need to duplicate this in the driver.

---
Changes in v2:
- Subject line expected by the subsystem.
- Remove one line more.

---
 drivers/mfd/ipaq-micro.c | 3 ---
 1 file changed, 3 deletions(-)

Applied, thanks.

Quoted 14 lines
drivers/mfd/ipaq-micro.c +0 -3
index df16fd1..124aad2 100644
@@ -400,9 +400,6 @@ static int __init micro_probe(struct platform_device *pdev)
 	micro->dev = &pdev->dev;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -EINVAL;
-
 	micro->base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(micro->base))
 		return PTR_ERR(micro->base);
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog