clk: meson: use dev pointer where possible
authorJerome Brunet <jbrunet@baylibre.com>
Mon, 12 Feb 2018 14:58:28 +0000 (15:58 +0100)
committerNeil Armstrong <narmstrong@baylibre.com>
Tue, 13 Mar 2018 09:03:56 +0000 (10:03 +0100)
The 'dev' pointer is directly available in gxbb and axg clock
controller, so consistently use it instead of going the through the
'pdev' pointer once in while

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
drivers/clk/meson/axg.c
drivers/clk/meson/gxbb.c

index 2dc70e0e925c7d68e46446c06223c2f98690a1d7..1f48649a7d2a88357a8a9608c647ac815720d93e 100644 (file)
@@ -804,7 +804,7 @@ static int axg_clkc_probe(struct platform_device *pdev)
        void __iomem *clk_base;
        int ret, clkid, i;
 
-       clkc_data = of_device_get_match_data(&pdev->dev);
+       clkc_data = of_device_get_match_data(dev);
        if (!clkc_data)
                return -EINVAL;
 
@@ -812,9 +812,9 @@ static int axg_clkc_probe(struct platform_device *pdev)
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res)
                return -EINVAL;
-       clk_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
+       clk_base = devm_ioremap(dev, res->start, resource_size(res));
        if (!clk_base) {
-               dev_err(&pdev->dev, "Unable to map clk base\n");
+               dev_err(dev, "Unable to map clk base\n");
                return -ENXIO;
        }
 
@@ -849,7 +849,7 @@ static int axg_clkc_probe(struct platform_device *pdev)
                ret = devm_clk_hw_register(dev,
                                        clkc_data->hw_onecell_data->hws[clkid]);
                if (ret) {
-                       dev_err(&pdev->dev, "Clock registration failed\n");
+                       dev_err(dev, "Clock registration failed\n");
                        return ret;
                }
        }
index a5f25cc1944c0a0b942a10063e167b8d7cc95c43..423abcb8ef88a209a395802188528e7c5d37cbdc 100644 (file)
@@ -1950,7 +1950,7 @@ static int gxbb_clkc_probe(struct platform_device *pdev)
        int ret, clkid, i;
        struct device *dev = &pdev->dev;
 
-       clkc_data = of_device_get_match_data(&pdev->dev);
+       clkc_data = of_device_get_match_data(dev);
        if (!clkc_data)
                return -EINVAL;