Skip to contentSkip to conversation

drm/fsl-dcu: Remove unneeded NULL check

PATCH Applied Fabio Estevam 2 participants 3 messages Nov 16, 2016 – Nov 29, 2016

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

PATCH 1/2 drm/fsl-dcu: Remove unneeded NULL check

devm_ioremap_resource() performs NULL check for the 'res' argument, so remove the unneeded check.

---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -5
index 0b0d1cb..812a211 100644
@@ -336,11 +336,6 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
 	fsl_dev->soc = id->data;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "could not get memory IO resource\n");
-		return -ENODEV;
-	}
-
 	base = devm_ioremap_resource(dev, res);
 	if (IS_ERR(base)) {
 		ret = PTR_ERR(base);
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/2 drm/fsl-dcu: Propagate the real error code

In case of platform_get_irq() failure, let's propagate the real error code, instead of a 'fake' one.

---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1 -1
index 812a211..143e639 100644
@@ -345,7 +345,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
 	fsl_dev->irq = platform_get_irq(pdev, 0);
 	if (fsl_dev->irq < 0) {
 		dev_err(dev, "failed to get irq\n");
-		return -ENXIO;
+		return fsl_dev->irq;
 	}
 
 	fsl_dev->regmap = devm_regmap_init_mmio(dev, base,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Applied
#2 lore raw
In reply to Fabio Estevam
Quoted 15 lines · Fabio Estevam

devm_ioremap_resource() performs NULL check for the 'res' argument, so remove the unneeded check.

---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -0
index 0b0d1cb..812a211 100644
@@ -336,11 +336,6 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
 	fsl_dev->soc = id->data;

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_probe(struct platform_device *pdev) · line 341

Quoted 10 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -5
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "could not get memory IO resource\n");
-		return -ENODEV;
-	}
-
 	base = devm_ioremap_resource(dev, res);
 	if (IS_ERR(base)) {
 		ret = PTR_ERR(base);

Applied both to my for-next branch, thanks!

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