linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: s3c: Use generic helper to get driver data
       [not found] <CGME20190118132845eucas1p2c3e5f6dadb6af90a3701fca03599e094@eucas1p2.samsung.com>
@ 2019-01-18 13:28 ` Marek Szyprowski
  2019-01-19 19:40   ` Krzysztof Kozlowski
  2019-01-22 17:36   ` Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Marek Szyprowski @ 2019-01-18 13:28 UTC (permalink / raw)
  To: linux-rtc, linux-samsung-soc
  Cc: Marek Szyprowski, Alexandre Belloni, Alessandro Zummo,
	Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz

Replace of_match_node() with of_device_get_match_data(), which removes a
few lines of code from the driver.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/rtc/rtc-s3c.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index e682977b4f6e..2904b872db88 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -26,6 +26,7 @@
 #include <linux/log2.h>
 #include <linux/slab.h>
 #include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/uaccess.h>
 #include <linux/io.h>
 
@@ -443,16 +444,6 @@ static int s3c_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id s3c_rtc_dt_match[];
-
-static const struct s3c_rtc_data *s3c_rtc_get_data(struct platform_device *pdev)
-{
-	const struct of_device_id *match;
-
-	match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node);
-	return match->data;
-}
-
 static int s3c_rtc_probe(struct platform_device *pdev)
 {
 	struct s3c_rtc *info = NULL;
@@ -472,7 +463,7 @@ static int s3c_rtc_probe(struct platform_device *pdev)
 	}
 
 	info->dev = &pdev->dev;
-	info->data = s3c_rtc_get_data(pdev);
+	info->data = of_device_get_match_data(&pdev->dev);
 	if (!info->data) {
 		dev_err(&pdev->dev, "failed getting s3c_rtc_data\n");
 		return -EINVAL;
-- 
2.17.1


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

* Re: [PATCH] rtc: s3c: Use generic helper to get driver data
  2019-01-18 13:28 ` [PATCH] rtc: s3c: Use generic helper to get driver data Marek Szyprowski
@ 2019-01-19 19:40   ` Krzysztof Kozlowski
  2019-01-22 17:36   ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2019-01-19 19:40 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-rtc, linux-samsung-soc, Alexandre Belloni, Alessandro Zummo,
	Bartlomiej Zolnierkiewicz

On Fri, Jan 18, 2019 at 02:28:37PM +0100, Marek Szyprowski wrote:
> Replace of_match_node() with of_device_get_match_data(), which removes a
> few lines of code from the driver.
> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/rtc/rtc-s3c.c | 13 ++-----------

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof


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

* Re: [PATCH] rtc: s3c: Use generic helper to get driver data
  2019-01-18 13:28 ` [PATCH] rtc: s3c: Use generic helper to get driver data Marek Szyprowski
  2019-01-19 19:40   ` Krzysztof Kozlowski
@ 2019-01-22 17:36   ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2019-01-22 17:36 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-rtc, linux-samsung-soc, Alessandro Zummo,
	Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz

On 18/01/2019 14:28:37+0100, Marek Szyprowski wrote:
> Replace of_match_node() with of_device_get_match_data(), which removes a
> few lines of code from the driver.
> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/rtc/rtc-s3c.c | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)
> 
Applied, thanks.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2019-01-22 17:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20190118132845eucas1p2c3e5f6dadb6af90a3701fca03599e094@eucas1p2.samsung.com>
2019-01-18 13:28 ` [PATCH] rtc: s3c: Use generic helper to get driver data Marek Szyprowski
2019-01-19 19:40   ` Krzysztof Kozlowski
2019-01-22 17:36   ` Alexandre Belloni

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