linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jaewon Kim <jaewon02.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Inki Dae <inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	SangBae Lee
	<sangbae90.lee-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Beomho Seo <beomho.seo-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH v6 4/5] Input: add haptic drvier on max77843
Date: Wed, 25 Feb 2015 17:23:53 -0800	[thread overview]
Message-ID: <20150226012353.GC25965@dtor-ws> (raw)
In-Reply-To: <1424741348-8728-5-git-send-email-jaewon02.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-02-26  1:23 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
     [not found]   ` <1424741348-8728-2-git-send-email-jaewon02.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
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
     [not found]   ` <1424741348-8728-5-git-send-email-jaewon02.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-02-26  1:23     ` Dmitry Torokhov [this message]
2015-02-26  2:49       ` Jaewon Kim
2015-02-27 17:49         ` Dmitry Torokhov
2015-03-02  6:08           ` Jaewon Kim
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=20150226012353.GC25965@dtor-ws \
    --to=dmitry.torokhov-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=beomho.seo-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=jaewon02.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sangbae90.lee-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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;
as well as URLs for NNTP newsgroup(s).