Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753399AbbBZBYA (ORCPT ); Wed, 25 Feb 2015 20:24:00 -0500 Received: from mail-ig0-f178.google.com ([209.85.213.178]:50267 "EHLO mail-ig0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752706AbbBZBX6 (ORCPT ); Wed, 25 Feb 2015 20:23:58 -0500 Date: Wed, 25 Feb 2015 17:23:53 -0800 From: Dmitry Torokhov To: Jaewon Kim Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-input@vger.kernel.org, Inki Dae , SangBae Lee , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Lee Jones , Chanwoo Choi , Sebastian Reichel , Beomho Seo Subject: Re: [PATCH v6 4/5] Input: add haptic drvier on max77843 Message-ID: <20150226012353.GC25965@dtor-ws> References: <1424741348-8728-1-git-send-email-jaewon02.kim@samsung.com> <1424741348-8728-5-git-send-email-jaewon02.kim@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424741348-8728-5-git-send-email-jaewon02.kim@samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1372 Lines: 51 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 linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/