Re: [PATCH 1/4] ab8500-charger: Check return value of regulator_enable

From: Sachin Kamat
Date: Wed Sep 04 2013 - 05:58:31 EST


On 4 September 2013 15:11, Lee Jones <lee.jones@xxxxxxxxxx> wrote:
> On Mon, 02 Sep 2013, Sachin Kamat wrote:
>
>> Check the return value of regulator_enable to silence the following
>> type of warnings:
>> drivers/power/ab8500_charger.c:1390:20: warning: ignoring return value
>> of ‘regulator_enable’, declared with attribute warn_unused_result
>> [-Wunused-result]
>
> I think I remember something about it being okay for the regulators to
> fail, but that may have been something else. I think I'd be more
> comfortable if we just raised a dev_warn() and didn't return early in
> the error case.

In this particular case the regulator seems to be mandatory as they error out if
regulator_get() fails. Also, the comment above regulator_enable() said
the enabling
was done to fix some bug. Hence I wasn't sure if we could just print a
warning message
and continue further upon failure. I will change it as per your
suggestion and re-spin the patches.

--
With warm regards,
Sachin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/