All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saravana Kannan <saravanak@google.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-tegra <linux-tegra@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Jon Hunter <jonathanh@nvidia.com>, Marc Zyngier <maz@kernel.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Android Kernel Team <kernel-team@android.com>
Subject: Re: [PATCH v1 1/2] of: property: Add fw_devlink support for "gpio" and "gpios" binding
Date: Thu, 21 Jan 2021 10:29:54 -0800	[thread overview]
Message-ID: <CAGETcx9HFtnuA=XDdbXOq+HEEkbtpQ7J7Nz4uTWhoswZbHpsfw@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdbEC6duR=fJQD_Nw9o=HW0DEe2_Ks3SYCgJmkOjzKz3Jg@mail.gmail.com>

On Thu, Jan 21, 2021 at 5:11 AM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Wed, Jan 20, 2021 at 9:05 AM Saravana Kannan <saravanak@google.com> wrote:
>
> > To provide backward compatibility for boards that use deprecated DT
> > bindings, we need to add fw_devlink support for "gpio" and "gpios".
>
> You do some more stuff in the patch so describe that too.
> Especially the check for hogs and #gpio-cells.
> Describe why you do that. Maybe even with a comment in
> the code because I don't think everyone will understand.

Ack

>
> > +       if (strcmp(prop_name, "gpio") && strcmp(prop_name, "gpios"))
> > +               return NULL;
>
> This part is easy to understand.
>
> > +       if (of_find_property(np, "gpio-hog", NULL))
> > +               return NULL;
> > +
> > +       if (of_parse_phandle_with_args(np, prop_name, "#gpio-cells", index,
> > +                                      &sup_args))
> > +               return NULL;
>
> This part is hard to understand. Insert comments and tell the reader
> of the code what is going on and why.

I assume the "hard to understand" part is the gpio-hog part? Because
the last line is pretty straightforward -- it's returning the index-th
phandle. Also, it's a copy-paste from the DEFINE_SIMPLE_PROP macro.


-Saravana

  reply	other threads:[~2021-01-21 18:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20  8:05 [PATCH v1 0/2] of: property: Add fw_devlink support for more props Saravana Kannan
2021-01-20  8:05 ` [PATCH v1 1/2] of: property: Add fw_devlink support for "gpio" and "gpios" binding Saravana Kannan
2021-01-20 15:40   ` Rob Herring
2021-01-20 17:24   ` Thierry Reding
2021-01-21 13:11   ` Linus Walleij
2021-01-21 18:29     ` Saravana Kannan [this message]
2021-01-20  8:05 ` [PATCH v1 2/2] of: property: Add fw_devlink support for interrupts Saravana Kannan
2021-01-20 15:40   ` Rob Herring
2021-01-20 17:24   ` Thierry Reding
2021-01-21 13:12   ` Linus Walleij

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='CAGETcx9HFtnuA=XDdbXOq+HEEkbtpQ7J7Nz4uTWhoswZbHpsfw@mail.gmail.com' \
    --to=saravanak@google.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonathanh@nvidia.com \
    --cc=kernel-team@android.com \
    --cc=khilman@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=robh+dt@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.