Skip to content

Commit 677232f

Browse files
jlabundydtor
authored andcommitted
Input: iqs7211 - point to match data directly
Point the OF match table directly to the struct that describes the device as opposed to an intermediate enum; doing so simplifies the code and avoids a clang warning. As part of this change, the I2C device ID table is removed, as the device cannot probe without an OF node due to the unique nature of the hardware's interrupt pin. Fixes: f2ba47e ("Input: add support for Azoteq IQS7210A/7211A/E") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202307131717.LtwApG0z-lkp@intel.com/ Signed-off-by: Jeff LaBundy <jeff@labundy.com> Link: https://lore.kernel.org/r/ZLA+cuciIeVcCvm6@nixie71 Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent f2ba47e commit 677232f

1 file changed

Lines changed: 7 additions & 19 deletions

File tree

drivers/input/touchscreen/iqs7211.c

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,33 +2420,24 @@ ATTRIBUTE_GROUPS(iqs7211);
24202420
static const struct of_device_id iqs7211_of_match[] = {
24212421
{
24222422
.compatible = "azoteq,iqs7210a",
2423-
.data = (void *)IQS7210A,
2423+
.data = &iqs7211_devs[IQS7210A],
24242424
},
24252425
{
24262426
.compatible = "azoteq,iqs7211a",
2427-
.data = (void *)IQS7211A,
2427+
.data = &iqs7211_devs[IQS7211A],
24282428
},
24292429
{
24302430
.compatible = "azoteq,iqs7211e",
2431-
.data = (void *)IQS7211E,
2431+
.data = &iqs7211_devs[IQS7211E],
24322432
},
24332433
{ }
24342434
};
24352435
MODULE_DEVICE_TABLE(of, iqs7211_of_match);
24362436

2437-
static const struct i2c_device_id iqs7211_id[] = {
2438-
{ "iqs7210a", IQS7210A },
2439-
{ "iqs7211a", IQS7211A },
2440-
{ "iqs7211e", IQS7211E },
2441-
{ }
2442-
};
2443-
MODULE_DEVICE_TABLE(i2c, iqs7211_id);
2444-
24452437
static int iqs7211_probe(struct i2c_client *client)
24462438
{
24472439
struct iqs7211_private *iqs7211;
24482440
enum iqs7211_reg_grp_id reg_grp;
2449-
enum iqs7211_dev_id dev_id;
24502441
unsigned long irq_flags;
24512442
bool shared_irq;
24522443
int error, irq;
@@ -2460,13 +2451,11 @@ static int iqs7211_probe(struct i2c_client *client)
24602451

24612452
INIT_LIST_HEAD(&iqs7211->reg_field_head);
24622453

2463-
if (client->dev.of_node)
2464-
dev_id = (enum iqs7211_dev_id)of_device_get_match_data(&client->dev);
2465-
else
2466-
dev_id = i2c_match_id(iqs7211_id, client)->driver_data;
2454+
iqs7211->dev_desc = device_get_match_data(&client->dev);
2455+
if (!iqs7211->dev_desc)
2456+
return -ENODEV;
24672457

2468-
shared_irq = iqs7211_devs[dev_id].num_ctx == IQS7211_MAX_CTX;
2469-
iqs7211->dev_desc = &iqs7211_devs[dev_id];
2458+
shared_irq = iqs7211->dev_desc->num_ctx == IQS7211_MAX_CTX;
24702459

24712460
/*
24722461
* The RDY pin behaves as an interrupt, but must also be polled ahead
@@ -2554,7 +2543,6 @@ static int iqs7211_probe(struct i2c_client *client)
25542543

25552544
static struct i2c_driver iqs7211_i2c_driver = {
25562545
.probe = iqs7211_probe,
2557-
.id_table = iqs7211_id,
25582546
.driver = {
25592547
.name = "iqs7211",
25602548
.of_match_table = iqs7211_of_match,

0 commit comments

Comments
 (0)