linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: cy8c95x0: Simplify probe()
@ 2023-09-02  8:22 Biju Das
  2023-09-04  9:08 ` Andy Shevchenko
  2023-09-12  7:57 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Biju Das @ 2023-09-02  8:22 UTC (permalink / raw)
  To: Patrick Rudolph, Linus Walleij
  Cc: Biju Das, linux-gpio, linux-kernel, Biju Das, Andy Shevchenko

Simpilfy probe() by replacing device_get_match_data() and id lookup for
retrieving match data by i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
Note:
 This patch is only compile tested.
---
 drivers/pinctrl/pinctrl-cy8c95x0.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-cy8c95x0.c b/drivers/pinctrl/pinctrl-cy8c95x0.c
index 58ca6fac7849..fae80b52a6fc 100644
--- a/drivers/pinctrl/pinctrl-cy8c95x0.c
+++ b/drivers/pinctrl/pinctrl-cy8c95x0.c
@@ -1346,9 +1346,7 @@ static int cy8c95x0_probe(struct i2c_client *client)
 	chip->dev = &client->dev;
 
 	/* Set the device type */
-	chip->driver_data = (unsigned long)device_get_match_data(&client->dev);
-	if (!chip->driver_data)
-		chip->driver_data = i2c_match_id(cy8c95x0_id, client)->driver_data;
+	chip->driver_data = (uintptr_t)i2c_get_match_data(client);
 	if (!chip->driver_data)
 		return -ENODEV;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: cy8c95x0: Simplify probe()
  2023-09-02  8:22 [PATCH] pinctrl: cy8c95x0: Simplify probe() Biju Das
@ 2023-09-04  9:08 ` Andy Shevchenko
  2023-09-12  7:57 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2023-09-04  9:08 UTC (permalink / raw)
  To: Biju Das; +Cc: Patrick Rudolph, Linus Walleij, linux-gpio, linux-kernel,
	Biju Das

On Sat, Sep 02, 2023 at 09:22:25AM +0100, Biju Das wrote:
> Simpilfy probe() by replacing device_get_match_data() and id lookup for

ID

> retrieving match data by i2c_get_match_data().

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

I can test it at some point, but I don't see the point to failure,
so I consider the priority is low for that.

Easier to me to test when it lands Linux Next, which I can run without much
effort on the Intel Galileo Gen 1 board (with this chip connected).

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: cy8c95x0: Simplify probe()
  2023-09-02  8:22 [PATCH] pinctrl: cy8c95x0: Simplify probe() Biju Das
  2023-09-04  9:08 ` Andy Shevchenko
@ 2023-09-12  7:57 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2023-09-12  7:57 UTC (permalink / raw)
  To: Biju Das
  Cc: Patrick Rudolph, linux-gpio, linux-kernel, Biju Das,
	Andy Shevchenko

On Sat, Sep 2, 2023 at 10:22 AM Biju Das <biju.das.jz@bp.renesas.com> wrote:

> Simpilfy probe() by replacing device_get_match_data() and id lookup for
> retrieving match data by i2c_get_match_data().
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Patch applied with the small spelling fix suggested by Andy.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-12  7:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-02  8:22 [PATCH] pinctrl: cy8c95x0: Simplify probe() Biju Das
2023-09-04  9:08 ` Andy Shevchenko
2023-09-12  7:57 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).