drm/panel: jdi-lpm102a188a: Fix error code in jdi_panel_prepare()
Subsystems (4)
PATCH 1/1 drm/panel: jdi-lpm102a188a: Fix error code in jdi_panel_prepare()
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.
--- drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c +3 -1
@@ -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 ;
Signature · 1 line
2.47.2
Hi,
Quoted 10 lines · Dan Carpenter
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 <[email protected]>--- drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Thanks for the fix.
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
Quoted 9 lines · Dan Carpenter
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 <[email protected]>--- 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.
Regards,
Brigham
Quoted 11 lines · Brigham Campbell
Quoted 9 lines · Dan Carpenter
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 <[email protected]>--- drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 4 lines
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
Quoted 9 lines · Dan Carpenter
Quoted 3 lines · Brigham Campbell
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