From: Jaewon Kim <jaewon02.kim@samsung.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-pm@vger.kernel.org, linux-input@vger.kernel.org,
Inki Dae <inki.dae@samsung.com>,
SangBae Lee <sangbae90.lee@samsung.com>,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
Lee Jones <lee.jones@linaro.org>,
Chanwoo Choi <cw00.choi@samsung.com>,
Sebastian Reichel <sre@kernel.org>,
Beomho Seo <beomho.seo@samsung.com>
Subject: Re: [PATCH v6 4/5] Input: add haptic drvier on max77843
Date: Mon, 02 Mar 2015 15:08:14 +0900 [thread overview]
Message-ID: <54F3FE4E.5030805@samsung.com> (raw)
In-Reply-To: <20150227174941.GD6679@dtor-ws>
HI Dmitry,
On 28/02/2015 02:49, Dmitry Torokhov wrote:
> On Thu, Feb 26, 2015 at 11:49:36AM +0900, Jaewon Kim wrote:
>> Hi Dmitry,
>>
>> On 26/02/2015 10:23, Dmitry Torokhov wrote:
>>> 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.
>> You are right.
>> I will change label name and remove braces.
>>>> + 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?
>> It do not need to set duty cycle requisitely when disabling haptic.
>>
>> I will move this function to front of max77843_haptic_enable().
>>
>>>> +
>>>> + 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...
>> Detailed error message printed in enable/disable() function.
> What I was trying to say is that you do not assign new value to 'error'
> variable in this path; it still carries the value from
> max77843_haptic_set_duty_cycle() above and so this "if" statement will
> never work and the message will never show up.
I never image at all that i am not assign 'error' variable.
I will assign it.
>
> Thanks.
>
Thanks,
Jaewon Kim
next prev parent reply other threads:[~2015-03-02 6:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-24 1:29 [PATCH v6 0/5] Add new MFD driver for MAX77843 Jaewon Kim
2015-02-24 1:29 ` [PATCH v6 1/5] mfd: max77843: Add max77843 MFD driver core driver Jaewon Kim
2015-02-25 16:47 ` Lee Jones
2015-02-26 2:58 ` Jaewon Kim
2015-02-24 1:29 ` [PATCH v6 2/5] power: max77843_charger: Add Max77843 charger device driver Jaewon Kim
2015-02-28 20:03 ` Paul Bolle
2015-03-02 0:05 ` Beomho Seo
2015-02-24 1:29 ` [PATCH v6 3/5] power: max77843_battery: Add Max77843 fuel gauge " Jaewon Kim
2015-02-28 20:00 ` Paul Bolle
2015-03-02 0:00 ` Beomho Seo
2015-02-24 1:29 ` [PATCH v6 4/5] Input: add haptic drvier on max77843 Jaewon Kim
2015-02-26 1:23 ` Dmitry Torokhov
2015-02-26 2:49 ` Jaewon Kim
2015-02-27 17:49 ` Dmitry Torokhov
2015-03-02 6:08 ` Jaewon Kim [this message]
2015-02-24 1:29 ` [PATCH v6 5/5] Documentation: Add device tree bindings document for max77843 Jaewon Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54F3FE4E.5030805@samsung.com \
--to=jaewon02.kim@samsung.com \
--cc=beomho.seo@samsung.com \
--cc=cw00.choi@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=inki.dae@samsung.com \
--cc=lee.jones@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=sangbae90.lee@samsung.com \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox