From: Andrew Davis <afd@ti.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: <linux-input@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
"Andrew Davis" <afd@ti.com>
Subject: [PATCH] Input: exc3000 - remove use of i2c_match_id()
Date: Wed, 18 Nov 2026 10:18:31 -0600 [thread overview]
Message-ID: <20261118161831.232721-1-afd@ti.com> (raw)
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().
Signed-off-by: Andrew Davis <afd@ti.com>
---
drivers/input/touchscreen/exc3000.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c
index d6e0c5183a483..f8f865cd4a9be 100644
--- a/drivers/input/touchscreen/exc3000.c
+++ b/drivers/input/touchscreen/exc3000.c
@@ -42,8 +42,6 @@
#define EXC3000_RESET_MS 10
#define EXC3000_READY_MS 100
-static const struct i2c_device_id exc3000_id[];
-
struct eeti_dev_info {
const char *name;
int max_xy;
@@ -338,12 +336,7 @@ static int exc3000_probe(struct i2c_client *client)
return -ENOMEM;
data->client = client;
- data->info = device_get_match_data(&client->dev);
- if (!data->info) {
- enum eeti_dev_id eeti_dev_id =
- i2c_match_id(exc3000_id, client)->driver_data;
- data->info = &exc3000_info[eeti_dev_id];
- }
+ data->info = i2c_get_match_data(client);
timer_setup(&data->timer, exc3000_timer, 0);
init_completion(&data->wait_event);
mutex_init(&data->query_lock);
@@ -432,10 +425,10 @@ static int exc3000_probe(struct i2c_client *client)
}
static const struct i2c_device_id exc3000_id[] = {
- { .name = "exc3000", .driver_data = EETI_EXC3000 },
- { .name = "exc80h60", .driver_data = EETI_EXC80H60 },
- { .name = "exc80h84", .driver_data = EETI_EXC80H84 },
- { .name = "exc81w32", .driver_data = EETI_EXC81W32 },
+ { .name = "exc3000", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC3000] },
+ { .name = "exc80h60", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H60] },
+ { .name = "exc80h84", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H84] },
+ { .name = "exc81w32", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC81W32] },
{ }
};
MODULE_DEVICE_TABLE(i2c, exc3000_id);
--
2.43.0
reply other threads:[~2026-11-18 16:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261118161831.232721-1-afd@ti.com \
--to=afd@ti.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@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