mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Michal Simek <michal.simek@xilinx.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Alessandro Rubini <rubini@unipv.it>,
	Heiko Stuebner <heiko@sntech.de>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	"linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>,
	"Ivan T. Ivanov" <iivanov@mm-sol.com>,
	Bjorn Andersson <bjorn.andersson@sonymobile.com>,
	Beniamino Galvani <b.galvani@gmail.com>
Subject: Re: [PATCH v2 1/7] pinctrl: pinconf-generic: Infer map type from DT property
Date: Wed, 3 Dec 2014 15:04:27 -0800	[thread overview]
Message-ID: <942cd3fb168944d5a3379b8312bc6894@BY2FFO11FD047.protection.gbl> (raw)
In-Reply-To: <CACRpkdbd2cAD5osYnwKTg4d1MwSjNF9i3Y+6ryjc_qLsg46Wtg@mail.gmail.com>

Hi Linus,

On Tue, 2014-12-02 at 04:01PM +0100, Linus Walleij wrote:
> On Fri, Nov 28, 2014 at 2:26 AM, Soren Brinkmann
> <soren.brinkmann@xilinx.com> wrote:
> 
> > With the new 'groups' property, the DT parser can infer the map type
> > from the fact whether 'pins' or 'groups' is used to specify the pin
> > group to work on.
> > To maintain backwards compatibitliy with current usage of the DT
> > binding, this is only done when an invalid map type is passed to the
> > parsing function.
> >
> > Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
> > Tested-by: Andreas Färber <afaerber@suse.de>
> > ---
> > Changes since RFC v2:
> >  - none
> 
> OK there are problems with this.
> 
> > @@ -264,6 +264,7 @@ int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
> >         unsigned reserve;
> >         struct property *prop;
> >         const char *group;
> > +       const char *dt_pin_specifier = "pins";
> 
> Something called "dt_pin_specifier" contains the string "pins"...
> 
> >
> >         ret = of_property_read_string(np, "function", &function);
> >         if (ret < 0) {
> > @@ -284,10 +285,20 @@ int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
> >                 reserve++;
> >         if (num_configs)
> >                 reserve++;
> > +
> >         ret = of_property_count_strings(np, "pins");
> >         if (ret < 0) {
> > -               dev_err(dev, "could not parse property pins\n");
> > -               goto exit;
> > +               ret = of_property_count_strings(np, "groups");
> > +               if (ret < 0) {
> > +                       dev_err(dev, "could not parse property pins/groups\n");
> > +                       goto exit;
> > +               }
> > +               if (type == PIN_MAP_TYPE_INVALID)
> > +                       type = PIN_MAP_TYPE_CONFIGS_GROUP;
> > +               dt_pin_specifier = "groups";
> 
> Then suddenly "groups".
> 
> The pointer variable should be named something like "subnode_target_type"
> or so.

I will rename it accordingly in the next version.

> 
> > +++ b/include/linux/pinctrl/pinconf-generic.h
> > @@ -174,6 +174,13 @@ static inline int pinconf_generic_dt_node_to_map_pin(
> >                         PIN_MAP_TYPE_CONFIGS_PIN);
> >  }
> >
> > +static inline int pinconf_generic_dt_node_to_map_all(
> > +               struct pinctrl_dev *pctldev, struct device_node *np_config,
> > +               struct pinctrl_map **map, unsigned *num_maps)
> > +{
> > +       return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps,
> > +                       PIN_MAP_TYPE_INVALID);
> > +}
> 
> First add some comment describing what happens here and why
> INVALID is specified.
> 
> Then what does this have to do with the $subject?
> 
> Atleast mention in the commit text that a new helper is added, though unused.

Ok. I'll put a comment in the header and one or two sentences regarding
this helper in the commit message.

	Thanks,
	Sören

  reply	other threads:[~2014-12-03 23:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-28  1:26 [PATCH v2 0/7] Pinctrl support for Zynq Soren Brinkmann
2014-11-28  1:26 ` [PATCH v2 1/7] pinctrl: pinconf-generic: Infer map type from DT property Soren Brinkmann
2014-12-02 15:01   ` Linus Walleij
2014-12-03 23:04     ` Sören Brinkmann [this message]
2014-11-28  1:26 ` [PATCH v2 2/7] pinctrl: pinconf-generic: Allow driver to specify DT params Soren Brinkmann
2014-11-28  1:26 ` [PATCH v2 3/7] pinctrl: zynq: Document DT binding Soren Brinkmann
2014-11-28  1:26 ` [PATCH v2 4/7] pinctrl: Add driver for Zynq Soren Brinkmann
2014-11-28  1:26 ` [PATCH v2 5/7] ARM: zynq: Enable pinctrl Soren Brinkmann
2014-11-28  1:26 ` [PATCH v2 6/7] ARM: zynq: DT: Add pinctrl information Soren Brinkmann
2014-11-28  1:26 ` [PATCH v2 7/7] pinctrl: qcom-spmi-gpio: Migrate to pinconf-generic Soren Brinkmann
2014-12-03 13:03   ` Ivan T. Ivanov
2014-12-03 17:38     ` Sören Brinkmann
2014-12-04  9:30       ` Ivan T. Ivanov
2014-12-04 17:21         ` Sören Brinkmann
2014-12-05  7:59   ` Ivan T. Ivanov
2014-12-05 17:08     ` Sören Brinkmann
2014-12-05 17:37       ` Sören Brinkmann
2014-12-12 16:21       ` Sören Brinkmann
2014-12-03 12:51 ` [PATCH v2 0/7] Pinctrl support for Zynq Ivan T. Ivanov
2014-12-03 17:59   ` Sören Brinkmann
2014-12-04  9:44 ` Linus Walleij
2014-12-04 17:28   ` Sören Brinkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=942cd3fb168944d5a3379b8312bc6894@BY2FFO11FD047.protection.gbl \
    --to=soren.brinkmann@xilinx.com \
    --cc=b.galvani@gmail.com \
    --cc=bjorn.andersson@sonymobile.com \
    --cc=heiko@sntech.de \
    --cc=iivanov@mm-sol.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=rubini@unipv.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®