Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753288AbbBZCtm (ORCPT ); Wed, 25 Feb 2015 21:49:42 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:20578 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751479AbbBZCtk (ORCPT ); Wed, 25 Feb 2015 21:49:40 -0500 X-AuditID: cbfee691-f79b86d000004a5a-86-54ee89c05680 Message-id: <54EE89C0.7010507@samsung.com> Date: Thu, 26 Feb 2015 11:49:36 +0900 From: Jaewon Kim User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-version: 1.0 To: Dmitry Torokhov 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 References: <1424741348-8728-1-git-send-email-jaewon02.kim@samsung.com> <1424741348-8728-5-git-send-email-jaewon02.kim@samsung.com> <20150226012353.GC25965@dtor-ws> In-reply-to: <20150226012353.GC25965@dtor-ws> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrAIsWRmVeSWpSXmKPExsWyRsSkWPdA57sQg6XTTCxOf9rGbnH9y3NW i/lHzrFaHF70gtGi/81CVotzr1YyWky6P4HF4v7Xo4wWNz99Y7W4vGsOm8Xn3iOMFkuvX2Sy mDB9LYtF694j7BbHPx1ksTi9u8RBwGPNvDWMHpf7epk8ds66y+6xcvkXNo9NqzrZPO5c28Pm 0bdlFaPH501yARxRXDYpqTmZZalF+nYJXBk7l+xgLFjNU7Fw9jX2BsabnF2MHBwSAiYSy1rL uxg5gUwxiQv31rN1MXJ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bvezQzivGSUO3/vA BFLFK6Al0dH1lhHEZhFQlVi+eycbiM0moC3xff1iVhBbVCBCYv6x18wQ9YISPybfYwGxRQT0 JbbP/sUIMpRZYDqLxOEjR8EahAUcJGZ8eMICsW0Fo8TpxwvAEpwCuhJzj7wD28wsYCux4P06 FghbXmLzmrfMExgFZiFZMgtJ2SwkZQsYmVcxiqYWJBcUJ6XnGukVJ+YWl+al6yXn525iBCeU Z9I7GFc1WBxiFOBgVOLhTch+FyLEmlhWXJl7iFGCg1lJhPdSG1CINyWxsiq1KD++qDQntfgQ oykwDCYyS4km5wOTXV5JvKGxiZmRpZG5oYWRsbmSOK+SfVuIkEB6YklqdmpqQWoRTB8TB6dU A+PqWxtdGN/4MMhFPU7PeDfVOsi212VFzMw3Mq4Z1vYSH17fzd7RkR+Yscl7Kof7LrF1H/4u YXnbEaz9ZJLZu0j9yoYJfhHlZdERuptbA+d6PkpPZLzyR2H7yt79j1jf5/8I0rrdbf/in/Oj PZcufnDN6YzTelCWvnz2fh2dy580v8T1vnFr8FdiKc5INNRiLipOBACcgAOfPgMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1766 Lines: 63 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. > > 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/