]> git.karo-electronics.de Git - linux-beck.git/commitdiff
rtc: sunxi: use of_device_get_match_data
authorLABBE Corentin <clabbe.montjoie@gmail.com>
Thu, 19 Nov 2015 10:50:10 +0000 (11:50 +0100)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Mon, 11 Jan 2016 19:19:57 +0000 (20:19 +0100)
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>
drivers/rtc/rtc-sunxi.c

index 0c08a5b7dc612b9e396613947027a0e3ac67e635..abada609ddc736c8fdb7af2b1009e44aafa544b4 100644 (file)
@@ -436,7 +436,6 @@ static int sunxi_rtc_probe(struct platform_device *pdev)
 {
        struct sunxi_rtc_dev *chip;
        struct resource *res;
-       const struct of_device_id *of_id;
        int ret;
 
        chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
@@ -463,12 +462,11 @@ static int sunxi_rtc_probe(struct platform_device *pdev)
                return ret;
        }
 
-       of_id = of_match_device(sunxi_rtc_dt_ids, &pdev->dev);
-       if (!of_id) {
+       chip->data_year = of_device_get_match_data(&pdev->dev);
+       if (!chip->data_year) {
                dev_err(&pdev->dev, "Unable to setup RTC data\n");
                return -ENODEV;
        }
-       chip->data_year = of_id->data;
 
        /* clear the alarm count value */
        writel(0, chip->base + SUNXI_ALRM_DHMS);