2010-11-02 16:04:38

by Guenter Roeck

[permalink] [raw]
Subject: Re: [lm-sensors] [PATCH 1/8] hwmon: applesmc: Relax the severity of device init failure

Hi Henrik,

On Sun, Oct 31, 2010 at 03:50:27AM -0400, Henrik Rydberg wrote:
> The device init is used to reset the accelerometer. Failure to reset
> is not severe enough to stop loading the module or to resume from
> hibernation. This patch relaxes failure to a warning and drops
> output in case of success.
>
> Signed-off-by: Henrik Rydberg <[email protected]>
> ---
> drivers/hwmon/applesmc.c | 24 ++----------------------
> 1 files changed, 2 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
> index d7a5b75..375e464 100644
> --- a/drivers/hwmon/applesmc.c
> +++ b/drivers/hwmon/applesmc.c
> @@ -458,21 +458,8 @@ static int applesmc_device_init(void)
> mutex_lock(&applesmc_lock);
>
Since the callers of applesmc_device_init() now all don't check the return value,
it might make sense to declare it as void and not bother returning an error.

Otherwise looks good.

Thanks,
Guenter


2010-11-03 14:46:10

by Henrik Rydberg

[permalink] [raw]
Subject: Re: [lm-sensors] [PATCH 1/8] hwmon: applesmc: Relax the severity of device init failure

On 11/02/2010 05:03 PM, Guenter Roeck wrote:

> Hi Henrik,
>
> On Sun, Oct 31, 2010 at 03:50:27AM -0400, Henrik Rydberg wrote:
>> The device init is used to reset the accelerometer. Failure to reset
>> is not severe enough to stop loading the module or to resume from
>> hibernation. This patch relaxes failure to a warning and drops
>> output in case of success.
>>
>> Signed-off-by: Henrik Rydberg <[email protected]>
>> ---
>> drivers/hwmon/applesmc.c | 24 ++----------------------
>> 1 files changed, 2 insertions(+), 22 deletions(-)
>>
>> diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
>> index d7a5b75..375e464 100644
>> --- a/drivers/hwmon/applesmc.c
>> +++ b/drivers/hwmon/applesmc.c
>> @@ -458,21 +458,8 @@ static int applesmc_device_init(void)
>> mutex_lock(&applesmc_lock);
>>
> Since the callers of applesmc_device_init() now all don't check the return value,
> it might make sense to declare it as void and not bother returning an error.
>
> Otherwise looks good.


Sounds good, will change.

Henrik