From: Doug Anderson <dianders@chromium.org>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org,
Javier Martinez Canillas <javierm@redhat.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
linus.walleij@linaro.org,
Cong Yang <yangcong5@huaqin.corp-partner.google.com>,
lvzhaoxiong@huaqin.corp-partner.google.com,
Hsin-Yi Wang <hsinyi@google.com>,
Sam Ravnborg <sam@ravnborg.org>, Daniel Vetter <daniel@ffwll.ch>,
David Airlie <airlied@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/mipi-dsi: Reduce driver bloat of mipi_dsi_*_write_seq()
Date: Fri, 26 Apr 2024 17:01:21 -0700 [thread overview]
Message-ID: <CAD=FV=V4DAUGEapnre1C0HJ80ooHJU=7fy+JESbRtnJEiL3gCA@mail.gmail.com> (raw)
In-Reply-To: <CAD=FV=XNbRauayNFNOODm-aaaLy2_vJk8OW-mR_XmLv505RtGA@mail.gmail.com>
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
prev parent reply other threads:[~2024-04-27 0:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-25 0:20 [PATCH] drm/mipi-dsi: Reduce driver bloat of mipi_dsi_*_write_seq() Douglas Anderson
2024-04-25 7:55 ` Neil Armstrong
2024-04-25 8:19 ` Jani Nikula
2024-04-25 17:04 ` Doug Anderson
2024-04-26 3:03 ` Dmitry Baryshkov
2024-04-26 15:35 ` Doug Anderson
2024-04-26 15:42 ` Dmitry Baryshkov
2024-04-26 10:08 ` Jani Nikula
2024-04-26 15:28 ` Doug Anderson
2024-04-27 0:01 ` Doug Anderson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAD=FV=V4DAUGEapnre1C0HJ80ooHJU=7fy+JESbRtnJEiL3gCA@mail.gmail.com' \
--to=dianders@chromium.org \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hsinyi@google.com \
--cc=jani.nikula@linux.intel.com \
--cc=javierm@redhat.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lvzhaoxiong@huaqin.corp-partner.google.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=sam@ravnborg.org \
--cc=tzimmermann@suse.de \
--cc=yangcong5@huaqin.corp-partner.google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).