Messages in this thread | | | From | Doug Anderson <> | Date | Fri, 26 Apr 2024 17:01:21 -0700 | Subject | Re: [PATCH] drm/mipi-dsi: Reduce driver bloat of mipi_dsi_*_write_seq() |
| |
Hi,
On Fri, Apr 26, 2024 at 8:28 AM Doug Anderson <dianders@chromium.org> wrote: > > > I don't find this unintuitive, but if it helps, you could conceivably > > add a context parameter: > > > > struct mipi_dsi_seq_context context = { > > .dsi = dsi, > > }; > > > > mipi_dsi_dcs_write_seq(&context, HX83102_SETSPCCMD, 0xcd); > > ... > > > > if (context.ret) > > ... > > > > And even have further control in the context whether to log or keep > > going or whatever. > > I agree there are some benefits of adding the extra "context" > abstraction and we can go that way if you want, but I lean towards the > simplicity of just passing in the accumulated return value like I did > in my example. > > > I'll try to write up patches and see if I can post them later today.
FWIW, I went with your "context" idea. In the end, I liked how it looked and the icing on the cake was that it generated even smaller code! :-)
My v2 series (now 8 patches long) is at:
https://lore.kernel.org/r/20240426235857.3870424-1-dianders@chromium.org
-Doug
| |