Re: [PATCH] i2c: i2c-core-base: fix devicetree alias handling

From: Bartosz Golaszewski

Date: Mon Mar 09 2026 - 05:08:51 EST


On Sat, Mar 7, 2026 at 6:27 PM Andreas Kemnade <andreas@xxxxxxxxxxxx> wrote:
>
> On Fri, 6 Mar 2026 10:18:09 +0000
> Jon Hunter <jonathanh@xxxxxxxxxx> wrote:
>
> [...]
>
> > /sys/class/i2c-dev/i2c-0/name --> 3160000.i2c
> > /sys/class/i2c-dev/i2c-1/name --> c240000.i2c
> > /sys/class/i2c-dev/i2c-4/name --> Tegra BPMP I2C adapter
> > /sys/class/i2c-dev/i2c-8/name --> 31e0000.i2c
> >
> > After this change I now see ...
> >
> > /sys/class/i2c-dev/i2c-9/name --> Tegra BPMP I2C adapter
> > /sys/class/i2c-dev/i2c-10/name --> 3160000.i2c
> > /sys/class/i2c-dev/i2c-11/name --> 31e0000.i2c
> > /sys/class/i2c-dev/i2c-12/name --> c240000.i2c
> >
> > So the subject says that this fixes device-tree aliases, but it appears
> > to break it for Tegra. In fact, this patch appears to have the same
> > problem that you reported with Bartosz's change. Reverting this change
> > fixes the problem. So I am a bit confused why we are seeing different
> > behaviour.
> >
> Hmm, i2c-tegra.c was forgotten in Bartosz's change because
> the code looks a bit different.
>

It was not forgotten, rather my series only changed a part of the
users and I was planning to continue the work but it seems like Johan
committed to attempting to rework i2c using a different approach[1].

Wolfram: do you want to drop these patches from your v7.1 queue then?

Bartosz

> There is still
> i2c_dev->adapter.dev.of_node = i2c_dev->dev->of_node;
> i2c_dev->adapter.dev.parent = i2c_dev->dev;
> there.
> compared to
> adap->parent = &pdev->dev;
> adap->of_node = pdev->dev.of_node;
>
> in omap code. So I think, the easiest to get forward is to
> also adapt i2c-tegra.c.
>
> Regards,
> Andreas

[1] https://lore.kernel.org/all/aar3rj7Db6NmTVS_@xxxxxxxxxxxxxxxxxxxx/