* [PATCH] Input: iqs7211 - point to match data directly
@ 2023-07-13 16:06 Jeff LaBundy
2023-07-13 17:00 ` Dmitry Torokhov
0 siblings, 1 reply; 3+ messages in thread
From: Jeff LaBundy @ 2023-07-13 16:06 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: linux-input, jeff
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: f2ba47e65f3b ("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>
---
drivers/input/touchscreen/iqs7211.c | 26 +++++++-------------------
1 file changed, 7 insertions(+), 19 deletions(-)
diff --git a/drivers/input/touchscreen/iqs7211.c b/drivers/input/touchscreen/iqs7211.c
index f60316d37f45..d41bbdd096e7 100644
--- a/drivers/input/touchscreen/iqs7211.c
+++ b/drivers/input/touchscreen/iqs7211.c
@@ -2420,33 +2420,24 @@ ATTRIBUTE_GROUPS(iqs7211);
static const struct of_device_id iqs7211_of_match[] = {
{
.compatible = "azoteq,iqs7210a",
- .data = (void *)IQS7210A,
+ .data = &iqs7211_devs[IQS7210A],
},
{
.compatible = "azoteq,iqs7211a",
- .data = (void *)IQS7211A,
+ .data = &iqs7211_devs[IQS7211A],
},
{
.compatible = "azoteq,iqs7211e",
- .data = (void *)IQS7211E,
+ .data = &iqs7211_devs[IQS7211E],
},
{ }
};
MODULE_DEVICE_TABLE(of, iqs7211_of_match);
-static const struct i2c_device_id iqs7211_id[] = {
- { "iqs7210a", IQS7210A },
- { "iqs7211a", IQS7211A },
- { "iqs7211e", IQS7211E },
- { }
-};
-MODULE_DEVICE_TABLE(i2c, iqs7211_id);
-
static int iqs7211_probe(struct i2c_client *client)
{
struct iqs7211_private *iqs7211;
enum iqs7211_reg_grp_id reg_grp;
- enum iqs7211_dev_id dev_id;
unsigned long irq_flags;
bool shared_irq;
int error, irq;
@@ -2460,13 +2451,11 @@ static int iqs7211_probe(struct i2c_client *client)
INIT_LIST_HEAD(&iqs7211->reg_field_head);
- if (client->dev.of_node)
- dev_id = (enum iqs7211_dev_id)of_device_get_match_data(&client->dev);
- else
- dev_id = i2c_match_id(iqs7211_id, client)->driver_data;
+ iqs7211->dev_desc = of_device_get_match_data(&client->dev);
+ if (!iqs7211->dev_desc)
+ return -ENODEV;
- shared_irq = iqs7211_devs[dev_id].num_ctx == IQS7211_MAX_CTX;
- iqs7211->dev_desc = &iqs7211_devs[dev_id];
+ shared_irq = iqs7211->dev_desc->num_ctx == IQS7211_MAX_CTX;
/*
* 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)
static struct i2c_driver iqs7211_i2c_driver = {
.probe = iqs7211_probe,
- .id_table = iqs7211_id,
.driver = {
.name = "iqs7211",
.of_match_table = iqs7211_of_match,
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] Input: iqs7211 - point to match data directly
2023-07-13 16:06 [PATCH] Input: iqs7211 - point to match data directly Jeff LaBundy
@ 2023-07-13 17:00 ` Dmitry Torokhov
2023-07-13 17:13 ` Jeff LaBundy
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2023-07-13 17:00 UTC (permalink / raw)
To: Jeff LaBundy; +Cc: linux-input
Hi Jeff,
On Thu, Jul 13, 2023 at 11:06:46AM -0500, Jeff LaBundy wrote:
> @@ -2460,13 +2451,11 @@ static int iqs7211_probe(struct i2c_client *client)
>
> INIT_LIST_HEAD(&iqs7211->reg_field_head);
>
> - if (client->dev.of_node)
> - dev_id = (enum iqs7211_dev_id)of_device_get_match_data(&client->dev);
> - else
> - dev_id = i2c_match_id(iqs7211_id, client)->driver_data;
> + iqs7211->dev_desc = of_device_get_match_data(&client->dev);
Can we make it device_get_match_data() instead of using OF-specific
variant?
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Input: iqs7211 - point to match data directly
2023-07-13 17:00 ` Dmitry Torokhov
@ 2023-07-13 17:13 ` Jeff LaBundy
0 siblings, 0 replies; 3+ messages in thread
From: Jeff LaBundy @ 2023-07-13 17:13 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input
Hi Dmitry,
On Thu, Jul 13, 2023 at 10:00:05AM -0700, Dmitry Torokhov wrote:
> Hi Jeff,
>
> On Thu, Jul 13, 2023 at 11:06:46AM -0500, Jeff LaBundy wrote:
> > @@ -2460,13 +2451,11 @@ static int iqs7211_probe(struct i2c_client *client)
> >
> > INIT_LIST_HEAD(&iqs7211->reg_field_head);
> >
> > - if (client->dev.of_node)
> > - dev_id = (enum iqs7211_dev_id)of_device_get_match_data(&client->dev);
> > - else
> > - dev_id = i2c_match_id(iqs7211_id, client)->driver_data;
> > + iqs7211->dev_desc = of_device_get_match_data(&client->dev);
>
> Can we make it device_get_match_data() instead of using OF-specific
> variant?
Ah yes, good catch; I'll fix that.
>
> Thanks.
>
> --
> Dmitry
Kind regards,
Jeff LaBundy
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-07-13 17:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-13 16:06 [PATCH] Input: iqs7211 - point to match data directly Jeff LaBundy
2023-07-13 17:00 ` Dmitry Torokhov
2023-07-13 17:13 ` Jeff LaBundy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox