Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755311AbcDDNEW (ORCPT ); Mon, 4 Apr 2016 09:04:22 -0400 Received: from mga02.intel.com ([134.134.136.20]:30618 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754662AbcDDNEU (ORCPT ); Mon, 4 Apr 2016 09:04:20 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,440,1455004800"; d="scan'208";a="925001844" From: "Tirdea, Irina" To: Andy Shevchenko , "Rafael J. Wysocki" , Len Brown , Mika Westerberg , Linus Walleij , "linux-gpio@vger.kernel.org" , "linux-acpi@vger.kernel.org" CC: Rob Herring , Heikki Krogerus , "Purdila, Octavian" , "Ciocan, Cristina" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [RFC PATCH 2/4] pinctrl: pinconf-generic: Add ACPI support Thread-Topic: [RFC PATCH 2/4] pinctrl: pinconf-generic: Add ACPI support Thread-Index: AQHRi0MD4GB+lI18k0yoGFOe/MhTl591F86AgASxahA= Date: Mon, 4 Apr 2016 13:03:58 +0000 Deferred-Delivery: Mon, 4 Apr 2016 13:03:00 +0000 Message-ID: <1F3AC3675D538145B1661F571FE1805F2F22C79E@irsmsx105.ger.corp.intel.com> References: <1459424685-26965-1-git-send-email-irina.tirdea@intel.com> <1459424685-26965-3-git-send-email-irina.tirdea@intel.com> <1459519529.5907.198.camel@linux.intel.com> In-Reply-To: <1459519529.5907.198.camel@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDM5NmQ1NzItZWNlMS00MTNiLTkzODYtNTA3N2M0ZjJlZGRlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InlFR2Q3UE81QkUrZGhwRldUWTRDNHBoWWI2RG5sdlpyRDl6clFKQlFCXC9RPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u34D4RsO019225 Content-Length: 2896 Lines: 86 > -----Original Message----- > From: Andy Shevchenko [mailto:andriy.shevchenko@linux.intel.com] > Sent: 01 April, 2016 17:05 > To: Tirdea, Irina; Rafael J. Wysocki; Len Brown; Mika Westerberg; Linus Walleij; linux-gpio@vger.kernel.org; linux- > acpi@vger.kernel.org > Cc: Rob Herring; Heikki Krogerus; Purdila, Octavian; Ciocan, Cristina; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [RFC PATCH 2/4] pinctrl: pinconf-generic: Add ACPI support > > On Thu, 2016-03-31 at 14:44 +0300, Irina Tirdea wrote: > > Add ACPI support for the generic device tree properties. > > Convert the pinconf generic code to handle both ACPI and > > device tree by using the fwnode_property API. Also include > > renaming device tree references in names of functions and > > structures from 'dt' to 'fwnode'. > > This is looks good to me, though few style / minor comments below. Thanks for the review, Andy! > > > --- a/drivers/pinctrl/pinconf-generic.c > > +++ b/drivers/pinctrl/pinconf-generic.c > > > > > @@ -175,22 +176,22 @@ static const struct pinconf_generic_params > > dt_params[] = { > >  }; > > > >  /** > > - * parse_dt_cfg() - Parse DT pinconf parameters > > - * @np: DT node > > + * parse_fwnode_cfg() - Parse FW pinconf parameters > > + * @fw: FW node > > Here and below it should be @fwnode. OK. > > > -int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev, > > - struct device_node *np, struct pinctrl_map **map, > > +static int pinconf_generic_fwnode_subnode_to_map(struct pinctrl_dev > > *pctldev, > > + struct fwnode_handle *fwnode, struct pinctrl_map > > **map, > >   unsigned *reserved_maps, unsigned *num_maps, > >   enum pinctrl_map_type type) > >  { > > - int ret; > > + int ret, i; > > Since you change this line anyway, perhaps move it to be last in the > definition block? > > >   const char *function; > >   struct device *dev = pctldev->dev; > >   unsigned long *configs = NULL; > >   unsigned num_configs = 0; > >   unsigned reserve, strings_count; > > - struct property *prop; > > - const char *group; > > + const char **groups; > >   const char *subnode_target_type = "pins"; > > ...to here. > Sure. > > +#ifdef CONFIG_OF > > +inline int pinconf_generic_parse_dt_config(struct device_node *np, > > +    struct pinctrl_dev > > *pctldev, > > +    unsigned long **configs, > > +    unsigned int *nconfigs) > > +{ > > + return pinconf_generic_parse_fwnode_config(&np->fwnode, > > pctldev, > > +    configs, > > nconfigs); > > +} > > I didn't see any user of this. pinconf_generic_parse_dt_config is defined in drivers/pinctrl/pinconf.h and is used by various pinctrl drivers(e.g.: drivers/pinctrl/nomadik/pinctrl-abx500.c, drivers/pinctrl/pinctrl-tz1090-pdc.c, drivers/pinctrl/pinctrl-tz1090.c). Taking a closer look at its prototype, I should match it here exactly (by removing inline).