Re: [PATCH 1/2] i2c: s3c2410: simplify getting of_device_id match data

2021-04-16 Thread Wolfram Sang
On Thu, Apr 15, 2021 at 11:38:02AM +0200, Krzysztof Kozlowski wrote:
> Use of_device_get_match_data() to make the code slightly smaller.
> 
> Signed-off-by: Krzysztof Kozlowski 

Applied to for-next, thanks!



signature.asc
Description: PGP signature


Re: [PATCH 1/2] i2c: s3c2410: simplify getting of_device_id match data

2021-04-15 Thread Sylwester Nawrocki



On 15.04.2021 11:38, Krzysztof Kozlowski wrote:

Use of_device_get_match_data() to make the code slightly smaller.

Signed-off-by: Krzysztof Kozlowski


Reviewed-by: Sylwester Nawrocki 


[PATCH 1/2] i2c: s3c2410: simplify getting of_device_id match data

2021-04-15 Thread Krzysztof Kozlowski
Use of_device_get_match_data() to make the code slightly smaller.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/i2c/busses/i2c-s3c2410.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 62a903fbe912..ab928613afba 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -156,12 +157,8 @@ MODULE_DEVICE_TABLE(of, s3c24xx_i2c_match);
  */
 static inline kernel_ulong_t s3c24xx_get_device_quirks(struct platform_device 
*pdev)
 {
-   if (pdev->dev.of_node) {
-   const struct of_device_id *match;
-
-   match = of_match_node(s3c24xx_i2c_match, pdev->dev.of_node);
-   return (kernel_ulong_t)match->data;
-   }
+   if (pdev->dev.of_node)
+   return (kernel_ulong_t)of_device_get_match_data(>dev);
 
return platform_get_device_id(pdev)->driver_data;
 }
-- 
2.25.1