From: Linus Walleij <linus.walleij@linaro.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Marc Zyngier" <maz@kernel.org>,
"Matti Vaittinen" <matti.vaittinen@fi.rohmeurope.com>,
"Sergio Paracuellos" <sergio.paracuellos@gmail.com>,
"Chunyan Zhang" <chunyan.zhang@unisoc.com>,
"Bartosz Golaszewski" <brgl@bgdev.pl>,
"Baruch Siach" <baruch@tkos.co.il>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Tony Lindgren" <tony@atomide.com>,
"Nicolas Saenz Julienne" <nsaenz@kernel.org>,
"Jianqun Xu" <jay.xu@rock-chips.com>,
"Alexandru Ardelean" <aardelean@deviqon.com>,
"Thierry Reding" <treding@nvidia.com>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@opensource.cirrus.com,
bcm-kernel-feedback-list@broadcom.com,
linux-power@fi.rohmeurope.com,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-pwm@vger.kernel.org,
linux-omap@vger.kernel.org, linux-unisoc@lists.infradead.org,
linux-rockchip@lists.infradead.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-tegra@vger.kernel.org, "Ray Jui" <rjui@broadcom.com>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"Scott Branden" <sbranden@broadcom.com>,
"Gregory Fong" <gregory.0xf0@gmail.com>,
"Eugeniy Paltsev" <Eugeniy.Paltsev@synopsys.com>,
Keerthy <j-keerthy@ti.com>, "Orson Zhai" <orsonzhai@gmail.com>,
"Baolin Wang" <baolin.wang7@gmail.com>,
"Chunyan Zhang" <zhang.lyra@gmail.com>,
"Vladimir Zapolskiy" <vz@mleia.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Thierry Reding" <thierry.reding@gmail.com>,
"Lee Jones" <lee.jones@linaro.org>,
"Grygorii Strashko" <grygorii.strashko@ti.com>,
"Santosh Shilimkar" <ssantosh@kernel.org>,
"Kevin Hilman" <khilman@kernel.org>,
"Robert Jarzmik" <robert.jarzmik@free.fr>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Heiko Stuebner" <heiko@sntech.de>,
"Ludovic Desroches" <ludovic.desroches@microchip.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Jonathan Hunter" <jonathanh@nvidia.com>
Subject: Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
Date: Sun, 5 Dec 2021 01:06:07 +0100 [thread overview]
Message-ID: <CACRpkdZbpKqG_uS2N8TW2-HL5CqnuKDpHVCabf66MyQQof0jOw@mail.gmail.com> (raw)
In-Reply-To: <20211202210839.79140-1-andriy.shevchenko@linux.intel.com>
On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This is definitely a patch in the right direction, as Bart says
it can be a bit dangerous, the outliers are those drivers that
assign the .dev to something completely different than the
the dev where the of_node is copied from.
The idea was definitely always to only assign it in the core
*unless* there is a reason to have a completely different
of_node for some reason.
> +++ b/drivers/gpio/gpio-rda.c
> @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
> rda_gpio->chip.label = dev_name(dev);
> rda_gpio->chip.ngpio = ngpios;
> rda_gpio->chip.base = -1;
> - rda_gpio->chip.parent = dev;
> - rda_gpio->chip.of_node = np;
Mention in the commit message that in this driver
you also drop the the .parent assignment because the
core will handle it.
Yours,
Linus Walleij
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-12-05 0:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20211202210839.79140-1-andriy.shevchenko@linux.intel.com>
2021-12-03 8:40 ` [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers Bartosz Golaszewski
2021-12-03 12:25 ` Andy Shevchenko
2021-12-05 0:06 ` Linus Walleij [this message]
2021-12-06 13:11 ` Andy Shevchenko
2021-12-06 13:19 ` Bartosz Golaszewski
2021-12-07 8:03 ` Uwe Kleine-König
2021-12-07 8:05 ` Baruch Siach
2021-12-07 10:43 ` Andy Shevchenko
2021-12-13 13:50 ` Bartosz Golaszewski
2021-12-13 14:04 ` Andy Shevchenko
2021-12-17 16:54 ` Bartosz Golaszewski
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=CACRpkdZbpKqG_uS2N8TW2-HL5CqnuKDpHVCabf66MyQQof0jOw@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=Eugeniy.Paltsev@synopsys.com \
--cc=aardelean@deviqon.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=baolin.wang7@gmail.com \
--cc=baruch@tkos.co.il \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=brgl@bgdev.pl \
--cc=chunyan.zhang@unisoc.com \
--cc=f.fainelli@gmail.com \
--cc=gregory.0xf0@gmail.com \
--cc=grygorii.strashko@ti.com \
--cc=heiko@sntech.de \
--cc=j-keerthy@ti.com \
--cc=jay.xu@rock-chips.com \
--cc=jonathanh@nvidia.com \
--cc=khilman@kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-power@fi.rohmeurope.com \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-unisoc@lists.infradead.org \
--cc=ludovic.desroches@microchip.com \
--cc=mani@kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=maz@kernel.org \
--cc=mcoquelin.stm32@gmail.com \
--cc=nsaenz@kernel.org \
--cc=orsonzhai@gmail.com \
--cc=patches@opensource.cirrus.com \
--cc=rjui@broadcom.com \
--cc=robert.jarzmik@free.fr \
--cc=sbranden@broadcom.com \
--cc=sergio.paracuellos@gmail.com \
--cc=ssantosh@kernel.org \
--cc=thierry.reding@gmail.com \
--cc=tony@atomide.com \
--cc=treding@nvidia.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=vz@mleia.com \
--cc=zhang.lyra@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).