linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <swboyd@chromium.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Jonathan Cameron <jic23@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-iio <linux-iio@vger.kernel.org>,
	Gwendal Grignou <gwendal@chromium.org>,
	Daniel Campello <campello@chromium.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Subject: Re: [PATCH v2 5/5] iio: sx9310: Enable vdd and svdd regulators at probe
Date: Fri, 24 Jul 2020 17:38:36 -0700	[thread overview]
Message-ID: <159563751654.3847286.14653890659248238783@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <CAD=FV=WKTsCB=7rDSgjqE5w00SsayBd5OT9O65sjkiM9crS5aQ@mail.gmail.com>

Quoting Doug Anderson (2020-07-24 15:02:23)
> On Fri, Jul 24, 2020 at 2:33 PM Stephen Boyd <swboyd@chromium.org> wrote:
> > diff --git a/drivers/iio/proximity/sx9310.c b/drivers/iio/proximity/sx9310.c
> > index 1e1f6bba50f6..ad6ed100c7a6 100644
> > --- a/drivers/iio/proximity/sx9310.c
> > +++ b/drivers/iio/proximity/sx9310.c
> > @@ -919,6 +929,23 @@ static int sx9310_probe(struct i2c_client *client,
> >         if (IS_ERR(data->regmap))
> >                 return PTR_ERR(data->regmap);
> >
> > +       ret = devm_regulator_bulk_get(&client->dev, ARRAY_SIZE(supplies), supplies);
> > +       if (ret)
> > +               return ret;
> > +
> > +       ret = regulator_bulk_enable(ARRAY_SIZE(supplies), supplies);
> > +       if (ret)
> > +               return ret;
> > +       /* Must wait for Tpor time after initial power up */
> > +       usleep_range(1000, 1100);
> > +
> > +       /* Update sx9310_regulator_disable() size if this bug is hit */
> > +       BUILD_BUG_ON(ARRAY_SIZE(supplies) != 2);
> > +       ret = devm_add_action_or_reset(&client->dev, sx9310_regulator_disable,
> > +                                      supplies);
> 
> ...but, but...  Aren't you storing a pointer to stack memory?  How
> does that work?  I think you either need to store the "struct
> regulator_bulk_data" in your private data or just make two normal
> regulator calls.
> 

Doh, no coffee today.

  reply	other threads:[~2020-07-25  0:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24 21:33 [PATCH 0/3] Some sx9310 iio driver updates Stephen Boyd
2020-07-24 21:33 ` [PATCH v2 1/5] dt-bindings: iio: Add bindings for sx9310 sensor Stephen Boyd
2020-07-24 21:36   ` Stephen Boyd
2020-07-24 21:33 ` [PATCH v2 2/5] iio: sx9310: Add newlines to printks Stephen Boyd
2020-07-24 21:33 ` [PATCH v2 3/5] iio: sx9310: whoami is unsigned Stephen Boyd
2020-07-24 21:56   ` Doug Anderson
2020-07-25  0:14   ` Daniel Campello
2020-07-24 21:33 ` [PATCH v2 4/5] iio: sx9310: Drop channel_users[] Stephen Boyd
2020-07-24 21:57   ` Doug Anderson
2020-07-25  0:17   ` Daniel Campello
2020-07-24 21:33 ` [PATCH v2 5/5] iio: sx9310: Enable vdd and svdd regulators at probe Stephen Boyd
2020-07-24 22:02   ` Doug Anderson
2020-07-25  0:38     ` Stephen Boyd [this message]
2020-07-26 11:56 ` [PATCH 0/3] Some sx9310 iio driver updates Jonathan Cameron
2020-07-27 20:02   ` Stephen Boyd

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=159563751654.3847286.14653890659248238783@swboyd.mtv.corp.google.com \
    --to=swboyd@chromium.org \
    --cc=campello@chromium.org \
    --cc=dianders@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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).