Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754640Ab3JXJ0g (ORCPT ); Thu, 24 Oct 2013 05:26:36 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:51868 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754160Ab3JXJ0d convert rfc822-to-8bit (ORCPT ); Thu, 24 Oct 2013 05:26:33 -0400 X-AuditID: cbfee690-b7f3d6d000001c4a-e4-5268e7c713ce From: "hyunhee.kim" To: "'Oliver Neukum'" Cc: "'Dmitry Torokhov'" , broonie@opensource.wolfsonmicro.com, peter.ujfalusi@ti.com, wfp5p@virginia.edu, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, kyungmin.park@samsung.com, "'Aristeu Sergio Rozanski Filho'" References: <000a01cec629$3cf34de0$b6d9e9a0$%kim@samsung.com> <20131021155558.GA4255@core.coreip.homeip.net> <025101ced083$35f2a270$a1d7e750$%kim@samsung.com> <1382603886.1559.11.camel@linux-fkkt.site> In-reply-to: <1382603886.1559.11.camel@linux-fkkt.site> Subject: RE: [PATCH v2] Input: add regulator haptic driver Date: Thu, 24 Oct 2013 18:26:30 +0900 Message-id: <028401ced09b$1f6564d0$5e302e70$%kim@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8BIT X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac7QlGzVSRYl8tohR/yeQB2ZNfsEyAABhYlw Content-language: ko X-OriginalArrivalTime: 24 Oct 2013 09:26:30.0069 (UTC) FILETIME=[1F1AEE50:01CED09B] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsVy+t8zXd3jzzOCDFrfMFrc/PSN1eLyrjls DkwenzfJBTBGcdmkpOZklqUW6dslcGW8W3aYvWA5T8WHuzINjK1cXYycHBICJhKrJ+1igrDF JC7cW8/WxcjFISSwjFHi/4w7bDBFX/YcYodITG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0r8mHwPLM4soC4xad4iZghbW+LJ uwtAvRxAd6tLPPqrC3GEkcSU2btYIUpEJPa9eMcI8YGaxIenH1kg3gyVmH3uLNMERtFZSDbM QrJhFpINs5CMWsDIsopRNLUguaA4KT3XSK84Mbe4NC9dLzk/dxMjOBk8k97BuKrB4hCjAAej Eg+vxof0ICHWxLLiytxDjBIczEoivJ4VGUFCvCmJlVWpRfnxRaU5qcWHGJOBATCRWUo0OR+Y qPJK4g2NTcyMLI3MjE3MjY1JE1YS5z3Yah0oJJCeWJKanZpakFoEs4WJg1OqgZF/6htlu6c2 n/yTmH+saXPVcop1tn38WOSeT0GEIUNkCMPn5V9WBvCaRgnvueFyQHSdvoGpJqfWLdv+Wrvo 9Z2/ohIDebinfd0fnyVdwtu8LeeSz8amZzuVuKzkT93MleL9N7vwde7MruO/WyVuCFX+KxdP s+r85dopvoa9W2e9BFPk+4jPSizFGYmGWsxFxYkA84TiMkoDAAA= 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: 1739 Lines: 59 Hi, Thanks for your review. I resent patch v3 after removing wrong wrapping. I made one toggle function because enable/disable functions have redundant codes and another reviewer suggested it. Is it better to separate it into two functions? Thanks, Hyunhee Kim. -----Original Message----- From: Oliver Neukum [mailto:oneukum@suse.de] Sent: Thursday, October 24, 2013 5:38 PM To: hyunhee.kim Cc: 'Dmitry Torokhov'; broonie@opensource.wolfsonmicro.com; peter.ujfalusi@ti.com; wfp5p@virginia.edu; linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; akpm@linux-foundation.org; kyungmin.park@samsung.com; 'Aristeu Sergio Rozanski Filho' Subject: Re: [PATCH v2] Input: add regulator haptic driver On Thu, 2013-10-24 at 15:35 +0900, hyunhee.kim wrote: Hi, first of all your mail client mangled the patch. > +static void regulator_haptic_toggle(struct regulator_haptic *haptic, bool > enable) > +{ > + int ret; > + > + mutex_lock(&haptic->mutex); > + if (enable && !haptic->enabled) { > + haptic->enabled = true; > + ret = regulator_enable(haptic->regulator); > + if (ret) > + dev_err(haptic->dev, "failed to enable > regulator\n"); > + } else if (!enable && haptic->enabled) { > + haptic->enabled = false; > + ret = regulator_disable(haptic->regulator); > + if (ret) > + dev_err(haptic->dev, "failed to disable > regulator\n"); > + } > + mutex_unlock(&haptic->mutex); > +} > + Is there anything gained by the toggle parameter? Just code two functions. Regards Oliver -- 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/