Skip to contentSkip to conversation

drm/bridge/synopsys: dsi: Remove unnecessary platform_get_resource() error check

PATCH In review Fabio Estevam 5 participants 14 messages Dec 18, 2017 – Dec 19, 2017

Subsystems (11)
lore
Share & tools
lore
#0 lore raw

PATCH 1/7 drm/bridge/synopsys: dsi: Remove unnecessary platform_get_resource() error check

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check.

---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +0 -3
index d9cca4f..5db4cbb 100644
@@ -860,9 +860,6 @@ __dw_mipi_dsi_probe(struct platform_device *pdev,
 
 	if (!plat_data->base) {
 		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-		if (!res)
-			return ERR_PTR(-ENODEV);
-
 		dsi->base = devm_ioremap_resource(dev, res);
 		if (IS_ERR(dsi->base))
 			return ERR_PTR(-ENODEV);
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/7 drm/exynos: decon5433: Remove unnecessary platform_get_resource() error check

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check.

---
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/exynos/exynos5433_drm_decon.c +0 -5
index 6be5b53..1d509a8 100644
@@ -744,11 +744,6 @@ static int exynos5433_decon_probe(struct platform_device *pdev)
 	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "cannot find IO resource\n");
-		return -ENXIO;
-	}
-
 	ctx->addr = devm_ioremap_resource(dev, res);
 	if (IS_ERR(ctx->addr)) {
 		dev_err(dev, "ioremap failed\n");
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

PATCH 3/7 drm/rockchip: dsi: Remove unnecessary platform_get_resource() error check

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check.

---
 drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/rockchip/dw-mipi-dsi.c +0 -3
index b1fe063..591953c 100644
@@ -1202,9 +1202,6 @@ static int dw_mipi_dsi_bind(struct device *dev, struct device *master,
 		return ret;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -ENODEV;
-
 	dsi->base = devm_ioremap_resource(dev, res);
 	if (IS_ERR(dsi->base))
 		return PTR_ERR(dsi->base);
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

PATCH 4/7 drm/rockchip: inno_hdmi: Remove unnecessary platform_get_resource() error check

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check.

---
 drivers/gpu/drm/rockchip/inno_hdmi.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/rockchip/inno_hdmi.c +0 -3
index fab30927..f6ad487 100644
@@ -831,9 +831,6 @@ static int inno_hdmi_bind(struct device *dev, struct device *master,
 	hdmi->drm_dev = drm;
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!iores)
-		return -ENXIO;
-
 	hdmi->regs = devm_ioremap_resource(dev, iores);
 	if (IS_ERR(hdmi->regs))
 		return PTR_ERR(hdmi->regs);
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

PATCH 5/7 drm/stm: dsi: Remove unnecessary platform_get_resource() error check

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check.

---
 drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c +0 -5
index 82dcb20..fd02506 100644
@@ -290,11 +290,6 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		DRM_ERROR("Unable to get resource\n");
-		return -ENODEV;
-	}
-
 	dsi->base = devm_ioremap_resource(dev, res);
 	if (IS_ERR(dsi->base)) {
 		DRM_ERROR("Unable to get dsi registers\n");
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#9 lore raw

PATCH 6/7 drm/stm: ltdc: Remove unnecessary platform_get_resource() error check

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check.

---
 drivers/gpu/drm/stm/ltdc.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/gpu/drm/stm/ltdc.c +0 -6
index 394613b..6dc5d4e 100644
@@ -901,12 +901,6 @@ int ltdc_load(struct drm_device *ddev)
 	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		DRM_ERROR("Unable to get resource\n");
-		ret = -ENODEV;
-		goto err;
-	}
-
 	ldev->regs = devm_ioremap_resource(dev, res);
 	if (IS_ERR(ldev->regs)) {
 		DRM_ERROR("Unable to get ltdc registers\n");
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#12 lore raw

PATCH 7/7 drm/tegra: vic: Remove unnecessary platform_get_resource() error check

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check.

---
 drivers/gpu/drm/tegra/vic.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/tegra/vic.c +0 -5
index f5794dd..088a795 100644
@@ -304,11 +304,6 @@ static int vic_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!regs) {
-		dev_err(&pdev->dev, "failed to get registers\n");
-		return -ENXIO;
-	}
-
 	vic->regs = devm_ioremap_resource(dev, regs);
 	if (IS_ERR(vic->regs))
 		return PTR_ERR(vic->regs);
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 2/7
#2 lore raw

Re: [PATCH 2/7] drm/exynos: decon5433: Remove unnecessary platform_get_resource() error check

In reply to Fabio Estevam
Quoted 7 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check.

 --
Regards
Andrzej

Quoted 10 lines
---
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/exynos/exynos5433_drm_decon.c +0 -0
index 6be5b53..1d509a8 100644
@@ -744,11 +744,6 @@ static int exynos5433_decon_probe(struct platform_device *pdev)
 	}

