[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <159563751654.3847286.14653890659248238783@swboyd.mtv.corp.google.com>
Date: Fri, 24 Jul 2020 17:38:36 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: Doug Anderson <dianders@...omium.org>
Cc: Jonathan Cameron <jic23@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-iio <linux-iio@...r.kernel.org>,
Gwendal Grignou <gwendal@...omium.org>,
Daniel Campello <campello@...omium.org>,
Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>
Subject: Re: [PATCH v2 5/5] iio: sx9310: Enable vdd and svdd regulators at probe
Quoting Doug Anderson (2020-07-24 15:02:23)
> On Fri, Jul 24, 2020 at 2:33 PM Stephen Boyd <swboyd@...omium.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.
Powered by blists - more mailing lists