aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLABBE Corentin <clabbe.montjoie@gmail.com>2015-11-19 05:50:10 -0500
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2016-01-11 14:19:57 -0500
commit4d833d601332b00a1ef5f0249e97481d02f3ad02 (patch)
tree7cd5001d3f4e295fa2431e8136cea2d18446a753
parent6ddab92faa2d7d7b38cb2b228f7fdfd1eecba5e2 (diff)
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: LABBE Corentin <clabbe.montjoie@gmail.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
-rw-r--r--drivers/rtc/rtc-sunxi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-sunxi.c b/drivers/rtc/rtc-sunxi.c
index 0c08a5b7dc61..abada609ddc7 100644
--- a/drivers/rtc/rtc-sunxi.c
+++ b/drivers/rtc/rtc-sunxi.c
@@ -436,7 +436,6 @@ static int sunxi_rtc_probe(struct platform_device *pdev)
436{ 436{
437 struct sunxi_rtc_dev *chip; 437 struct sunxi_rtc_dev *chip;
438 struct resource *res; 438 struct resource *res;
439 const struct of_device_id *of_id;
440 int ret; 439 int ret;
441 440
442 chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); 441 chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
@@ -463,12 +462,11 @@ static int sunxi_rtc_probe(struct platform_device *pdev)
463 return ret; 462 return ret;
464 } 463 }
465 464
466 of_id = of_match_device(sunxi_rtc_dt_ids, &pdev->dev); 465 chip->data_year = of_device_get_match_data(&pdev->dev);
467 if (!of_id) { 466 if (!chip->data_year) {
468 dev_err(&pdev->dev, "Unable to setup RTC data\n"); 467 dev_err(&pdev->dev, "Unable to setup RTC data\n");
469 return -ENODEV; 468 return -ENODEV;
470 } 469 }
471 chip->data_year = of_id->data;
472 470
473 /* clear the alarm count value */ 471 /* clear the alarm count value */
474 writel(0, chip->base + SUNXI_ALRM_DHMS); 472 writel(0, chip->base + SUNXI_ALRM_DHMS);