summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2019-01-18 14:28:37 +0100
committerSeung-Woo Kim <sw0312.kim@samsung.com>2019-02-18 04:54:12 +0000
commit50162a91958ab6eca749d9fc86306e435263ed9a (patch)
tree5860a9b588590727a049ce7f428d3f9694c94324 /drivers
parent09631c84ac395e8da3c4d45722da7c9e7eb1062c (diff)
downloadlinux-exynos-50162a91958ab6eca749d9fc86306e435263ed9a.tar.gz
linux-exynos-50162a91958ab6eca749d9fc86306e435263ed9a.tar.bz2
linux-exynos-50162a91958ab6eca749d9fc86306e435263ed9a.zip
rtc: s3c: Use generic helper to get driver data
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> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> [backport of mainline commit 64704c92fd19c599f20433aae1372a7ccab79a57] Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I9e3a1662233334925ca9ace34609468dc8bc0a14
Diffstat (limited to 'drivers')
-rw-r--r--drivers/rtc/rtc-s3c.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 624ca24dcc0c..269032a05acd 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>
@@ -454,16 +455,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;
@@ -483,7 +474,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;