Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754403AbaJHSNW (ORCPT ); Wed, 8 Oct 2014 14:13:22 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:61496 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753400AbaJHSNT (ORCPT ); Wed, 8 Oct 2014 14:13:19 -0400 Date: Wed, 8 Oct 2014 11:13:14 -0700 From: Dmitry Torokhov To: Stephen Boyd Cc: "Ivan T. Ivanov" , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH 2/4] Input: pmic8xxx-keypad - use regmap_field for register access Message-ID: <20141008181314.GC14423@dtor-ws> References: <1412675448-11990-1-git-send-email-iivanov@mm-sol.com> <1412675448-11990-3-git-send-email-iivanov@mm-sol.com> <20141007172606.GG16469@dtor-ws> <1412759584.13569.0.camel@iivanov-dev> <1412760633.13569.4.camel@iivanov-dev> <54357BA7.3010609@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54357BA7.3010609@codeaurora.org> 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 On Wed, Oct 08, 2014 at 11:00:07AM -0700, Stephen Boyd wrote: > On 10/08/2014 02:30 AM, Ivan T. Ivanov wrote: > >On Wed, 2014-10-08 at 12:13 +0300, Ivan T. Ivanov wrote: > >>On Tue, 2014-10-07 at 10:26 -0700, Dmitry Torokhov wrote: > >>>Hi Ivan, > >>> > >>>On Tue, Oct 07, 2014 at 12:50:46PM +0300, Ivan T. Ivanov wrote: > >>>>@@ -527,10 +538,55 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev) > >>>>+ > >>>>+ kp->row_hold = devm_regmap_field_alloc(kp->dev, kp->regmap, > >>>>+ info->row_hold); > >>>>+ if (IS_ERR(kp->row_hold)) > >>>>+ return PTR_ERR(kp->row_hold); > >>>Why do we have to allocate all regmap fields separately instead of > >>>embedding them into keypad structure? > >>> > >>No particular reason. Will rework it. > >> > >Oops. struct regmap_field is opaque. It seems that the allocation > >is the only way that I could have instance of it. > > > > Maybe we can add an API to allocate an array of fields? Maybe we could make the structure public instead? I do not see any reason for allocating something separately that has exactly the same lifetime as owning structure. 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/