diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-04 02:36:33 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-04 02:36:33 +0300 |
commit | 4c92b5bb14226faa16d29a1df5752baf1ff22b53 (patch) | |
tree | 73146a8e95eda6526e9c853de0a74f54a89e86be /drivers/pcmcia/sa1111_generic.c | |
parent | c706c7eb0d08098f0d768aeef945d7cf1f8858b4 (diff) | |
parent | fca8b807a667c6f34af1cffe57efbd17b257d07b (diff) | |
download | linux-4c92b5bb14226faa16d29a1df5752baf1ff22b53.tar.xz |
Merge branch 'pcmcia' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Pull ARM pcmcia updates from Russell King:
"A series of changes updating the PXA and SA11x0 PCMCIA code to use
devm_* APIs, and resolve some resource leaks in doing so. This
results in a few small cleanups which are included in this set.
FYI, the recommit of these today is to add Robert Jarzmik's
reviewed-by tags, which I'd forgotten to add from mid-July"
* 'pcmcia' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
pcmcia: soc_common: remove skt_dev_info's clk pointer
pcmcia: sa11xx_base.c: remove useless init/exit functions
pcmcia: sa1111: simplify clk handing in sa1111_pcmcia_add()
pcmcia: sa1111: update socket driver to use devm_clk_get() API
pcmcia: pxa2xx: convert memory allocation to devm_* API
pcmcia: pxa2xx: update socket driver to use devm_clk_get() API
pcmcia: sa11x0: convert memory allocation to devm_* API
pcmcia: sa11x0: fix missing clk_put() in sa11x0 socket drivers
Diffstat (limited to 'drivers/pcmcia/sa1111_generic.c')
-rw-r--r-- | drivers/pcmcia/sa1111_generic.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c index 80b8e9d05275..a1531feb8460 100644 --- a/drivers/pcmcia/sa1111_generic.c +++ b/drivers/pcmcia/sa1111_generic.c @@ -135,8 +135,13 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops, int (*add)(struct soc_pcmcia_socket *)) { struct sa1111_pcmcia_socket *s; + struct clk *clk; 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; for (i = 0; i < ops->nr; i++) { @@ -145,12 +150,8 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops, return -ENOMEM; s->soc.nr = ops->first + i; - s->soc.clk = clk_get(&dev->dev, NULL); - if (IS_ERR(s->soc.clk)) { - ret = PTR_ERR(s->soc.clk); - kfree(s); - return ret; - } + s->soc.clk = clk; + soc_pcmcia_init_one(&s->soc, ops, &dev->dev); s->dev = dev; if (s->soc.nr) { @@ -226,7 +227,6 @@ static int pcmcia_remove(struct sa1111_dev *dev) for (; s; s = next) { next = s->next; soc_pcmcia_remove_one(&s->soc); - clk_put(s->soc.clk); kfree(s); } |