dri-devel Archive mirror
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	 Jessica Zhang <quic_jesszhan@quicinc.com>,
	Sam Ravnborg <sam@ravnborg.org>,
	 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	 Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>,
	 Daniel Vetter <daniel@ffwll.ch>,
	Matthias Kaehlcke <mka@chromium.org>,
	 Harigovindan P <harigovi@codeaurora.org>,
	Ritesh Kumar <quic_riteshk@quicinc.com>,
	 Sumit Semwal <sumit.semwal@linaro.org>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/6] drm/panel: novatek-nt36672a: stop calling regulator_set_load manually
Date: Fri, 3 May 2024 23:53:08 +0300	[thread overview]
Message-ID: <yoaaisqdjjbx2qfnqdjrifzox3p3p7yeeeeduxlyormmjbgy3c@hmlc5ijwfg7n> (raw)
In-Reply-To: <CAD=FV=WVyRGevshhkhzuXht+ePm3BXVyMhDOPOkFs72wZS_s_A@mail.gmail.com>

On Fri, May 03, 2024 at 10:03:35AM -0700, Doug Anderson wrote:
> Hi,
> 
> On Thu, Apr 4, 2024 at 3:08 AM Dmitry Baryshkov
> <dmitry.baryshkov@linaro.org> wrote:
> >
> > Use .init_load_uA part of the bulk regulator API instead of calling
> > register_set_load() manually.
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
> >  drivers/gpu/drm/panel/panel-novatek-nt36672a.c | 11 +++--------
> >  1 file changed, 3 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c b/drivers/gpu/drm/panel/panel-novatek-nt36672a.c
> > index 33fb3d715e54..3886372415c2 100644
> > --- a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c
> > +++ b/drivers/gpu/drm/panel/panel-novatek-nt36672a.c
> > @@ -605,21 +605,16 @@ static int nt36672a_panel_add(struct nt36672a_panel *pinfo)
> >         struct device *dev = &pinfo->link->dev;
> >         int i, ret;
> >
> > -       for (i = 0; i < ARRAY_SIZE(pinfo->supplies); i++)
> > +       for (i = 0; i < ARRAY_SIZE(pinfo->supplies); i++) {
> >                 pinfo->supplies[i].supply = nt36672a_regulator_names[i];
> > +               pinfo->supplies[i].init_load_uA = nt36672a_regulator_enable_loads[i];
> > +       }
> >
> >         ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(pinfo->supplies),
> >                                       pinfo->supplies);
> >         if (ret < 0)
> >                 return dev_err_probe(dev, ret, "failed to get regulators\n");
> >
> > -       for (i = 0; i < ARRAY_SIZE(pinfo->supplies); i++) {
> > -               ret = regulator_set_load(pinfo->supplies[i].consumer,
> > -                                        nt36672a_regulator_enable_loads[i]);
> > -               if (ret)
> > -                       return dev_err_probe(dev, ret, "failed to set regulator enable loads\n");
> > -       }
> 
> Thanks for the cleanup! I happened to notice this commit and I'm
> curious why you didn't take the next step and move to
> devm_regulator_bulk_get_const(). That would have allowed you to avoid
> the "for" loop above that copies the data ;-)

I haven't noticed this function beforehand. Thanks for the pointer!

> 
> -Doug

-- 
With best wishes
Dmitry

  reply	other threads:[~2024-05-03 20:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 10:07 [PATCH 0/6] drm/panel: small fixes for visionox and novatek panel drivers Dmitry Baryshkov
2024-04-04 10:07 ` [PATCH 1/6] drm/panel: visionox-rm69299: don't unregister DSI device Dmitry Baryshkov
2024-04-05 21:42   ` Jessica Zhang
2024-04-04 10:08 ` [PATCH 2/6] drm/panel: novatek-nt36682e: " Dmitry Baryshkov
2024-04-05 21:43   ` Jessica Zhang
2024-04-04 10:08 ` [PATCH 3/6] drm/panel: novatek-nt36672e: stop setting register load before disable Dmitry Baryshkov
2024-04-24  6:52   ` Neil Armstrong
2024-04-04 10:08 ` [PATCH 4/6] drm/panel: novatek-nt36672e: stop calling regulator_set_load manually Dmitry Baryshkov
2024-04-17 21:20   ` Jessica Zhang
2024-04-18  0:04     ` Dmitry Baryshkov
2024-04-04 10:08 ` [PATCH 5/6] drm/panel: novatek-nt36672a: " Dmitry Baryshkov
2024-04-24  6:53   ` Neil Armstrong
2024-05-03 17:03   ` Doug Anderson
2024-05-03 20:53     ` Dmitry Baryshkov [this message]
2024-04-04 10:08 ` [PATCH 6/6] drm/panel: visionox-rm69299: " Dmitry Baryshkov
2024-04-24  6:53   ` Neil Armstrong
2024-04-16 20:20 ` (subset) [PATCH 0/6] drm/panel: small fixes for visionox and novatek panel drivers Dmitry Baryshkov
2024-04-24  6:59 ` Neil Armstrong

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=yoaaisqdjjbx2qfnqdjrifzox3p3p7yeeeeduxlyormmjbgy3c@hmlc5ijwfg7n \
    --to=dmitry.baryshkov@linaro.org \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harigovi@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mka@chromium.org \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_jesszhan@quicinc.com \
    --cc=quic_riteshk@quicinc.com \
    --cc=sam@ravnborg.org \
    --cc=sumit.semwal@linaro.org \
    --cc=tzimmermann@suse.de \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).