linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 05/19] drm/tegra: hdmi: Convert to devm_platform_ioremap_resource()
       [not found] <20230710032355.72914-1-frank.li@vivo.com>
@ 2023-07-10  3:23 ` Yangtao Li
  2023-07-10  3:23 ` [PATCH v2 12/19] drm/tegra: dpaux: " Yangtao Li
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: Yangtao Li @ 2023-07-10  3:23 UTC (permalink / raw)
  To: Thierry Reding, Mikko Perttunen, David Airlie, Daniel Vetter,
	Jonathan Hunter
  Cc: Yangtao Li, dri-devel, linux-tegra, linux-kernel

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/gpu/drm/tegra/hdmi.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index 6eac54ae1205..f3a44ca87151 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -1769,7 +1769,6 @@ static irqreturn_t tegra_hdmi_irq(int irq, void *data)
 static int tegra_hdmi_probe(struct platform_device *pdev)
 {
 	struct tegra_hdmi *hdmi;
-	struct resource *regs;
 	int err;
 
 	hdmi = devm_kzalloc(&pdev->dev, sizeof(*hdmi), GFP_KERNEL);
@@ -1831,8 +1830,7 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
 	if (err < 0)
 		return err;
 
-	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	hdmi->regs = devm_ioremap_resource(&pdev->dev, regs);
+	hdmi->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(hdmi->regs))
 		return PTR_ERR(hdmi->regs);
 
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 12/19] drm/tegra: dpaux: Convert to devm_platform_ioremap_resource()
       [not found] <20230710032355.72914-1-frank.li@vivo.com>
  2023-07-10  3:23 ` [PATCH v2 05/19] drm/tegra: hdmi: Convert to devm_platform_ioremap_resource() Yangtao Li
@ 2023-07-10  3:23 ` Yangtao Li
  2023-07-10  3:23 ` [PATCH v2 13/19] drm/tegra: dpaux: Fix incorrect return value of platform_get_irq Yangtao Li
  2023-07-10  3:23 ` [PATCH v2 16/19] drm/tegra: sor: Convert to devm_platform_ioremap_resource() Yangtao Li
  3 siblings, 0 replies; 4+ messages in thread
From: Yangtao Li @ 2023-07-10  3:23 UTC (permalink / raw)
  To: Thierry Reding, Mikko Perttunen, David Airlie, Daniel Vetter,
	Jonathan Hunter
  Cc: Yangtao Li, dri-devel, linux-tegra, linux-kernel

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/gpu/drm/tegra/dpaux.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c
index 4d2677dcd831..4699def04190 100644
--- a/drivers/gpu/drm/tegra/dpaux.c
+++ b/drivers/gpu/drm/tegra/dpaux.c
@@ -447,7 +447,6 @@ static const struct pinmux_ops tegra_dpaux_pinmux_ops = {
 static int tegra_dpaux_probe(struct platform_device *pdev)
 {
 	struct tegra_dpaux *dpaux;
-	struct resource *regs;
 	u32 value;
 	int err;
 
@@ -461,8 +460,7 @@ static int tegra_dpaux_probe(struct platform_device *pdev)
 	INIT_LIST_HEAD(&dpaux->list);
 	dpaux->dev = &pdev->dev;
 
-	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	dpaux->regs = devm_ioremap_resource(&pdev->dev, regs);
+	dpaux->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(dpaux->regs))
 		return PTR_ERR(dpaux->regs);
 
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 13/19] drm/tegra: dpaux: Fix incorrect return value of platform_get_irq
       [not found] <20230710032355.72914-1-frank.li@vivo.com>
  2023-07-10  3:23 ` [PATCH v2 05/19] drm/tegra: hdmi: Convert to devm_platform_ioremap_resource() Yangtao Li
  2023-07-10  3:23 ` [PATCH v2 12/19] drm/tegra: dpaux: " Yangtao Li
@ 2023-07-10  3:23 ` Yangtao Li
  2023-07-10  3:23 ` [PATCH v2 16/19] drm/tegra: sor: Convert to devm_platform_ioremap_resource() Yangtao Li
  3 siblings, 0 replies; 4+ messages in thread
From: Yangtao Li @ 2023-07-10  3:23 UTC (permalink / raw)
  To: Thierry Reding, Mikko Perttunen, David Airlie, Daniel Vetter,
	Jonathan Hunter
  Cc: Yangtao Li, Thierry Reding, dri-devel, linux-tegra, linux-kernel

When platform_get_irq fails, we should return dpaux->irq
instead of -ENXIO.

Fixes: 6b6b604215c6 ("drm/tegra: Add eDP support")
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/gpu/drm/tegra/dpaux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c
index 4699def04190..f120897ce4b3 100644
--- a/drivers/gpu/drm/tegra/dpaux.c
+++ b/drivers/gpu/drm/tegra/dpaux.c
@@ -466,7 +466,7 @@ static int tegra_dpaux_probe(struct platform_device *pdev)
 
 	dpaux->irq = platform_get_irq(pdev, 0);
 	if (dpaux->irq < 0)
-		return -ENXIO;
+		return dpaux->irq;
 
 	if (!pdev->dev.pm_domain) {
 		dpaux->rst = devm_reset_control_get(&pdev->dev, "dpaux");
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 16/19] drm/tegra: sor: Convert to devm_platform_ioremap_resource()
       [not found] <20230710032355.72914-1-frank.li@vivo.com>
                   ` (2 preceding siblings ...)
  2023-07-10  3:23 ` [PATCH v2 13/19] drm/tegra: dpaux: Fix incorrect return value of platform_get_irq Yangtao Li
@ 2023-07-10  3:23 ` Yangtao Li
  3 siblings, 0 replies; 4+ messages in thread
From: Yangtao Li @ 2023-07-10  3:23 UTC (permalink / raw)
  To: Thierry Reding, Mikko Perttunen, David Airlie, Daniel Vetter,
	Jonathan Hunter
  Cc: Yangtao Li, dri-devel, linux-tegra, linux-kernel

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/gpu/drm/tegra/sor.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index abd6e3b92293..f23d54626883 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -3708,7 +3708,6 @@ static int tegra_sor_probe(struct platform_device *pdev)
 {
 	struct device_node *np;
 	struct tegra_sor *sor;
-	struct resource *regs;
 	int err;
 
 	sor = devm_kzalloc(&pdev->dev, sizeof(*sor), GFP_KERNEL);
@@ -3781,8 +3780,7 @@ static int tegra_sor_probe(struct platform_device *pdev)
 		}
 	}
 
-	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	sor->regs = devm_ioremap_resource(&pdev->dev, regs);
+	sor->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(sor->regs)) {
 		err = PTR_ERR(sor->regs);
 		goto remove;
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-10  3:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230710032355.72914-1-frank.li@vivo.com>
2023-07-10  3:23 ` [PATCH v2 05/19] drm/tegra: hdmi: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-10  3:23 ` [PATCH v2 12/19] drm/tegra: dpaux: " Yangtao Li
2023-07-10  3:23 ` [PATCH v2 13/19] drm/tegra: dpaux: Fix incorrect return value of platform_get_irq Yangtao Li
2023-07-10  3:23 ` [PATCH v2 16/19] drm/tegra: sor: Convert to devm_platform_ioremap_resource() Yangtao Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).