lkml.org 
[lkml]   [2024]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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

\
 
 \ /
  Last update: 2024-04-27 02:01    [W:0.048 / U:26.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site