mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kalle Niemi <kaleposti@gmail.com>
To: Andreas Kemnade <andreas@kemnade.info>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Frank Li <Frank.Li@nxp.com>, Linus Walleij <linusw@kernel.org>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Bartosz Golaszewski <brgl@kernel.org>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i2c: i2c-core-base: fix devicetree alias handling
Date: Tue, 3 Mar 2026 10:06:18 +0200	[thread overview]
Message-ID: <5D358835-047F-4A79-B610-4DEBD562F9B4@gmail.com> (raw)

On 3/2/26 19:04, Andreas Kemnade wrote:
> Parent device is not set up there, so use the new of_node pointer to
> handle aliases.
> Fixes: 0ab80451c70f ("i2c: allow setting the parent device and OF node through the adapter struct")
> Reported-by: Kalle Niemi <kaleposti@gmail.com>
> Closes: https://lore.kernel.org/lkml/EDF3FB58-4747-442E-8463-6F1C6E568962@gmail.com/
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> ---
>  drivers/i2c/i2c-core-base.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
> index dd8cec9b04c6..e22d784202b8 100644
> --- a/drivers/i2c/i2c-core-base.c
> +++ b/drivers/i2c/i2c-core-base.c
> @@ -1657,10 +1657,9 @@ static int __i2c_add_numbered_adapter(struct i2c_adapter *adap)
>   */
>  int i2c_add_adapter(struct i2c_adapter *adapter)
>  {
> -    struct device *dev = &adapter->dev;
>      int id;
>  -    id = of_alias_get_id(dev->of_node, "i2c");
> +    id = of_alias_get_id(adapter->of_node, "i2c");
>      if (id >= 0) {
>          adapter->nr = id;
>          return __i2c_add_numbered_adapter(adapter);
> ---
> base-commit: 3fa5e5702a82d259897bd7e209469bc06368bf31
> change-id: 20260302-i2cfix-56ec3cfedff6
> Best regards,
> --
> Andreas Kemnade <andreas@kemnade.info>

Hello,

With this patch applied all previously failed tests pass now; i2c busses get indexed as described in the devicetree.

Tested-by: Kalle Niemi <kaleposti@gmail.com>

BR
Kalle

             reply	other threads:[~2026-03-03  8:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03  8:06 Kalle Niemi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-03-02 17:04 Andreas Kemnade
2026-03-03  8:46 ` Bartosz Golaszewski
2026-03-04 10:47 ` Wolfram Sang
2026-03-04 16:42   ` Bartosz Golaszewski
2026-03-04 17:00     ` Wolfram Sang
2026-03-06 10:18 ` Jon Hunter
2026-03-06 14:04   ` Jon Hunter
2026-03-07 17:26   ` Andreas Kemnade
2026-03-09  9:08     ` Bartosz Golaszewski
2026-03-09 11:40       ` Wolfram Sang

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=5D358835-047F-4A79-B610-4DEBD562F9B4@gmail.com \
    --to=kaleposti@gmail.com \
    --cc=Frank.Li@nxp.com \
    --cc=andreas@kemnade.info \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=linusw@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=wsa+renesas@sang-engineering.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

all inboxes | Powered by JetHome®