Commit 64704c92 authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Alexandre Belloni

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: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 5a5b614b
......@@ -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>
......@@ -442,16 +443,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;
......@@ -471,7 +462,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment