“d52ef2cef99cc200d828f39d1584e4b190fc2442”上不存在“drivers/dma-buf/sync_debug.h”
提交 4d833d60 编写于 作者: L LABBE Corentin 提交者: Alexandre Belloni

rtc: sunxi: use of_device_get_match_data

The usage of of_device_get_match_data reduce the code size a bit.
Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com>
Acked-by: NChen-Yu Tsai <wens@csie.org>
Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
上级 6ddab92f
...@@ -436,7 +436,6 @@ static int sunxi_rtc_probe(struct platform_device *pdev) ...@@ -436,7 +436,6 @@ static int sunxi_rtc_probe(struct platform_device *pdev)
{ {
struct sunxi_rtc_dev *chip; struct sunxi_rtc_dev *chip;
struct resource *res; struct resource *res;
const struct of_device_id *of_id;
int ret; int ret;
chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
...@@ -463,12 +462,11 @@ static int sunxi_rtc_probe(struct platform_device *pdev) ...@@ -463,12 +462,11 @@ static int sunxi_rtc_probe(struct platform_device *pdev)
return ret; return ret;
} }
of_id = of_match_device(sunxi_rtc_dt_ids, &pdev->dev); chip->data_year = of_device_get_match_data(&pdev->dev);
if (!of_id) { if (!chip->data_year) {
dev_err(&pdev->dev, "Unable to setup RTC data\n"); dev_err(&pdev->dev, "Unable to setup RTC data\n");
return -ENODEV; return -ENODEV;
} }
chip->data_year = of_id->data;
/* clear the alarm count value */ /* clear the alarm count value */
writel(0, chip->base + SUNXI_ALRM_DHMS); writel(0, chip->base + SUNXI_ALRM_DHMS);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册