From: Andrew Davis <afd@ti.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: <linux-rtc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Andrew Davis <afd@ti.com>
Subject: [PATCH v2 6/6] rtc: rx8025: Remove use of i2c_match_id()
Date: Thu, 5 Mar 2026 13:35:45 -0600 [thread overview]
Message-ID: <20260305193545.796294-7-afd@ti.com> (raw)
In-Reply-To: <20260305193545.796294-1-afd@ti.com>
The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().
This helper has a couple other benefits:
* It doesn't need the i2c_device_id passed in so we do not need
to have that forward declared, allowing us to remove those or
move the i2c_device_id table down to its more natural spot
with the other module info.
* It also checks for device match data, which allows for OF and
ACPI based probing. That means we do not have to manually check
those first and can remove those checks.
Signed-off-by: Andrew Davis <afd@ti.com>
---
drivers/rtc/rtc-rx8025.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c
index ced6e7adfe8d0..c57081f9e02b4 100644
--- a/drivers/rtc/rtc-rx8025.c
+++ b/drivers/rtc/rtc-rx8025.c
@@ -522,7 +522,6 @@ static const struct attribute_group rx8025_attr_group = {
static int rx8025_probe(struct i2c_client *client)
{
- const struct i2c_device_id *id = i2c_match_id(rx8025_id, client);
struct i2c_adapter *adapter = client->adapter;
struct rx8025_data *rx8025;
int err = 0;
@@ -540,8 +539,7 @@ static int rx8025_probe(struct i2c_client *client)
i2c_set_clientdata(client, rx8025);
- if (id)
- rx8025->model = id->driver_data;
+ rx8025->model = (uintptr_t)i2c_get_match_data(client);
err = rx8025_init_client(client);
if (err)
--
2.39.2
next prev parent reply other threads:[~2026-03-05 19:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 19:35 [PATCH v2 0/6] Remove use of i2c_match_id in RTC Andrew Davis
2026-03-05 19:35 ` [PATCH v2 1/6] rtc: abx80x: Remove use of i2c_match_id() Andrew Davis
2026-03-05 19:35 ` [PATCH v2 2/6] rtc: m41t80: " Andrew Davis
2026-03-05 19:35 ` [PATCH v2 3/6] rtc: pcf2127: " Andrew Davis
2026-03-05 19:35 ` [PATCH v2 4/6] rtc: rs5c372: " Andrew Davis
2026-03-05 19:35 ` [PATCH v2 5/6] rtc: rv8803: " Andrew Davis
2026-03-05 19:35 ` Andrew Davis [this message]
2026-03-05 23:07 ` [PATCH v2 0/6] Remove use of i2c_match_id in RTC Alexandre Belloni
2026-03-06 15:01 ` Andrew Davis
2026-03-07 0:09 ` Alexandre Belloni
2026-03-12 14:16 ` Alexandre Belloni
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=20260305193545.796294-7-afd@ti.com \
--to=afd@ti.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
/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