Commit deee856a authored by Russell King's avatar Russell King

ARM: sa1111: use devm_clk_get()

Convert sa1111 to use devm_clk_get() to get its clock resource, and
strip out the clk_put() calls.  This simplifies the error handling
a little.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent 7d53c1f0
...@@ -700,15 +700,13 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq) ...@@ -700,15 +700,13 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq)
if (!sachip) if (!sachip)
return -ENOMEM; return -ENOMEM;
sachip->clk = clk_get(me, "SA1111_CLK"); sachip->clk = devm_clk_get(me, "SA1111_CLK");
if (IS_ERR(sachip->clk)) { if (IS_ERR(sachip->clk))
ret = PTR_ERR(sachip->clk); return PTR_ERR(sachip->clk);
goto err_free;
}
ret = clk_prepare(sachip->clk); ret = clk_prepare(sachip->clk);
if (ret) if (ret)
goto err_clkput; return ret;
spin_lock_init(&sachip->lock); spin_lock_init(&sachip->lock);
...@@ -805,9 +803,6 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq) ...@@ -805,9 +803,6 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq)
iounmap(sachip->base); iounmap(sachip->base);
err_clk_unprep: err_clk_unprep:
clk_unprepare(sachip->clk); clk_unprepare(sachip->clk);
err_clkput:
clk_put(sachip->clk);
err_free:
return ret; return ret;
} }
...@@ -845,7 +840,6 @@ static void __sa1111_remove(struct sa1111 *sachip) ...@@ -845,7 +840,6 @@ static void __sa1111_remove(struct sa1111 *sachip)
} }
iounmap(sachip->base); iounmap(sachip->base);
clk_put(sachip->clk);
} }
struct sa1111_save_data { struct sa1111_save_data {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment