Skip to contentSkip to conversation

drm/mediatek: Use devm_platform_ioremap_resource()

PATCH Applied Yang Li 4 participants 10 messages Apr 12, 2023 – Dec 7, 2023

Subsystems (3)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/3 drm/mediatek: Use devm_platform_ioremap_resource()

Remove variable 'res' and convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does.

---
 drivers/gpu/drm/mediatek/mtk_cec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_cec.c +1 -3
index b640bc0559e7..03aae9f95606 100644
@@ -185,7 +185,6 @@ static int mtk_cec_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct mtk_cec *cec;
-	struct resource *res;
 	int ret;
 
 	cec = devm_kzalloc(dev, sizeof(*cec), GFP_KERNEL);
@@ -195,8 +194,7 @@ static int mtk_cec_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, cec);
 	spin_lock_init(&cec->lock);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	cec->regs = devm_ioremap_resource(dev, res);
+	cec->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(cec->regs)) {
 		ret = PTR_ERR(cec->regs);
 		dev_err(dev, "Failed to ioremap cec: %d\n", ret);
Signature · 1 line
2.20.1.7.g153144c
author
#1 lore raw

PATCH 2/3 drm/mediatek: Use devm_platform_ioremap_resource()

Remove variable 'res' and convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does.

---
 drivers/gpu/drm/mediatek/mtk_disp_aal.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_disp_aal.c +1 -3
index 434e8a9ce8ab..391fa0ece22c 100644
@@ -104,7 +104,6 @@ static int mtk_disp_aal_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct mtk_disp_aal *priv;
-	struct resource *res;
 	int ret;
 
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -117,8 +116,7 @@ static int mtk_disp_aal_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->clk);
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	priv->regs = devm_ioremap_resource(dev, res);
+	priv->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(priv->regs)) {
 		dev_err(dev, "failed to ioremap aal\n");
 		return PTR_ERR(priv->regs);
Signature · 1 line
2.20.1.7.g153144c
maintainer Reviewed-by on v1 2/3
#2 lore raw
Quoted 6 lines · Yang Li

Remove variable 'res' and convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does.

Quoted 26 lines
---
  drivers/gpu/drm/mediatek/mtk_disp_aal.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_disp_aal.c +1 -3
index 434e8a9ce8ab..391fa0ece22c 100644
@@ -104,7 +104,6 @@ static int mtk_disp_aal_probe(struct platform_device *pdev)
  {
  	struct device *dev = &pdev->dev;
  	struct mtk_disp_aal *priv;
-	struct resource *res;
  	int ret;
 
  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -117,8 +116,7 @@ static int mtk_disp_aal_probe(struct platform_device *pdev)
  		return PTR_ERR(priv->clk);
  	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	priv->regs = devm_ioremap_resource(dev, res);
+	priv->regs = devm_platform_ioremap_resource(pdev, 0);
  	if (IS_ERR(priv->regs)) {
  		dev_err(dev, "failed to ioremap aal\n");
  		return PTR_ERR(priv->regs);
author
#4 lore raw

PATCH 3/3 drm/mediatek: Use devm_platform_ioremap_resource()

In reply to Yang Li

Remove variable 'res' and convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does.

---
 drivers/gpu/drm/mediatek/mtk_disp_ccorr.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_disp_ccorr.c +1 -3
index 1773379b2439..5cee84cce0be 100644
@@ -159,7 +159,6 @@ static int mtk_disp_ccorr_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct mtk_disp_ccorr *priv;
-	struct resource *res;
 	int ret;
 
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -172,8 +171,7 @@ static int mtk_disp_ccorr_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->clk);
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	priv->regs = devm_ioremap_resource(dev, res);
+	priv->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(priv->regs)) {
 		dev_err(dev, "failed to ioremap ccorr\n");
 		return PTR_ERR(priv->regs);
Signature · 1 line
2.20.1.7.g153144c
maintainer Reviewed-by on v1 3/3
#5 lore raw
Quoted 6 lines · Yang Li

Remove variable 'res' and convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does.

Quoted 26 lines
---
  drivers/gpu/drm/mediatek/mtk_disp_ccorr.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_disp_ccorr.c +1 -3
index 1773379b2439..5cee84cce0be 100644
@@ -159,7 +159,6 @@ static int mtk_disp_ccorr_probe(struct platform_device *pdev)
  {
  	struct device *dev = &pdev->dev;
  	struct mtk_disp_ccorr *priv;
-	struct resource *res;
  	int ret;
 
  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -172,8 +171,7 @@ static int mtk_disp_ccorr_probe(struct platform_device *pdev)
  		return PTR_ERR(priv->clk);
  	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	priv->regs = devm_ioremap_resource(dev, res);
+	priv->regs = devm_platform_ioremap_resource(pdev, 0);
  	if (IS_ERR(priv->regs)) {
  		dev_err(dev, "failed to ioremap ccorr\n");
  		return PTR_ERR(priv->regs);
maintainer Applied
#7 lore raw

Hi, Yang:

Alexandre Mergnat <[email protected]> 於 2023年4月12日 週三 下午9:49寫道:

Quoted 11 lines · Yang Li
Quoted 6 lines

Remove variable 'res' and convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does.

Applied to mediatek-drm-next [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next

Regards,
Chun-Kuang.

Quoted 4 lines

--
Regards,
Alexandre

maintainer Reviewed-by on v1 1/3
#8 lore raw
In reply to Yang Li
Quoted 6 lines · Yang Li

Remove variable 'res' and convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does.

Quoted 26 lines
---
  drivers/gpu/drm/mediatek/mtk_cec.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_cec.c +1 -3
index b640bc0559e7..03aae9f95606 100644
@@ -185,7 +185,6 @@ static int mtk_cec_probe(struct platform_device *pdev)
  {
  	struct device *dev = &pdev->dev;
  	struct mtk_cec *cec;
-	struct resource *res;
  	int ret;
 
  	cec = devm_kzalloc(dev, sizeof(*cec), GFP_KERNEL);
@@ -195,8 +194,7 @@ static int mtk_cec_probe(struct platform_device *pdev)
  	platform_set_drvdata(pdev, cec);
  	spin_lock_init(&cec->lock);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	cec->regs = devm_ioremap_resource(dev, res);
+	cec->regs = devm_platform_ioremap_resource(pdev, 0);
  	if (IS_ERR(cec->regs)) {
  		ret = PTR_ERR(cec->regs);
  		dev_err(dev, "Failed to ioremap cec: %d\n", ret);