linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: exynos5: use core helper to get driver data
       [not found] <CGME20170224133606eucas1p2c3c6afb60b9e39ad501c1ddbdbfc180f@eucas1p2.samsung.com>
@ 2017-02-24 13:36 ` Andrzej Hajda
  2017-03-06 15:32   ` Javier Martinez Canillas
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andrzej Hajda @ 2017-02-24 13:36 UTC (permalink / raw)
  To: Wolfram Sang, Krzysztof Kozlowski, Javier Martinez Canillas,
	linux-i2c, linux-samsung-soc
  Cc: Andrzej Hajda, Bartlomiej Zolnierkiewicz, Marek Szyprowski

Driver core provides of_device_get_match_data which can be used
to get driver data instead of custom helper.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 drivers/i2c/busses/i2c-exynos5.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
index bc2b5db..de3b6af 100644
--- a/drivers/i2c/busses/i2c-exynos5.c
+++ b/drivers/i2c/busses/i2c-exynos5.c
@@ -22,6 +22,7 @@
 #include <linux/slab.h>
 #include <linux/io.h>
 #include <linux/of_address.h>
+#include <linux/of_device.h>
 #include <linux/of_irq.h>
 #include <linux/spinlock.h>
 
@@ -201,7 +202,7 @@ struct exynos5_i2c {
 	unsigned int		op_clock;
 
 	/* Version of HS-I2C Hardware */
-	struct exynos_hsi2c_variant	*variant;
+	const struct exynos_hsi2c_variant *variant;
 };
 
 /**
@@ -247,15 +248,6 @@ static const struct of_device_id exynos5_i2c_match[] = {
 };
 MODULE_DEVICE_TABLE(of, exynos5_i2c_match);
 
-static inline struct exynos_hsi2c_variant *exynos5_i2c_get_variant
-					(struct platform_device *pdev)
-{
-	const struct of_device_id *match;
-
-	match = of_match_node(exynos5_i2c_match, pdev->dev.of_node);
-	return (struct exynos_hsi2c_variant *)match->data;
-}
-
 static void exynos5_i2c_clr_pend_irq(struct exynos5_i2c *i2c)
 {
 	writel(readl(i2c->regs + HSI2C_INT_STATUS),
@@ -773,8 +765,7 @@ static int exynos5_i2c_probe(struct platform_device *pdev)
 		goto err_clk;
 	}
 
-	/* Need to check the variant before setting up. */
-	i2c->variant = exynos5_i2c_get_variant(pdev);
+	i2c->variant = of_device_get_match_data(&pdev->dev);
 
 	ret = exynos5_hsi2c_clock_setup(i2c);
 	if (ret)
-- 
2.7.4

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