drivers/gpu/drm/exynos/exynos5433_drm_decon.c static int exynos5433_decon_probe(struct platform_device *pdev) · line 749

Quoted 10 lines
drivers/gpu/drm/exynos/exynos5433_drm_decon.c +0 -5
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "cannot find IO resource\n");
-		return -ENXIO;
-	}
-
 	ctx->addr = devm_ioremap_resource(dev, res);
 	if (IS_ERR(ctx->addr)) {
 		dev_err(dev, "ioremap failed\n");

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#3 lore raw

Re: [PATCH 2/7] drm/exynos: decon5433: Remove unnecessary platform_get_resource() error check

In reply to Fabio Estevam

2017년 12월 18일 22:02에 Fabio Estevam 이(가) 쓴 글:

Quoted 16 lines

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check.

---
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/exynos/exynos5433_drm_decon.c +0 -0
index 6be5b53..1d509a8 100644

drivers/gpu/drm/exynos/exynos5433_drm_decon.c static int exynos5433_decon_probe(struct platform_device *pdev) · line 751

Quoted 8 lines
drivers/gpu/drm/exynos/exynos5433_drm_decon.c +0 -5
@@ -744,11 +744,6 @@ static int exynos5433_decon_probe(struct platform_device *pdev)
 	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "cannot find IO resource\n");
-		return -ENXIO;
-	}
-

Picked it up.

Thanks,
Inki Dae

drivers/gpu/drm/exynos/exynos5433_drm_decon.c static int exynos5433_decon_probe(struct platform_device *pdev) · line 749

Quoted 4 lines
drivers/gpu/drm/exynos/exynos5433_drm_decon.c +0 -0
 	ctx->addr = devm_ioremap_resource(dev, res);
 	if (IS_ERR(ctx->addr)) {
 		dev_err(dev, "ioremap failed\n");

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v1 5/7
#7 lore raw

Re: [PATCH 5/7] drm/stm: dsi: Remove unnecessary platform_get_resource() error check

In reply to Fabio Estevam

Dear Fabio,

Quoted 16 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check.

---
  drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 5 -----
  1 file changed, 5 deletions(-)
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c +0 -0
index 82dcb20..fd02506 100644

drivers/gpu/drm/stm/dw_mipi_dsi-stm.c static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) · line 297

Quoted 8 lines
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c +0 -5
@@ -290,11 +290,6 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
  		return -ENOMEM;
 
  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		DRM_ERROR("Unable to get resource\n");
-		return -ENODEV;
-	}
-

Many thanks for this cleanup.

Philippe :-)

drivers/gpu/drm/stm/dw_mipi_dsi-stm.c static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) · line 295

Quoted 4 lines
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c +0 -0
  	dsi->base = devm_ioremap_resource(dev, res);
  	if (IS_ERR(dsi->base)) {
  		DRM_ERROR("Unable to get dsi registers\n");

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v1 6/7
#10 lore raw

Re: [PATCH 6/7] drm/stm: ltdc: Remove unnecessary platform_get_resource() error check

In reply to Fabio Estevam

Hi Fabio,

Quoted 16 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check.

---
  drivers/gpu/drm/stm/ltdc.c | 6 ------
  1 file changed, 6 deletions(-)
drivers/gpu/drm/stm/ltdc.c +0 -0
index 394613b..6dc5d4e 100644

drivers/gpu/drm/stm/ltdc.c int ltdc_load(struct drm_device *ddev) · line 909

Quoted 9 lines
drivers/gpu/drm/stm/ltdc.c +0 -6
@@ -901,12 +901,6 @@ int ltdc_load(struct drm_device *ddev)
  	}
 
  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		DRM_ERROR("Unable to get resource\n");
