lkml.org 
[lkml]   [2015]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 4/5] Input: add haptic drvier on max77843
Hi Jaewon,

On Tue, Feb 24, 2015 at 10:29:07AM +0900, Jaewon Kim wrote:
> +static void max77843_haptic_play_work(struct work_struct *work)
> +{
> + struct max77843_haptic *haptic =
> + container_of(work, struct max77843_haptic, work);
> + int error;
> +
> + mutex_lock(&haptic->mutex);
> +
> + if (haptic->suspended) {
> + goto err_play;
> + }
> +

You do not need braces around single statement. Also, this is not error
that you are handling, I'd prefer if we called this label out_unlock.

> + error = max77843_haptic_set_duty_cycle(haptic);
> + if (error) {
> + dev_err(haptic->dev, "failed to set duty cycle: %d\n", error);
> + goto err_play;
> + }

Do you need to configure duty cycle if you stopping the playback? Or
maybe disabling pwm is enough?

> +
> + if (haptic->magnitude) {
> + error = max77843_haptic_enable(haptic);
> + if (error)
> + dev_err(haptic->dev,
> + "cannot enable haptic: %d\n", error);
> + } else {
> + max77843_haptic_disable(haptic);
> + if (error)
> + dev_err(haptic->dev,
> + "cannot disable haptic: %d\n", error);

What error? You did not assign it...

Thanks.

--
Dmitry


\
 
 \ /
  Last update: 2015-02-26 02:41    [W:0.303 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site