* Re: [PATCH] i2c: exynos5: use core helper to get driver data
  2017-02-24 13:36 ` [PATCH] i2c: exynos5: use core helper to get driver data Andrzej Hajda
@ 2017-03-06 15:32   ` Javier Martinez Canillas
  2017-04-20 14:41     ` Javier Martinez Canillas
  2017-04-03 10:07   ` Andrzej Hajda
  2017-04-21 12:04   ` Wolfram Sang
  2 siblings, 1 reply; 5+ messages in thread
From: Javier Martinez Canillas @ 2017-03-06 15:32 UTC (permalink / raw)
  To: Andrzej Hajda, Wolfram Sang, Krzysztof Kozlowski, linux-i2c,
	linux-samsung-soc
  Cc: Bartlomiej Zolnierkiewicz, Marek Szyprowski

Hello Andrzej,

On 02/24/2017 10:36 AM, Andrzej Hajda wrote:
> Driver core provides of_device_get_match_data which can be used
> to get driver data instead of custom helper.
> 
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> ---

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

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

* Re: [PATCH] i2c: exynos5: use core helper to get driver data
  2017-02-24 13:36 ` [PATCH] i2c: exynos5: use core helper to get driver data Andrzej Hajda
  2017-03-06 15:32   ` Javier Martinez Canillas
@ 2017-04-03 10:07   ` Andrzej Hajda
  2017-04-21 12:04   ` Wolfram Sang
  2 siblings, 0 replies; 5+ messages in thread
From: Andrzej Hajda @ 2017-04-03 10:07 UTC (permalink / raw)
  To: Wolfram Sang, Krzysztof Kozlowski, Javier Martinez Canillas,
	linux-i2c, linux-samsung-soc
  Cc: Bartlomiej Zolnierkiewicz, Marek Szyprowski

Hi Wolfram,

Gently ping.

Regards
Andrzej


On 24.02.2017 14:36, Andrzej Hajda wrote:
> Driver core provides of_device_get_match_data which can be used
> to get driver data instead of custom helper.
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
>  drivers/i2c/busses/i2c-exynos5.c | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
> index bc2b5db..de3b6af 100644
> --- a/drivers/i2c/busses/i2c-exynos5.c
> +++ b/drivers/i2c/busses/i2c-exynos5.c
> @@ -22,6 +22,7 @@
>  #include <linux/slab.h>
>  #include <linux/io.h>
>  #include <linux/of_address.h>
> +#include <linux/of_device.h>
>  #include <linux/of_irq.h>
>  #include <linux/spinlock.h>
>  
> @@ -201,7 +202,7 @@ struct exynos5_i2c {
>  	unsigned int		op_clock;
>  
>  	/* Version of HS-I2C Hardware */
> -	struct exynos_hsi2c_variant	*variant;
> +	const struct exynos_hsi2c_variant *variant;
>  };
>  
>  /**
> @@ -247,15 +248,6 @@ static const struct of_device_id exynos5_i2c_match[] = {
>  };
>  MODULE_DEVICE_TABLE(of, exynos5_i2c_match);
>  
> -static inline struct exynos_hsi2c_variant *exynos5_i2c_get_variant
> -					(struct platform_device *pdev)
> -{
> -	const struct of_device_id *match;
> -
> -	match = of_match_node(exynos5_i2c_match, pdev->dev.of_node);
> -	return (struct exynos_hsi2c_variant *)match->data;
> -}
> -
>  static void exynos5_i2c_clr_pend_irq(struct exynos5_i2c *i2c)
>  {
>  	writel(readl(i2c->regs + HSI2C_INT_STATUS),
> @@ -773,8 +765,7 @@ static int exynos5_i2c_probe(struct platform_device *pdev)
>  		goto err_clk;
>  	}
>  
> -	/* Need to check the variant before setting up. */
> -	i2c->variant = exynos5_i2c_get_variant(pdev);
> +	i2c->variant = of_device_get_match_data(&pdev->dev);
>  
>  	ret = exynos5_hsi2c_clock_setup(i2c);
>  	if (ret)

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

* Re: [PATCH] i2c: exynos5: use core helper to get driver data
  2017-03-06 15:32   ` Javier Martinez Canillas
@ 2017-04-20 14:41     ` Javier Martinez Canillas
  0 siblings, 0 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2017-04-20 14:41 UTC (permalink / raw)
  To: Andrzej Hajda, Wolfram Sang, Krzysztof Kozlowski, linux-i2c,
	linux-samsung-soc
  Cc: Bartlomiej Zolnierkiewicz, Marek Szyprowski

On 03/06/2017 12:32 PM, Javier Martinez Canillas wrote:
> Hello Andrzej,
> 
> On 02/24/2017 10:36 AM, Andrzej Hajda wrote:
>> Driver core provides of_device_get_match_data which can be used
>> to get driver data instead of custom helper.
>>
>> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
>> ---
> 
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
> 

I've also tested this patch on an Exynos5800 Peach Pi Chromebook:

Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

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

* Re: [PATCH] i2c: exynos5: use core helper to get driver data
  2017-02-24 13:36 ` [PATCH] i2c: exynos5: use core helper to get driver data Andrzej Hajda
  2017-03-06 15:32   ` Javier Martinez Canillas
  2017-04-03 10:07   ` Andrzej Hajda
@ 2017-04-21 12:04   ` Wolfram Sang
  2 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2017-04-21 12:04 UTC (permalink / raw)
  To: Andrzej Hajda
  Cc: Krzysztof Kozlowski, Javier Martinez Canillas, linux-i2c,
	linux-samsung-soc, Bartlomiej Zolnierkiewicz, Marek Szyprowski

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

On Fri, Feb 24, 2017 at 02:36:00PM +0100, Andrzej Hajda wrote:
> Driver core provides of_device_get_match_data which can be used
> to get driver data instead of custom helper.
> 
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>

Applied to for-next, thanks!


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

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

end of thread, other threads:[~2017-04-21 12:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170224133606eucas1p2c3c6afb60b9e39ad501c1ddbdbfc180f@eucas1p2.samsung.com>
2017-02-24 13:36 ` [PATCH] i2c: exynos5: use core helper to get driver data Andrzej Hajda
2017-03-06 15:32   ` Javier Martinez Canillas
2017-04-20 14:41     ` Javier Martinez Canillas
2017-04-03 10:07   ` Andrzej Hajda
2017-04-21 12:04   ` 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).