Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Svyatoslav Ryhel" <clamor95@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 2/4] iio: light: ltr501: Switch to modern match mechanism
Date: Fri, 06 Nov 2026 09:37:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-201134@kernel.org> (raw)
In-Reply-To: <20261106091943.35783-3-clamor95@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] iio: light: ltr501: unintended sysfs name change in
  ltr501_probe()
--

commit 1e03d9253f6f315d8f95ed562a39ab7edc44ec2b
Author: Svyatoslav Ryhel <clamor95@gmail.com>

iio: light: ltr501: Switch to modern match mechanism

This commit replaces the chip enum and array with per-chip info structs
retrieved via i2c_get_match_data().

> diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
> index cc5d7af44d77c..d5ce6468a229b 100644
> --- a/drivers/iio/light/ltr501.c
> +++ b/drivers/iio/light/ltr501.c

[ ... ]

> @@ -1480,18 +1471,10 @@ static int ltr501_probe(struct i2c_client *client)
>  	if (ret < 0)
>  		return ret;
>  
> -	if (id) {
> -		name = id->name;
> -		chip_idx = id->driver_data;
> -	} else {
> -		name = iio_get_acpi_device_name_and_data(&client->dev, &ddata);
> -		chip_idx = (intptr_t)ddata;
> -	}
> -	if (!name)
> +	data->chip_info = i2c_get_match_data(client);
> +	if (!data->chip_info)
>  		return -ENODEV;
>  
> -	data->chip_info = &ltr501_chip_info_tbl[chip_idx];
> -
>  	if ((partid >> 4) != data->chip_info->partid)
>  		return -ENODEV;
>  
> @@ -1502,7 +1485,7 @@ static int ltr501_probe(struct i2c_client *client)
>  	indio_dev->info = &ltr501_info;
>  	indio_dev->channels = data->chip_info->channels;
>  	indio_dev->num_channels = data->chip_info->no_channels;
> -	indio_dev->name = name;
> +	indio_dev->name = client->name;
>  	indio_dev->modes = INDIO_DIRECT_MODE;

[Severity: Medium]
Does assigning client->name to indio_dev->name change the exported IIO
sysfs device name on ACPI systems?

Previously, iio_get_acpi_device_name_and_data() returned
dev_name(&client->dev), which is "i2c-LTER0301:00" or "i2c-LTER0303:00".
For ACPI-enumerated I2C clients, i2c_acpi_get_info() populates
client->name from the ACPI device name without the "i2c-" prefix
("LTER0301:00" / "LTER0303:00"), altering the user-visible
/sys/bus/iio/devices/iio:deviceX/name attribute (neither preserving the
legacy ACPI name nor using the canonical chip name from chip_info).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261106091943.35783-1-clamor95@gmail.com?part=2

  reply	other threads:[~2026-11-06  9:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06  9:19 [PATCH v2 0/4] iio: light: ltr501: Add LTR-659PS-01 prox sensor support Svyatoslav Ryhel
2026-11-06  9:19 ` [PATCH v2 1/4] iio: light: ltr501: Switch to read_avail() op from manual attribute registration Svyatoslav Ryhel
2026-11-06  9:29   ` sashiko-bot
2026-11-07  3:20   ` Jonathan Cameron
2026-11-07 10:10     ` Svyatoslav Ryhel
2026-11-07 10:59       ` Joshua Crofts
2026-11-06  9:19 ` [PATCH v2 2/4] iio: light: ltr501: Switch to modern match mechanism Svyatoslav Ryhel
2026-11-06  9:37   ` sashiko-bot [this message]
2026-11-07  3:30   ` Jonathan Cameron
2026-11-07 10:13     ` Svyatoslav Ryhel
2026-11-07 19:51       ` Jonathan Cameron
2026-11-06  9:19 ` [PATCH v2 3/4] dt-bindings: iio: light: ltr501: Document LTR659 proximity sensor Svyatoslav Ryhel
2026-11-06 17:31   ` Conor Dooley
2026-11-06  9:19 ` [PATCH v2 4/4] iio: light: ltr501: Add support for the LTR-659PS-01 " Svyatoslav Ryhel
2026-11-06  9:31   ` sashiko-bot
2026-11-07  3:33   ` Jonathan Cameron
2026-11-07 10:15     ` Svyatoslav Ryhel
2026-11-07 19:43       ` Jonathan Cameron

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=sashiko-outbox-201134@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=clamor95@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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