* [PATCH v2] iio: cdc: ad7150: fix OF matching and publish module aliases
@ 2026-09-20 3:33 Pengpeng Hou
2026-09-22 10:26 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Pengpeng Hou @ 2026-09-20 3:33 UTC (permalink / raw)
To: nuno.sa
Cc: michael.hennerich, jic23, dlechner, andy, linux, linux-iio,
linux-kernel, hppiscas
The OF match entries use positional initializers, which initialize the
name field rather than compatible. Consequently the advertised AD7150,
AD7151 and AD7156 compatible strings do not describe OF compatible
matches. The table is also not exported for module alias generation.
Use designated compatible initializers and publish the OF table. Keep
the existing I2C ID table and its device-variant selection unchanged.
The issue was found by our static-analysis tool.
Fixes: 89f2d5b080bc ("staging:iio:cdc:ad7150: Add of_match_table")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
Changes since v1:
https://lore.kernel.org/all/20260905133939.66210-1-hppiscas@163.com/
Use the submitter's full name and rebase on current mainline; retain the
reviewed code change.
drivers/iio/cdc/ad7150.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/cdc/ad7150.c b/drivers/iio/cdc/ad7150.c
index 2f35c6d2f9ce..b36ac4e2dae8 100644
--- a/drivers/iio/cdc/ad7150.c
+++ b/drivers/iio/cdc/ad7150.c
@@ -636,11 +636,13 @@ static const struct i2c_device_id ad7150_id[] = {
MODULE_DEVICE_TABLE(i2c, ad7150_id);
static const struct of_device_id ad7150_of_match[] = {
- { "adi,ad7150" },
- { "adi,ad7151" },
- { "adi,ad7156" },
+ { .compatible = "adi,ad7150" },
+ { .compatible = "adi,ad7151" },
+ { .compatible = "adi,ad7156" },
{ }
};
+MODULE_DEVICE_TABLE(of, ad7150_of_match);
+
static struct i2c_driver ad7150_driver = {
.driver = {
.name = "ad7150",
base-commit: 518e5b794c06c0f0eb40df3e202274a66202c137
--
2.50.1 (Apple Git-155)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] iio: cdc: ad7150: fix OF matching and publish module aliases
2026-09-20 3:33 [PATCH v2] iio: cdc: ad7150: fix OF matching and publish module aliases Pengpeng Hou
@ 2026-09-22 10:26 ` Andy Shevchenko
2026-09-25 1:50 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2026-09-22 10:26 UTC (permalink / raw)
To: Pengpeng Hou
Cc: nuno.sa, michael.hennerich, jic23, dlechner, andy, linux,
linux-iio, linux-kernel
On Sun, Sep 20, 2026 at 11:33:03AM +0800, Pengpeng Hou wrote:
> The OF match entries use positional initializers, which initialize the
> name field rather than compatible. Consequently the advertised AD7150,
> AD7151 and AD7156 compatible strings do not describe OF compatible
> matches. The table is also not exported for module alias generation.
>
> Use designated compatible initializers and publish the OF table. Keep
> the existing I2C ID table and its device-variant selection unchanged.
>
> The issue was found by our static-analysis tool.
>
> Fixes: 89f2d5b080bc ("staging:iio:cdc:ad7150: Add of_match_table")
> Assisted-by: gpt 5
Assisted-by: LLM
> Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Same to other patches with similar tag.
...
TBH, except the commit message I can't see how LLM could be helpful to the
code. It's quite a simple change...
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] iio: cdc: ad7150: fix OF matching and publish module aliases
2026-09-22 10:26 ` Andy Shevchenko
@ 2026-09-25 1:50 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2026-09-25 1:50 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Pengpeng Hou, nuno.sa, michael.hennerich, dlechner, andy, linux,
linux-iio, linux-kernel
On Tue, 22 Sep 2026 13:26:51 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Sun, Sep 20, 2026 at 11:33:03AM +0800, Pengpeng Hou wrote:
> > The OF match entries use positional initializers, which initialize the
> > name field rather than compatible. Consequently the advertised AD7150,
> > AD7151 and AD7156 compatible strings do not describe OF compatible
> > matches. The table is also not exported for module alias generation.
> >
> > Use designated compatible initializers and publish the OF table. Keep
> > the existing I2C ID table and its device-variant selection unchanged.
> >
> > The issue was found by our static-analysis tool.
> >
> > Fixes: 89f2d5b080bc ("staging:iio:cdc:ad7150: Add of_match_table")
> > Assisted-by: gpt 5
>
> Assisted-by: LLM
>
> > Signed-off-by: Pengpeng Hou <hppiscas@163.com>
>
> Same to other patches with similar tag.
>
> ...
>
> TBH, except the commit message I can't see how LLM could be helpful to the
> code. It's quite a simple change...
>
Applied with the Assisted by tweaked.
Thanks,
Jonathan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-25 1:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-20 3:33 [PATCH v2] iio: cdc: ad7150: fix OF matching and publish module aliases Pengpeng Hou
2026-09-22 10:26 ` Andy Shevchenko
2026-09-25 1:50 ` Jonathan Cameron
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®