-		ret = -ENODEV;
-		goto err;
-	}
-

Many thanks for this cleanup.

Philippe :-)

drivers/gpu/drm/stm/ltdc.c int ltdc_load(struct drm_device *ddev) · line 906

Quoted 4 lines
drivers/gpu/drm/stm/ltdc.c +0 -0
  	ldev->regs = devm_ioremap_resource(dev, res);
  	if (IS_ERR(ldev->regs)) {
  		DRM_ERROR("Unable to get ltdc registers\n");

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

Re: [PATCH 5/7] drm/stm: dsi: Remove unnecessary platform_get_resource() error check

In reply to Philippe CORNU

2017-12-19 15:14 GMT+01:00 Philippe CORNU <[email protected]>:

Quoted 30 lines

Dear Fabio,

Quoted 16 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check.

---
  drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 5 -----
  1 file changed, 5 deletions(-)
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c +0 -0
index 82dcb20..fd02506 100644

drivers/gpu/drm/stm/dw_mipi_dsi-stm.c static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) · line 297

Quoted 8 lines
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c +0 -5
@@ -290,11 +290,6 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
              return -ENOMEM;
 
      res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-     if (!res) {
-             DRM_ERROR("Unable to get resource\n");
-             return -ENODEV;
-     }
-

Many thanks for this cleanup.

Quoted 1 line

Applied on drm-misc-next,

Thanks,
Benjamin

Quoted 11 lines

Philippe :-)

drivers/gpu/drm/stm/dw_mipi_dsi-stm.c static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) · line 295

Quoted 4 lines
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c +0 -0
      dsi->base = devm_ioremap_resource(dev, res);
      if (IS_ERR(dsi->base)) {
              DRM_ERROR("Unable to get dsi registers\n");

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw

Re: [PATCH 6/7] drm/stm: ltdc: Remove unnecessary platform_get_resource() error check

In reply to Philippe CORNU

2017-12-19 15:15 GMT+01:00 Philippe CORNU <[email protected]>:

Quoted 32 lines

Hi Fabio,

Quoted 16 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check.

---
  drivers/gpu/drm/stm/ltdc.c | 6 ------
  1 file changed, 6 deletions(-)
drivers/gpu/drm/stm/ltdc.c +0 -0
index 394613b..6dc5d4e 100644

drivers/gpu/drm/stm/ltdc.c int ltdc_load(struct drm_device *ddev) · line 909

Quoted 9 lines
drivers/gpu/drm/stm/ltdc.c +0 -6
@@ -901,12 +901,6 @@ int ltdc_load(struct drm_device *ddev)
      }
 
      res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-     if (!res) {
-             DRM_ERROR("Unable to get resource\n");
-             ret = -ENODEV;
-             goto err;
-     }
-

Many thanks for this cleanup.

Quoted 1 line

Applied on drm-misc-next,

Thanks,
Benjamin

Quoted 10 lines

Philippe :-)

drivers/gpu/drm/stm/ltdc.c int ltdc_load(struct drm_device *ddev) · line 906

Quoted 4 lines
drivers/gpu/drm/stm/ltdc.c +0 -0
      ldev->regs = devm_ioremap_resource(dev, res);
      if (IS_ERR(ldev->regs)) {
              DRM_ERROR("Unable to get ltdc registers\n");

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 1/7
#13 lore raw
In reply to Fabio Estevam

Dear Fabio,

Quoted 16 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check.

---
  drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +0 -0
index d9cca4f..5db4cbb 100644

drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c __dw_mipi_dsi_probe(struct platform_device *pdev, · line 865

Quoted 6 lines
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +0 -3
@@ -860,9 +860,6 @@ __dw_mipi_dsi_probe(struct platform_device *pdev,
 
  	if (!plat_data->base) {
  		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-		if (!res)
-			return ERR_PTR(-ENODEV);
-

Many thanks for this cleanup.

Philippe :-)

drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c __dw_mipi_dsi_probe(struct platform_device *pdev, · line 865

Quoted 4 lines
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +0 -0
  		dsi->base = devm_ioremap_resource(dev, res);
  		if (IS_ERR(dsi->base))
  			return ERR_PTR(-ENODEV);

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel