Commit 59ecfefa authored by Russell King's avatar Russell King

pcmcia: soc_common: use devm_gpio_request_one()

Use devm_gpio_request_one() to request the GPIOs so we can avoid
manual clean up these gpio resources.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent 3be79886
......@@ -111,12 +111,9 @@ static void __soc_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt,
{
unsigned int i;
for (i = 0; i < nr; i++) {
for (i = 0; i < nr; i++)
if (skt->stat[i].irq)
free_irq(skt->stat[i].irq, skt);
if (gpio_is_valid(skt->stat[i].gpio))
gpio_free(skt->stat[i].gpio);
}
if (skt->ops->hw_shutdown)
skt->ops->hw_shutdown(skt);
......@@ -145,7 +142,8 @@ static int soc_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
if (gpio_is_valid(skt->stat[i].gpio)) {
int irq;
ret = gpio_request_one(skt->stat[i].gpio, GPIOF_IN,
ret = devm_gpio_request_one(skt->socket.dev.parent,
skt->stat[i].gpio, GPIOF_IN,
skt->stat[i].name);
if (ret) {
__soc_pcmcia_hw_shutdown(skt, i);
......@@ -166,8 +164,6 @@ static int soc_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
IRQF_TRIGGER_NONE,
skt->stat[i].name, skt);
if (ret) {
if (gpio_is_valid(skt->stat[i].gpio))
gpio_free(skt->stat[i].gpio);
__soc_pcmcia_hw_shutdown(skt, i);
return ret;
}
......
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