[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 8 Aug 2013 18:07:52 +0800
From: Wei Ni <wni@...dia.com>
To: Alexander Shiyan <shc_work@...l.ru>
CC: Guenter Roeck <linux@...ck-us.net>,
"swarren@...dotorg.org" <swarren@...dotorg.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"lm-sensors@...sensors.org" <lm-sensors@...sensors.org>,
"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
Matthew Longnecker <MLongnecker@...dia.com>,
"khali@...ux-fr.org" <khali@...ux-fr.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v2 1/3] hwmon: (lm90) Add power control
On 08/08/2013 05:57 PM, Alexander Shiyan wrote:
>> On 08/08/2013 04:42 PM, Guenter Roeck wrote:
>>> On 08/07/2013 11:56 PM, Wei Ni wrote:
>>>> The device lm90 can be controlled by the vdd rail.
>>>> Adding the power control support to power on/off the vdd rail.
>>>> And make sure that power is enabled before accessing the device.
>>>>
>>>> Signed-off-by: Wei Ni <wni@...dia.com>
>>>> ---
>>>> drivers/hwmon/lm90.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
> [...]
>>> I consider the messages unnecessary and confusing. You are polluting the log
>>> of pretty much every PC user who has one of the supported chips in the system,
>>> and of everyone else not using regulators for this chip.
>>
>> Ok, I will remove these codes.
>> So I will write something like:
>> if (!IS_ERR(data->lm90_reg)) {
>> ret = regulator_enable(data->lm90_reg);
>> if (ret < 0) {
>> dev_err();
>> return ret;
>> }
>> } else {
>> if (PTR_ERR(data->lm90_reg) == -EPROBE_DEFER)
>> return -EPRPBE_DEFER;
>>
>> data->lm90_reg = !!IS_ERR(data->lm90_reg);
BTW, since it may return EPROBE_DEFER, these codes should be put in the
beginning of the probe() function, should before allocate lm90_data.
>
> No. You do not need this line.
>
> Just use in remove():
> if (!IS_ERR(data->lm90_reg))
> regulator_disable(data->lm90_reg);
>
> ---
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists