linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: sh_mobile: Use of_device_get_match_data() helper
@ 2017-10-04 12:17 Geert Uytterhoeven
  2017-10-05  9:16 ` Simon Horman
  2017-10-17 21:59 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2017-10-04 12:17 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-renesas-soc, Geert Uytterhoeven

Use the of_device_get_match_data() helper instead of open coding.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/i2c/busses/i2c-sh_mobile.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 6f2aaeb7c4fa156d..c03acdf713972677 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -881,7 +881,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
 	struct sh_mobile_i2c_data *pd;
 	struct i2c_adapter *adap;
 	struct resource *res;
-	const struct of_device_id *match;
+	const struct sh_mobile_dt_config *config;
 	int ret;
 	u32 bus_speed;
 
@@ -913,10 +913,8 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
 	pd->bus_speed = ret ? STANDARD_MODE : bus_speed;
 	pd->clks_per_count = 1;
 
-	match = of_match_device(sh_mobile_i2c_dt_ids, &dev->dev);
-	if (match) {
-		const struct sh_mobile_dt_config *config = match->data;
-
+	config = of_device_get_match_data(&dev->dev);
+	if (config) {
 		pd->clks_per_count = config->clks_per_count;
 
 		if (config->setup)
-- 
2.7.4

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

* Re: [PATCH] i2c: sh_mobile: Use of_device_get_match_data() helper
  2017-10-04 12:17 [PATCH] i2c: sh_mobile: Use of_device_get_match_data() helper Geert Uytterhoeven
@ 2017-10-05  9:16 ` Simon Horman
  2017-10-17 21:59 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2017-10-05  9:16 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Wolfram Sang, linux-i2c, linux-renesas-soc

On Wed, Oct 04, 2017 at 02:17:05PM +0200, Geert Uytterhoeven wrote:
> Use the of_device_get_match_data() helper instead of open coding.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

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

* Re: [PATCH] i2c: sh_mobile: Use of_device_get_match_data() helper
  2017-10-04 12:17 [PATCH] i2c: sh_mobile: Use of_device_get_match_data() helper Geert Uytterhoeven
  2017-10-05  9:16 ` Simon Horman
@ 2017-10-17 21:59 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2017-10-17 21:59 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-i2c, linux-renesas-soc

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

On Wed, Oct 04, 2017 at 02:17:05PM +0200, Geert Uytterhoeven wrote:
> Use the of_device_get_match_data() helper instead of open coding.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Huh, how did I miss this so far? Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2017-10-17 21:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-04 12:17 [PATCH] i2c: sh_mobile: Use of_device_get_match_data() helper Geert Uytterhoeven
2017-10-05  9:16 ` Simon Horman
2017-10-17 21:59 ` Wolfram Sang

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).