Re: [PATCH 3/3] hwmon: (lm75) Add regulator support

2020-09-28 Thread Guenter Roeck
On Mon, Sep 28, 2020 at 09:29:49AM -0700, Guenter Roeck wrote: > > > > This is handled in lm75_remove() where I added the regulator_disable() > > call. > > lm75_remove() won't be called if the probe function fails. > Sorry, I am confused; please ignore this noise. Guenter

Re: [PATCH 3/3] hwmon: (lm75) Add regulator support

2020-09-28 Thread Guenter Roeck
On Mon, Sep 28, 2020 at 03:13:53PM +, Bedel, Alban wrote: > On Thu, 2020-09-17 at 22:33 -0700, Guenter Roeck wrote: > > On 9/17/20 3:18 AM, Alban Bedel wrote: > > > Add regulator support for boards where the sensor first need to be > > > powered up before it can be used. > > > > > > Signed-off

Re: [PATCH 3/3] hwmon: (lm75) Add regulator support

2020-09-28 Thread Bedel, Alban
On Thu, 2020-09-17 at 22:33 -0700, Guenter Roeck wrote: > On 9/17/20 3:18 AM, Alban Bedel wrote: > > Add regulator support for boards where the sensor first need to be > > powered up before it can be used. > > > > Signed-off-by: Alban Bedel > > --- > > drivers/hwmon/lm75.c | 31 +

Re: [PATCH 3/3] hwmon: (lm75) Add regulator support

2020-09-18 Thread Mark Brown
On Thu, Sep 17, 2020 at 10:33:37PM -0700, Guenter Roeck wrote: > On 9/17/20 3:18 AM, Alban Bedel wrote: > > + err = regulator_enable(data->vs); > How about device removal ? Don't you have to call regulator_disable() > there as well ? If so, it might be best to use devm_add_action_or_res

Re: [PATCH 3/3] hwmon: (lm75) Add regulator support

2020-09-18 Thread Mark Brown
On Thu, Sep 17, 2020 at 07:04:51PM -0700, Guenter Roeck wrote: > On 9/17/20 4:00 AM, Mark Brown wrote: > > On Thu, Sep 17, 2020 at 12:18:19PM +0200, Alban Bedel wrote: > >> + data->vs = devm_regulator_get_optional(dev, "vs"); > >> + if (IS_ERR(data->vs)) { > > Unless the device can work without

Re: [PATCH 3/3] hwmon: (lm75) Add regulator support

2020-09-17 Thread Guenter Roeck
On 9/17/20 3:18 AM, Alban Bedel wrote: > Add regulator support for boards where the sensor first need to be > powered up before it can be used. > > Signed-off-by: Alban Bedel > --- > drivers/hwmon/lm75.c | 31 +-- > 1 file changed, 29 insertions(+), 2 deletions(-) >

Re: [PATCH 3/3] hwmon: (lm75) Add regulator support

2020-09-17 Thread Guenter Roeck
On 9/17/20 4:00 AM, Mark Brown wrote: > On Thu, Sep 17, 2020 at 12:18:19PM +0200, Alban Bedel wrote: > >> +data->vs = devm_regulator_get_optional(dev, "vs"); >> +if (IS_ERR(data->vs)) { > > Unless the device can work without power you should not be using > regulator_get_optional(). > Th

Re: [PATCH 3/3] hwmon: (lm75) Add regulator support

2020-09-17 Thread Mark Brown
On Thu, Sep 17, 2020 at 12:18:19PM +0200, Alban Bedel wrote: > + data->vs = devm_regulator_get_optional(dev, "vs"); > + if (IS_ERR(data->vs)) { Unless the device can work without power you should not be using regulator_get_optional(). signature.asc Description: PGP signature

[PATCH 3/3] hwmon: (lm75) Add regulator support

2020-09-17 Thread Alban Bedel
Add regulator support for boards where the sensor first need to be powered up before it can be used. Signed-off-by: Alban Bedel --- drivers/hwmon/lm75.c | 31 +-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.