* [PATCH 1/1] Input: max8997_haptic - Check return value of regulator_enable
@ 2014-05-30 10:36 Sachin Kamat
2014-05-30 20:05 ` Dmitry Torokhov
0 siblings, 1 reply; 3+ messages in thread
From: Sachin Kamat @ 2014-05-30 10:36 UTC (permalink / raw)
To: linux-input; +Cc: dmitry.torokhov, sachin.kamat, Donggeun Kim
Fixes the following warning:
drivers/input/misc/max8997_haptic.c:185:19: warning: ignoring return value of ‘regulator_enable’, declared with attribute warn_unused_result [-Wunused-result]
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Donggeun Kim <dg77.kim@samsung.com>
---
drivers/input/misc/max8997_haptic.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c
index 1fea5484941f..4f4c34e135f5 100644
--- a/drivers/input/misc/max8997_haptic.c
+++ b/drivers/input/misc/max8997_haptic.c
@@ -182,7 +182,11 @@ static void max8997_haptic_enable(struct max8997_haptic *chip)
if (!chip->enabled) {
chip->enabled = true;
- regulator_enable(chip->regulator);
+ error = regulator_enable(chip->regulator);
+ if (error) {
+ dev_err(chip->dev, "Failed to enable regulator");
+ goto out;
+ }
max8997_haptic_configure(chip);
if (chip->mode == MAX8997_EXTERNAL_MODE)
pwm_enable(chip->pwm);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] Input: max8997_haptic - Check return value of regulator_enable
2014-05-30 10:36 [PATCH 1/1] Input: max8997_haptic - Check return value of regulator_enable Sachin Kamat
@ 2014-05-30 20:05 ` Dmitry Torokhov
2014-05-31 6:59 ` Sachin Kamat
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2014-05-30 20:05 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-input, Donggeun Kim
Hi Sachin,
On Fri, May 30, 2014 at 04:06:13PM +0530, Sachin Kamat wrote:
> Fixes the following warning:
> drivers/input/misc/max8997_haptic.c:185:19: warning: ignoring return value of ‘regulator_enable’, declared with attribute warn_unused_result [-Wunused-result]
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Donggeun Kim <dg77.kim@samsung.com>
> ---
> drivers/input/misc/max8997_haptic.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c
> index 1fea5484941f..4f4c34e135f5 100644
> --- a/drivers/input/misc/max8997_haptic.c
> +++ b/drivers/input/misc/max8997_haptic.c
> @@ -182,7 +182,11 @@ static void max8997_haptic_enable(struct max8997_haptic *chip)
>
> if (!chip->enabled) {
> chip->enabled = true;
> - regulator_enable(chip->regulator);
> + error = regulator_enable(chip->regulator);
> + if (error) {
> + dev_err(chip->dev, "Failed to enable regulator");
> + goto out;
We should not be leaving with chip->enabled == true in this case.
> + }
> max8997_haptic_configure(chip);
> if (chip->mode == MAX8997_EXTERNAL_MODE)
> pwm_enable(chip->pwm);
What about checking this one as well?
Thanks.
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] Input: max8997_haptic - Check return value of regulator_enable
2014-05-30 20:05 ` Dmitry Torokhov
@ 2014-05-31 6:59 ` Sachin Kamat
0 siblings, 0 replies; 3+ messages in thread
From: Sachin Kamat @ 2014-05-31 6:59 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input@vger.kernel.org
- Donggeun (as his mail bounces)
Hi Dmitry,
On 31 May 2014 01:35, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> Hi Sachin,
>
> On Fri, May 30, 2014 at 04:06:13PM +0530, Sachin Kamat wrote:
>> Fixes the following warning:
>> drivers/input/misc/max8997_haptic.c:185:19: warning: ignoring return value of ‘regulator_enable’, declared with attribute warn_unused_result [-Wunused-result]
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>> Cc: Donggeun Kim <dg77.kim@samsung.com>
>> ---
>> drivers/input/misc/max8997_haptic.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c
>> index 1fea5484941f..4f4c34e135f5 100644
>> --- a/drivers/input/misc/max8997_haptic.c
>> +++ b/drivers/input/misc/max8997_haptic.c
>> @@ -182,7 +182,11 @@ static void max8997_haptic_enable(struct max8997_haptic *chip)
>>
>> if (!chip->enabled) {
>> chip->enabled = true;
>> - regulator_enable(chip->regulator);
>> + error = regulator_enable(chip->regulator);
>> + if (error) {
>> + dev_err(chip->dev, "Failed to enable regulator");
>> + goto out;
>
> We should not be leaving with chip->enabled == true in this case.
Right.
>
>> + }
>> max8997_haptic_configure(chip);
>> if (chip->mode == MAX8997_EXTERNAL_MODE)
>> pwm_enable(chip->pwm);
>
> What about checking this one as well?
OK.
---
With warm regards,
Sachin
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-31 6:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-30 10:36 [PATCH 1/1] Input: max8997_haptic - Check return value of regulator_enable Sachin Kamat
2014-05-30 20:05 ` Dmitry Torokhov
2014-05-31 6:59 ` Sachin Kamat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).