From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Support Opensource <support.opensource@diasemi.com>,
Linus Walleij <linusw@kernel.org>,
Charles Keepax <ckeepax@opensource.cirrus.com>,
Laxman Dewangan <ldewangan@nvidia.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
Lee Jones <lee@kernel.org>, Joseph Chen <chenjh@rock-chips.com>,
Heiko Stuebner <heiko@sntech.de>,
Herve Codina <herve.codina@bootlin.com>,
Christophe Leroy <chleroy@kernel.org>,
David Rhodes <david.rhodes@cirrus.com>,
Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>,
Nikita Shubin <nikita.shubin@maquefel.me>,
Bartosz Golaszewski <brgl@kernel.org>,
Haotian Zhang <vulab@iscas.ac.cn>,
linux-gpio@vger.kernel.org, linux-sound@vger.kernel.org,
patches@opensource.cirrus.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/12] pinctrl: devicetree: Factor out dt_find_controller() helper
Date: Sat, 5 Dec 2026 14:01:12 +0200 [thread overview]
Message-ID: <axP9CAK_0k6GAOye@ashevche-desk.local> (raw)
In-Reply-To: <20261204-pinctrl-fwnode-fix-v1-1-8589cbd35fb2@gmail.com>
On Fri, Dec 04, 2026 at 10:38:29PM -0800, Dmitry Torokhov wrote:
> Move the ancestor walk that locates the pin controller for a DT
> configuration node out of dt_to_map_one_config() into a new
> dt_find_controller() helper using __free(device_node) to manage the
> device node reference across all exit paths. Return an ERR_PTR() on
> lookup failure, NULL when skipping a self-referenced hog, or the matched
> controller pointer, eliminating the magic return value of 1 between
> dt_to_map_one_config() and pinctrl_dt_to_map().
>
> No functional change intended.
Is it just for keeping exit paths unified in terms of device node references?
I think the commit message needs more elaboration on "why?".
...
> +static int dt_to_map_one_config(struct pinctrl *p,
> + struct pinctrl_dev *hog_pctldev,
> + const char *statename,
> + struct device_node *np_config)
> +{
> + struct pinctrl_dev *pctldev;
> + const struct pinctrl_ops *ops;
> + int ret;
> + struct pinctrl_map *map;
> + unsigned int num_maps;
Make it reversed xmas tree order, please.
> + pctldev = dt_find_controller(p, hog_pctldev, np_config);
> + if (IS_ERR(pctldev))
> + return PTR_ERR(pctldev);
> + if (!pctldev)
> + return 0;
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-12-05 12:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-05 6:38 [PATCH 00/12] pinctrl: Fix firmware node reference count underflows Dmitry Torokhov
2026-12-05 6:38 ` [PATCH 01/12] pinctrl: devicetree: Factor out dt_find_controller() helper Dmitry Torokhov
2026-12-05 12:01 ` Andy Shevchenko [this message]
2026-12-05 6:38 ` [PATCH 02/12] pinctrl: devicetree: Do not re-claim hogs for sibling devices Dmitry Torokhov
2026-12-05 6:38 ` [PATCH 03/12] pinctrl: Add optional fwnode to struct pinctrl_desc Dmitry Torokhov
2026-12-05 12:07 ` Andy Shevchenko
2026-12-05 6:38 ` [PATCH 04/12] pinctrl: da9062: Fix firmware node reference count underflow Dmitry Torokhov
2026-12-05 6:38 ` [PATCH 05/12] pinctrl: as3722: " Dmitry Torokhov
2026-12-05 6:38 ` [PATCH 06/12] pinctrl: max77620: " Dmitry Torokhov
2026-12-05 6:38 ` [PATCH 07/12] pinctrl: madera: " Dmitry Torokhov
2026-12-05 6:38 ` [PATCH 08/12] pinctrl: rk805: " Dmitry Torokhov
2026-12-05 6:38 ` [PATCH 09/12] pinctrl: pef2256: " Dmitry Torokhov
2026-12-05 6:38 ` [PATCH 10/12] pinctrl: cirrus: cs42l43: " Dmitry Torokhov
2026-12-05 6:38 ` [PATCH 11/12] pinctrl: max7360: Pass parent fwnode via pinctrl_desc Dmitry Torokhov
2026-12-05 6:38 ` [PATCH 12/12] pinctrl: ep93xx: " Dmitry Torokhov
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=axP9CAK_0k6GAOye@ashevche-desk.local \
--to=andriy.shevchenko@linux.intel.com \
--cc=brgl@kernel.org \
--cc=chenjh@rock-chips.com \
--cc=chleroy@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=david.rhodes@cirrus.com \
--cc=dmitry.torokhov@gmail.com \
--cc=heiko@sntech.de \
--cc=herve.codina@bootlin.com \
--cc=ldewangan@nvidia.com \
--cc=lee@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mathieu.dubois-briand@bootlin.com \
--cc=nikita.shubin@maquefel.me \
--cc=patches@opensource.cirrus.com \
--cc=rf@opensource.cirrus.com \
--cc=support.opensource@diasemi.com \
--cc=vulab@iscas.ac.cn \
/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®