Skip to contentSkip to conversation

imx-drm: imx-tve: Remove unneeded check for platform_get_resource()

PATCH In review Fabio Estevam 2 participants 2 messages Jul 22, 2013

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 imx-drm: imx-tve: Remove unneeded check for platform_get_resource()

From: Fabio Estevam <[email protected]>

As devm_ioremap_resource() is used on probe, there is no need to explicitly check the return value from platform_get_resource(), as this is something that devm_ioremap_resource() takes care by itself.

---
 drivers/staging/imx-drm/imx-tve.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/staging/imx-drm/imx-tve.c +0 -5
index a56797d..8232cea 100644
@@ -623,11 +623,6 @@ static int imx_tve_probe(struct platform_device *pdev)
 	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "failed to get memory region\n");
-		return -ENOENT;
-	}
-
 	base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
Signature · 1 line
1.8.1.2
Acked-by on v1 1/1
#1 lore raw

Am Sonntag, den 21.07.2013, 22:19 -0300 schrieb Fabio Estevam:

Quoted 17 lines

From: Fabio Estevam <[email protected]>

As devm_ioremap_resource() is used on probe, there is no need to explicitly check the return value from platform_get_resource(), as this is something that devm_ioremap_resource() takes care by itself.

---
 drivers/staging/imx-drm/imx-tve.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/staging/imx-drm/imx-tve.c +0 -0
index a56797d..8232cea 100644
@@ -623,11 +623,6 @@ static int imx_tve_probe(struct platform_device *pdev)
 	}

drivers/staging/imx-drm/imx-tve.c static int imx_tve_probe(struct platform_device *pdev) · line 628

Quoted 10 lines
drivers/staging/imx-drm/imx-tve.c +0 -5
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "failed to get memory region\n");
-		return -ENOENT;
-	}
-
 	base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(base))
 		return PTR_ERR(base);

regards
Philipp