Commit 321ae964 authored by Russell King's avatar Russell King

pcmcia: sa1111: simplify clk handing in sa1111_pcmcia_add()

clk_get(dev, NULL) will always refer to the same clock, so it's
pointless calling this multiple times for the same device.  As we no
longer have to worry about the cleanup (via use of devm_clk_get()) we
can simplify sa1111_pcmcia_add() too.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 924e5ea2
...@@ -135,8 +135,13 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops, ...@@ -135,8 +135,13 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,
int (*add)(struct soc_pcmcia_socket *)) int (*add)(struct soc_pcmcia_socket *))
{ {
struct sa1111_pcmcia_socket *s; struct sa1111_pcmcia_socket *s;
struct clk *clk;
int i, ret = 0; int i, ret = 0;
clk = devm_clk_get(&dev->dev, NULL);
if (IS_ERR(clk))
return PTR_ERR(clk);
ops->socket_state = sa1111_pcmcia_socket_state; ops->socket_state = sa1111_pcmcia_socket_state;
for (i = 0; i < ops->nr; i++) { for (i = 0; i < ops->nr; i++) {
...@@ -145,12 +150,8 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops, ...@@ -145,12 +150,8 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,
return -ENOMEM; return -ENOMEM;
s->soc.nr = ops->first + i; s->soc.nr = ops->first + i;
s->soc.clk = devm_clk_get(&dev->dev, NULL); s->soc.clk = clk;
if (IS_ERR(s->soc.clk)) {
ret = PTR_ERR(s->soc.clk);
kfree(s);
return ret;
}
soc_pcmcia_init_one(&s->soc, ops, &dev->dev); soc_pcmcia_init_one(&s->soc, ops, &dev->dev);
s->dev = dev; s->dev = dev;
if (s->soc.nr) { if (s->soc.nr) {
......
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