]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
clk: bcm2835: use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Mon, 14 Oct 2019 14:36:42 +0000 (22:36 +0800)
committerStephen Boyd <sboyd@kernel.org>
Wed, 16 Oct 2019 23:16:50 +0000 (16:16 -0700)
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lkml.kernel.org/r/20191014143642.24552-1-yuehaibing@huawei.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/bcm/clk-bcm2835-aux.c
drivers/clk/bcm/clk-bcm2835.c

index b6d07ca0164f3c0e4e76551781f3787bb4d8175d..290a2846a86b654034293308f33602114c85dae1 100644 (file)
@@ -19,7 +19,6 @@ static int bcm2835_aux_clk_probe(struct platform_device *pdev)
        struct clk_hw_onecell_data *onecell;
        const char *parent;
        struct clk *parent_clk;
-       struct resource *res;
        void __iomem *reg, *gate;
 
        parent_clk = devm_clk_get(dev, NULL);
@@ -27,8 +26,7 @@ static int bcm2835_aux_clk_probe(struct platform_device *pdev)
                return PTR_ERR(parent_clk);
        parent = __clk_get_name(parent_clk);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       reg = devm_ioremap_resource(dev, res);
+       reg = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(reg))
                return PTR_ERR(reg);
 
index 802e488fd3c3d53146ca0d64a71c5469e1f38fbd..ded13ccf768e190ddc5f09db883ee19f211f0dca 100644 (file)
@@ -2192,7 +2192,6 @@ static int bcm2835_clk_probe(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        struct clk_hw **hws;
        struct bcm2835_cprman *cprman;
-       struct resource *res;
        const struct bcm2835_clk_desc *desc;
        const size_t asize = ARRAY_SIZE(clk_desc_array);
        const struct cprman_plat_data *pdata;
@@ -2211,8 +2210,7 @@ static int bcm2835_clk_probe(struct platform_device *pdev)
 
        spin_lock_init(&cprman->regs_lock);
        cprman->dev = dev;
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       cprman->regs = devm_ioremap_resource(dev, res);
+       cprman->regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(cprman->regs))
                return PTR_ERR(cprman->regs);