Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752579AbbBWR1I (ORCPT ); Mon, 23 Feb 2015 12:27:08 -0500 Received: from mail-ie0-f175.google.com ([209.85.223.175]:46586 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751812AbbBWR1F (ORCPT ); Mon, 23 Feb 2015 12:27:05 -0500 Date: Mon, 23 Feb 2015 09:26:58 -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 v4 4/5] Input: add haptic drvier on max77843 Message-ID: <20150223172658.GA604@dtor-glaptop> References: <1424678991-13978-1-git-send-email-jaewon02.kim@samsung.com> <1424678991-13978-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: <1424678991-13978-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: 1597 Lines: 64 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 > Signed-off-by: Jaewon Kim ... > +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? > + > + 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. > + } > + > + 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. -- 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/