Skip to contentSkip to conversation

drm/bridge: th1520-dw-hdmi: Two fixes

PATCH Applied Felix Gu 4 participants 9 messages Mar 20 – Sep 28

Subsystems (6)
lore
Share & tools
lore

Felix Gu

author
#0 lore raw

cover drm/bridge: th1520-dw-hdmi: Two fixes

---
Felix Gu (2):
drm/bridge: th1520-dw-hdmi: Fix error check on dw_hdmi_probe() return value drm/bridge: th1520-dw-hdmi: Fix remove() callback

 drivers/gpu/drm/bridge/th1520-dw-hdmi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

---
base-commit: b5d083a3ed1e2798396d5e491432e887da8d4a06
change-id: 20260321-th1520-f4326138c9bf

Best regards,

Signature · 1 line
Felix Gu <[email protected]>
author
#1 lore raw

PATCH 1/2 drm/bridge: th1520-dw-hdmi: Fix error check on dw_hdmi_probe() return value

The error check after calling dw_hdmi_probe() was incorrectly checking the struct pointer hdmi instead of the probe result hdmi->dw_hdmi.

Fix this by checking the correct variable.

Fixes 96f30ee0fb9d ("drm/bridge: add a driver for T-Head TH1520 HDMI controller")
---
 drivers/gpu/drm/bridge/th1520-dw-hdmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/th1520-dw-hdmi.c +2 -2
index 389eead5f1c4..c9968ec1823c 100644
@@ -136,8 +136,8 @@ static int th1520_dw_hdmi_probe(struct platform_device *pdev)
 	plat_data->priv_data = hdmi;
 
 	hdmi->dw_hdmi = dw_hdmi_probe(pdev, plat_data);
-	if (IS_ERR(hdmi))
-		return PTR_ERR(hdmi);
+	if (IS_ERR(hdmi->dw_hdmi))
+		return PTR_ERR(hdmi->dw_hdmi);
 
 	platform_set_drvdata(pdev, hdmi);
 
Signature · 1 line
2.43.0
author
#3 lore raw

PATCH 2/2 drm/bridge: th1520-dw-hdmi: Fix remove() callback

In reply to Felix Gu

This driver stores struct th1520_hdmi * in platform drvdata, but th1520_dw_hdmi_remove() was reading it back as struct dw_hdmi * and passing it to dw_hdmi_remove(), so teardown runs on the wrong pointer.

Retrieve struct th1520_hdmi * from platform drvdata and pass hdmi->dw_hdmi to dw_hdmi_remove().

Fixes 96f30ee0fb9d ("drm/bridge: add a driver for T-Head TH1520 HDMI controller")
---
 drivers/gpu/drm/bridge/th1520-dw-hdmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/th1520-dw-hdmi.c +2 -2
index c9968ec1823c..6ec9003a8f3f 100644
@@ -146,9 +146,9 @@ static int th1520_dw_hdmi_probe(struct platform_device *pdev)
 
 static void th1520_dw_hdmi_remove(struct platform_device *pdev)
 {
-	struct dw_hdmi *hdmi = platform_get_drvdata(pdev);
+	struct th1520_hdmi *hdmi = platform_get_drvdata(pdev);
 
-	dw_hdmi_remove(hdmi);
+	dw_hdmi_remove(hdmi->dw_hdmi);
 }
 
 static const struct of_device_id th1520_dw_hdmi_of_table[] = {
Signature · 1 line
2.43.0
Reviewed-by on the v1 series
#5 lore raw
In reply to Felix Gu
Quoted 6 lines · 在 2026-03-21六的 03:12 +0800,Felix Gu写道:

---
Felix Gu (2):
      drm/bridge: th1520-dw-hdmi: Fix error check on dw_hdmi_probe() return value
      drm/bridge: th1520-dw-hdmi: Fix remove() callback

Both fixes look trivial and let me start to doubt how could I make such mistakes.

Quoted 8 lines

 drivers/gpu/drm/bridge/th1520-dw-hdmi.c | 8 ++++----

 1 file changed, 4 insertions(+), 4 deletions(-)

---
base-commit: b5d083a3ed1e2798396d5e491432e887da8d4a06
change-id: 20260321-th1520-f4326138c9bf

Best regards,

Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] drm/bridge: th1520-dw-hdmi: Fix error check on dw_hdmi_probe() return value

In reply to Felix Gu
Quoted 11 lines · Felix Gu

The error check after calling dw_hdmi_probe() was incorrectly checking the struct pointer hdmi instead of the probe result hdmi->dw_hdmi.

Fix this by checking the correct variable.

Fixes 96f30ee0fb9d ("drm/bridge: add a driver for T-Head TH1520 HDMI controller")
---
 drivers/gpu/drm/bridge/th1520-dw-hdmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] drm/bridge: th1520-dw-hdmi: Fix remove() callback

In reply to Felix Gu
Quoted 5 lines · Felix Gu

This driver stores struct th1520_hdmi * in platform drvdata, but th1520_dw_hdmi_remove() was reading it back as struct dw_hdmi * and passing it to dw_hdmi_remove(), so teardown runs on the wrong pointer.

Quoted 9 lines

Retrieve struct th1520_hdmi * from platform drvdata and pass hdmi->dw_hdmi to dw_hdmi_remove().

Fixes 96f30ee0fb9d ("drm/bridge: add a driver for T-Head TH1520 HDMI controller")
---
 drivers/gpu/drm/bridge/th1520-dw-hdmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
author
#6 lore raw
In reply to Icenowy Zheng
Quoted 9 lines · Icenowy Zheng
Quoted 6 lines · 在 2026-03-21六的 03:12 +0800,Felix Gu写道:

---
Felix Gu (2):
drm/bridge: th1520-dw-hdmi: Fix error check on dw_hdmi_probe()
return value
drm/bridge: th1520-dw-hdmi: Fix remove() callback

Quoted 5 lines

Both fixes look trivial and let me start to doubt how could I make such mistakes.

Hi,
Gentle ping on this.

Best regards,
Felix

#7 lore raw
In reply to Felix Gu
Quoted 1 line · 在 2026-03-21六的 03:12 +0800,Felix Gu写道:

Sorry for forgetting this patchset. I'm going to apply it.

This patchset should be now:

Thanks,
Icenowy

Quoted 13 lines

---
Felix Gu (2):
      drm/bridge: th1520-dw-hdmi: Fix error check on dw_hdmi_probe() return value
      drm/bridge: th1520-dw-hdmi: Fix remove() callback

 drivers/gpu/drm/bridge/th1520-dw-hdmi.c | 8 ++++----

 1 file changed, 4 insertions(+), 4 deletions(-)

---
base-commit: b5d083a3ed1e2798396d5e491432e887da8d4a06
change-id: 20260321-th1520-f4326138c9bf

Best regards,

#8 lore raw
In reply to Felix Gu
Quoted 1 line · 在 2026-03-21六的 03:12 +0800,Felix Gu写道:

Applied to drm-misc-fixes.

Thanks,
Icenowy

Quoted 13 lines

---
Felix Gu (2):
      drm/bridge: th1520-dw-hdmi: Fix error check on dw_hdmi_probe() return value
      drm/bridge: th1520-dw-hdmi: Fix remove() callback

 drivers/gpu/drm/bridge/th1520-dw-hdmi.c | 8 ++++----

 1 file changed, 4 insertions(+), 4 deletions(-)

---
base-commit: b5d083a3ed1e2798396d5e491432e887da8d4a06
change-id: 20260321-th1520-f4326138c9bf

Best regards,