Re: [PATCH v4 3/6] iio: light: stk3310: Implement vdd and leda supplies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 04, 2024 at 10:35:42AM +0200, Andy Shevchenko wrote:
> On Sat, Nov 02, 2024 at 03:50:39PM -0400, Aren Moynihan wrote:
> > The vdd and leda supplies must be powered on for the chip to function
> > and can be powered off during system suspend.
> > 
> > This was originally based on a patch by Ondrej Jirman[1], but has been
> > rewritten since.
> > 
> > 1: https://codeberg.org/megi/linux/commit/a933aff8b7a0e6e3c9cf1d832dcba07022bbfa82
> 
> Make it a Link tag...
> 
> > 
> 
> ...here
> 
> Link: https://codeberg.org/megi/linux/commit/a933aff8b7a0e6e3c9cf1d832dcba07022bbfa82 [1]

Makes sense

> > Signed-off-by: Aren Moynihan <aren@xxxxxxxxxxxxxxxxx>
> 
> ...
> 
> > +	ret = devm_regulator_bulk_get(&client->dev, ARRAY_SIZE(data->supplies),
> > +				      data->supplies);
> > +	if (ret)
> > +		return dev_err_probe(&client->dev, ret, "get regulators failed\n");
> 
> With previously introduced temporary 'dev' variable these become:
> 
> 	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(data->supplies), data->supplies);
> 	if (ret)
> 		return dev_err_probe(dev, ret, "get regulators failed\n");
> 
> ...
> 
> > +	ret = stk3310_regulators_enable(data);
> > +	if (ret)
> > +		return dev_err_probe(&client->dev, ret,
> > +				     "regulator enable failed\n");
> > +
> > +	ret = devm_add_action_or_reset(&client->dev, stk3310_regulators_disable, data);
> > +	if (ret)
> > +		return dev_err_probe(&client->dev, ret,
> > +				     "failed to register regulator cleanup\n");
> 
> So do these...
> 

Cleaning all of these up

> > +	ret = regulator_bulk_disable(ARRAY_SIZE(data->supplies), data->supplies);
> 
> Is array_size.h included?

It's not, it looks like it came one of the headers that's already
included. I'll add it explicitly.

Thanks
 - Aren




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux