]> git.baikalelectronics.ru Git - kernel.git/commitdiff
clk: sunxi: use of_device_get_match_data
authorCorentin Labbe <clabbe@baylibre.com>
Sun, 10 Nov 2019 16:35:20 +0000 (16:35 +0000)
committerMaxime Ripard <maxime@cerno.tech>
Mon, 9 Dec 2019 07:49:02 +0000 (08:49 +0100)
The usage of of_device_get_match_data reduce the code size a bit.

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/clk/sunxi/clk-sun6i-apb0-gates.c

index a165e7172346a0c8afb4da1df4467760a2a2543d..4c75b0770c74bfbbc4262fb6fded369c42b783d7 100644 (file)
@@ -37,7 +37,6 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)
 {
        struct device_node *np = pdev->dev.of_node;
        struct clk_onecell_data *clk_data;
-       const struct of_device_id *device;
        const struct gates_data *data;
        const char *clk_parent;
        const char *clk_name;
@@ -50,10 +49,9 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)
        if (!np)
                return -ENODEV;
 
-       device = of_match_device(sun6i_a31_apb0_gates_clk_dt_ids, &pdev->dev);
-       if (!device)
+       data = of_device_get_match_data(&pdev->dev);
+       if (!data)
                return -ENODEV;
-       data = device->data;
 
        r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        reg = devm_ioremap_resource(&pdev->dev, r);