From: Michael Walle <michael@walle.cc>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Álvaro Fernández Rojas" <noltari@gmail.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] gpio: regmap: set gpio_chip of_node
Date: Thu, 04 Mar 2021 16:31:20 +0100 [thread overview]
Message-ID: <7b12985726c898d63d882486f01a60d7@walle.cc> (raw)
In-Reply-To: <CAHp75Vc6azROSAc=ZUjY+VhAjZDMsukr2ZY1fQHMFwncL7_AbQ@mail.gmail.com>
Am 2021-03-04 16:22, schrieb Andy Shevchenko:
> On Thu, Mar 4, 2021 at 5:18 PM Álvaro Fernández Rojas
> <noltari@gmail.com> wrote:
>>
>> This is needed for properly registering gpio regmap as a child of a
>> regmap
>> pin controller.
>
>> + chip->of_node = config->of_node ?:
>> dev_of_node(config->parent);
>
> After a closer look I have no clue why you need this patch at all.
> The second part, i.e. assigning parent's fwnode, is done already in
> the GPIO library core.
> The first part, keeping fwnode in the regmap configuration puzzles me.
> Why?
You're right if chip->of_node is not set it will eventually be set to
node of the parent device.
In case of the BCM driver the parent device is the pinctrl device and
the node is a children (if that is correct I cannot say). So, in this
case you cannot use the node of the parent, because that would be the
pinctrl one.
You could just use
chip->of_node = dev_of_node(config->parent)
But then it is not obvious that it is optional. Hence my suggestion
to explicitly set to the parent of_node if none is supplied.
-michael
next prev parent reply other threads:[~2021-03-04 15:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-04 7:15 [PATCH v2] gpio: regmap: set gpio_chip of_node Álvaro Fernández Rojas
2021-03-04 8:18 ` Michael Walle
2021-03-04 8:27 ` Álvaro Fernández Rojas
2021-03-04 15:22 ` Andy Shevchenko
2021-03-04 15:26 ` Álvaro Fernández Rojas
2021-03-04 15:31 ` Michael Walle [this message]
2021-03-17 16:06 ` kernel test robot
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=7b12985726c898d63d882486f01a60d7@walle.cc \
--to=michael@walle.cc \
--cc=andy.shevchenko@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=noltari@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).