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

On Mon, Feb 23, 2015 at 05:09:50PM +0900, Jaewon Kim wrote:
> This patch adds support for haptic driver on max77843
> MFD(Multi Function Device) with PMIC, MUIC, LED, CHARGER.
>
> This driver supports external pwm and LRA(Linear Resonant Actuator) motor.
> And it supports ff-memless interface from inpu framework.
>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>

...

> +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)
> + mutex_unlock(&haptic->mutex);

Huh?

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

Here you are leaving with the mutex held.

> + }
> +
> + 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);
> + }
> +
> + mutex_unlock(&haptic->mutex);
> +}
> +

The rest seems quite reasonable.

Thanks.

--
Dmitry


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