From: sashiko-bot@kernel.org
To: "Flaviu Nistor" <flaviu.nistor@gmail.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v2] hwmon: (tmp102) Use device_property_read_string API
Date: Sat, 09 May 2026 12:28:02 +0000 [thread overview]
Message-ID: <20260509122803.1FDD0C2BCB2@smtp.kernel.org> (raw)
In-Reply-To: <20260509121511.60601-1-flaviu.nistor@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch introduces an implicit header dependency and leaves cross-firmware compatibility incomplete by retaining the `of_match_ptr()` macro.
--
commit 8699d5dea7c2614372ba1cab8f6b99f73ebebe1e
Author: Flaviu Nistor <flaviu.nistor@gmail.com>
Subject: hwmon: (tmp102) Use device_property_read_string API
This patch replaces of_property_read_string() with
device_property_read_string() for reading the device label. It aims to
improve compatibility since the new method is not limited to Device Tree.
> improving the driver
> compatibility since this method is not limited to
> Device Tree only.
If the goal is to improve non-Device Tree compatibility, shouldn't
of_match_ptr() also be removed from the i2c_driver struct?
When CONFIG_OF is disabled on ACPI-only platforms, of_match_ptr()
evaluates to NULL. This prevents the standard PRP0001 mechanism from
matching the driver via compatible strings.
> diff --git a/drivers/hwmon/tmp102.c b/drivers/hwmon/tmp102.c
> index 3aa1a3fbeaa92..79578b28a91d3 100644
> --- a/drivers/hwmon/tmp102.c
> +++ b/drivers/hwmon/tmp102.c
> @@ -15,7 +15,8 @@
> #include <linux/jiffies.h>
> #include <linux/regmap.h>
> #include <linux/regulator/consumer.h>
> -#include <linux/of.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/property.h>
Does removing this include create an implicit header dependency?
The code still uses of_match_ptr() further down in the file:
drivers/hwmon/tmp102.c:
static struct i2c_driver tmp102_driver = {
.driver.name = DRIVER_NAME,
.driver.of_match_table = of_match_ptr(tmp102_of_match),
...
};
Since of_match_ptr() is defined in linux/of.h, the file now relies on
another header to implicitly include it. Dropping the of_match_ptr()
macro entirely would safely resolve this implicit dependency and fully
support the cross-firmware compatibility goal.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260509121511.60601-1-flaviu.nistor@gmail.com?part=1
next prev parent reply other threads:[~2026-05-09 12:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-09 12:15 [PATCH v2] hwmon: (tmp102) Use device_property_read_string API Flaviu Nistor
2026-05-09 12:28 ` sashiko-bot [this message]
2026-05-09 14:09 ` Guenter Roeck
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=20260509122803.1FDD0C2BCB2@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=flaviu.nistor@gmail.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=sashiko@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.