* [PATCH v3] mfd: max8998: Simplify probe() and drop max8998_i2c_get_driver_data()
@ 2023-08-31 18:43 Biju Das
2023-08-31 23:06 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Biju Das @ 2023-08-31 18:43 UTC (permalink / raw)
To: Lee Jones; +Cc: Biju Das, linux-kernel, Andy Shevchenko
Simplify probe() by using i2c_get_match_data() instead of
max8998_i2c_get_driver_data() for retrieving match data from
OF/ID tables.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
Note:
This patch is only compile tested.
v2->v3:
* Restored OF table.
v1->v2:
* Restored error code -EINVAL.
---
drivers/mfd/max8998.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c
index 4cc426a6c767..6ba27171da28 100644
--- a/drivers/mfd/max8998.c
+++ b/drivers/mfd/max8998.c
@@ -152,18 +152,8 @@ static struct max8998_platform_data *max8998_i2c_parse_dt_pdata(
return pd;
}
-static inline unsigned long max8998_i2c_get_driver_data(struct i2c_client *i2c,
- const struct i2c_device_id *id)
-{
- if (i2c->dev.of_node)
- return (unsigned long)of_device_get_match_data(&i2c->dev);
-
- return id->driver_data;
-}
-
static int max8998_i2c_probe(struct i2c_client *i2c)
{
- const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
struct max8998_platform_data *pdata = dev_get_platdata(&i2c->dev);
struct max8998_dev *max8998;
int ret = 0;
@@ -183,7 +173,7 @@ static int max8998_i2c_probe(struct i2c_client *i2c)
max8998->dev = &i2c->dev;
max8998->i2c = i2c;
max8998->irq = i2c->irq;
- max8998->type = max8998_i2c_get_driver_data(i2c, id);
+ max8998->type = (uintptr_t)i2c_get_match_data(i2c);
max8998->pdata = pdata;
if (pdata) {
max8998->ono = pdata->ono;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] mfd: max8998: Simplify probe() and drop max8998_i2c_get_driver_data()
2023-08-31 18:43 [PATCH v3] mfd: max8998: Simplify probe() and drop max8998_i2c_get_driver_data() Biju Das
@ 2023-08-31 23:06 ` Andy Shevchenko
2023-09-01 6:03 ` Biju Das
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2023-08-31 23:06 UTC (permalink / raw)
To: Biju Das; +Cc: Lee Jones, linux-kernel
On Thu, Aug 31, 2023 at 07:43:09PM +0100, Biju Das wrote:
> Simplify probe() by using i2c_get_match_data() instead of
> max8998_i2c_get_driver_data() for retrieving match data from
> OF/ID tables.
Haven't I given you a tag for some of them? Please, double check and pay
respect to the reviewer in case the tag is missing.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH v3] mfd: max8998: Simplify probe() and drop max8998_i2c_get_driver_data()
2023-08-31 23:06 ` Andy Shevchenko
@ 2023-09-01 6:03 ` Biju Das
0 siblings, 0 replies; 3+ messages in thread
From: Biju Das @ 2023-09-01 6:03 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Lee Jones, linux-kernel
Hi Andy,
> Subject: Re: [PATCH v3] mfd: max8998: Simplify probe() and drop
> max8998_i2c_get_driver_data()
>
> On Thu, Aug 31, 2023 at 07:43:09PM +0100, Biju Das wrote:
> > Simplify probe() by using i2c_get_match_data() instead of
> > max8998_i2c_get_driver_data() for retrieving match data from OF/ID
> > tables.
>
> Haven't I given you a tag for some of them? Please, double check and pay
> respect to the reviewer in case the tag is missing.
I missed that from mail and MFD doesn't have any patch work
to see tags quickly compared to other subsystems.
Cheers,
Biju
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-09-01 6:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-31 18:43 [PATCH v3] mfd: max8998: Simplify probe() and drop max8998_i2c_get_driver_data() Biju Das
2023-08-31 23:06 ` Andy Shevchenko
2023-09-01 6:03 ` Biju Das
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.