Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

LABBE Corentin and committed by
Alexandre Belloni
4d833d60 6ddab92f

+2 -4
+2 -4
drivers/rtc/rtc-sunxi.c
··· 436 436 { 437 437 struct sunxi_rtc_dev *chip; 438 438 struct resource *res; 439 - const struct of_device_id *of_id; 440 439 int ret; 441 440 442 441 chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); ··· 462 463 return ret; 463 464 } 464 465 465 - of_id = of_match_device(sunxi_rtc_dt_ids, &pdev->dev); 466 - if (!of_id) { 466 + chip->data_year = of_device_get_match_data(&pdev->dev); 467 + if (!chip->data_year) { 467 468 dev_err(&pdev->dev, "Unable to setup RTC data\n"); 468 469 return -ENODEV; 469 470 } 470 - chip->data_year = of_id->data; 471 471 472 472 /* clear the alarm count value */ 473 473 writel(0, chip->base + SUNXI_ALRM_DHMS);