[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <54EBCCE3.8070404@samsung.com>
Date: Tue, 24 Feb 2015 09:59:15 +0900
From: Jaewon Kim <jaewon02.kim@...sung.com>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-pm@...r.kernel.org, linux-input@...r.kernel.org,
Inki Dae <inki.dae@...sung.com>,
SangBae Lee <sangbae90.lee@...sung.com>,
Rob Herring <robh+dt@...nel.org>,
Pawel Moll <pawel.moll@....com>,
Mark Rutland <mark.rutland@....com>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
Kumar Gala <galak@...eaurora.org>,
Lee Jones <lee.jones@...aro.org>,
Chanwoo Choi <cw00.choi@...sung.com>,
Sebastian Reichel <sre@...nel.org>,
Beomho Seo <beomho.seo@...sung.com>
Subject: Re: [PATCH v4 4/5] Input: add haptic drvier on max77843
Hi Dmitry Torokhov,
On 02/24/2015 02:26 AM, Dmitry Torokhov wrote:
> 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@...il.com>
>> Signed-off-by: Jaewon Kim <jaewon02.kim@...sung.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?
This code prevent to play haptic when entering suspend state.
But I forgot return.
I will add return 0 in version 6.
>
>> +
>> + 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.
Okay, I will add mutex_unlock().
>
>> + }
>> +
>> + 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.
>
Thanks to review my patch.
Thanks,
Jaewon Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists