linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH next] drm/panel: jdi-lpm102a188a: Fix error code in jdi_panel_prepare()
@ 2025-08-21 12:30 Dan Carpenter
  2025-08-21 14:50 ` Doug Anderson
  2025-08-24 18:54 ` Brigham Campbell
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2025-08-21 12:30 UTC (permalink / raw)
  To: Brigham Campbell
  Cc: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Douglas Anderson,
	Diogo Ivo, dri-devel, linux-kernel, kernel-janitors

If the mipi_dsi_dual() macro fails, the error code is stored in
dsi_ctx.accum_err.  Propagate that error back to the caller instead
of returning success as the current code does.

Fixes: a6adf47d30cc ("drm/panel: jdi-lpm102a188a: Fix bug and clean up driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c b/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
index 83656bb4b0b2..23462065d726 100644
--- a/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
+++ b/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
@@ -233,8 +233,10 @@ static int jdi_panel_prepare(struct drm_panel *panel)
 	mipi_dsi_dual(mipi_dsi_dcs_set_display_on_multi,
 		      &dsi_ctx, jdi->link1, jdi->link2);
 
-	if (dsi_ctx.accum_err < 0)
+	if (dsi_ctx.accum_err < 0) {
+		err = dsi_ctx.accum_err;
 		goto poweroff;
+	}
 
 	jdi->link1->mode_flags &= ~MIPI_DSI_MODE_LPM;
 	jdi->link2->mode_flags &= ~MIPI_DSI_MODE_LPM;
-- 
2.47.2


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

* Re: [PATCH next] drm/panel: jdi-lpm102a188a: Fix error code in jdi_panel_prepare()
  2025-08-21 12:30 [PATCH next] drm/panel: jdi-lpm102a188a: Fix error code in jdi_panel_prepare() Dan Carpenter
@ 2025-08-21 14:50 ` Doug Anderson
  2025-08-24 18:54 ` Brigham Campbell
  1 sibling, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2025-08-21 14:50 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Brigham Campbell, Neil Armstrong, Jessica Zhang,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Diogo Ivo, dri-devel, linux-kernel,
	kernel-janitors

Hi,

On Thu, Aug 21, 2025 at 5:31 AM Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> If the mipi_dsi_dual() macro fails, the error code is stored in
> dsi_ctx.accum_err.  Propagate that error back to the caller instead
> of returning success as the current code does.
>
> Fixes: a6adf47d30cc ("drm/panel: jdi-lpm102a188a: Fix bug and clean up driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Thanks for the fix.

Reviewed-by: Douglas Anderson <dianders@chromium.org>

Since it's straightforward and a fix, I'm not waiting and I'm pushing
to drm-misc-next.

[1/1] drm/panel: jdi-lpm102a188a: Fix error code in jdi_panel_prepare()
      commit: 61ce50fd8196c8782b9620bb60d33649ec429f64

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

* Re: [PATCH next] drm/panel: jdi-lpm102a188a: Fix error code in jdi_panel_prepare()
  2025-08-21 12:30 [PATCH next] drm/panel: jdi-lpm102a188a: Fix error code in jdi_panel_prepare() Dan Carpenter
  2025-08-21 14:50 ` Doug Anderson
@ 2025-08-24 18:54 ` Brigham Campbell
  2025-08-25  5:50   ` Dan Carpenter
  1 sibling, 1 reply; 5+ messages in thread
From: Brigham Campbell @ 2025-08-24 18:54 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Douglas Anderson,
	Diogo Ivo, dri-devel, linux-kernel, kernel-janitors, dri-devel

On Thu Aug 21, 2025 at 6:30 AM MDT, Dan Carpenter wrote:
> If the mipi_dsi_dual() macro fails, the error code is stored in
> dsi_ctx.accum_err.  Propagate that error back to the caller instead
> of returning success as the current code does.
>
> Fixes: a6adf47d30cc ("drm/panel: jdi-lpm102a188a: Fix bug and clean up driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Good catch, Dan! Thank you for the patch. I'll try to be mindful of this
kind of logic error in the future. Please let me know if you have other
suggestions.

Reviewed-by: Brigham Campbell <me@brighamcampbell.com>

Regards,
Brigham

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

* Re: [PATCH next] drm/panel: jdi-lpm102a188a: Fix error code in jdi_panel_prepare()
  2025-08-24 18:54 ` Brigham Campbell
@ 2025-08-25  5:50   ` Dan Carpenter
  2025-08-25 17:12     ` Brigham Campbell
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2025-08-25  5:50 UTC (permalink / raw)
  To: Brigham Campbell
  Cc: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Douglas Anderson,
	Diogo Ivo, dri-devel, linux-kernel, kernel-janitors, dri-devel

On Sun, Aug 24, 2025 at 12:54:41PM -0600, Brigham Campbell wrote:
> On Thu Aug 21, 2025 at 6:30 AM MDT, Dan Carpenter wrote:
> > If the mipi_dsi_dual() macro fails, the error code is stored in
> > dsi_ctx.accum_err.  Propagate that error back to the caller instead
> > of returning success as the current code does.
> >
> > Fixes: a6adf47d30cc ("drm/panel: jdi-lpm102a188a: Fix bug and clean up driver")
> > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> > ---
> >  drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> Good catch, Dan! Thank you for the patch. I'll try to be mindful of this
> kind of logic error in the future. Please let me know if you have other
> suggestions.
> 

Heh.  This is just static checker stuff.  https://github.com/error27/smatch
Humans are expected to have mechanical attention to detail at the
same level as a computer.  I just try to write the commit message out to
prove that I've looked at the code as well.

regards,
dan carpenter


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

* Re: [PATCH next] drm/panel: jdi-lpm102a188a: Fix error code in jdi_panel_prepare()
  2025-08-25  5:50   ` Dan Carpenter
@ 2025-08-25 17:12     ` Brigham Campbell
  0 siblings, 0 replies; 5+ messages in thread
From: Brigham Campbell @ 2025-08-25 17:12 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Douglas Anderson,
	Diogo Ivo, dri-devel, linux-kernel, kernel-janitors, dri-devel

On Sun Aug 24, 2025 at 11:50 PM MDT, Dan Carpenter wrote:
> On Sun, Aug 24, 2025 at 12:54:41PM -0600, Brigham Campbell wrote:
>> Good catch, Dan! Thank you for the patch. I'll try to be mindful of this
>> kind of logic error in the future. Please let me know if you have other
>> suggestions.
>
> Heh.  This is just static checker stuff.  https://github.com/error27/smatch
> Humans are expected to have mechanical attention to detail at the
> same level as a computer.  I just try to write the commit message out to
> prove that I've looked at the code as well.

Good to know! I'll consider integrating smatch and other static checking
into my preflight checks.

By the way, I'm interested in contributing more to drm as a hobbyist.
I've been working on todo items in drm documentation and I plan to
continue doing that. If there's anything you'd like help with or you
know of any work to be done which I may not find in the todo list,
please let me know. I can be contacted here on the public mailing lists,
via direct email, or via #dri-devel on OFTC (my nick is xeyler).

Cheers,
Brigham

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

end of thread, other threads:[~2025-08-25 17:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-21 12:30 [PATCH next] drm/panel: jdi-lpm102a188a: Fix error code in jdi_panel_prepare() Dan Carpenter
2025-08-21 14:50 ` Doug Anderson
2025-08-24 18:54 ` Brigham Campbell
2025-08-25  5:50   ` Dan Carpenter
2025-08-25 17:12     ` Brigham Campbell

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).