diff options
author | Rui Miguel Silva <rmfrfs@gmail.com> | 2017-05-12 16:16:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-15 05:37:26 -0400 |
commit | 2c8e3f44f708a89a2c73a25a134af8c23998a2bc (patch) | |
tree | 182bcf796cf8c75c6035c3a45965c5d698f9198a | |
parent | 050161ea3268ad72d276bc2c327e9654048a82b2 (diff) |
staging: typec: fusb302: do not free gpio from managed resource
When allocating a gpio using the managed resource devm_, we can avoid freeing it
manually. But even if we did it we should use devm_gpio_free.
So, just remove the free of the gpio in the error path.
Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com>
Acked-by: Yueyao Zhu <yueyao.zhu@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/typec/fusb302/fusb302.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c index d8b50b49bb2d..ef5cceaa5967 100644 --- a/drivers/staging/typec/fusb302/fusb302.c +++ b/drivers/staging/typec/fusb302/fusb302.c | |||
@@ -1663,14 +1663,12 @@ static int init_gpio(struct fusb302_chip *chip) | |||
1663 | if (ret < 0) { | 1663 | if (ret < 0) { |
1664 | fusb302_log(chip, | 1664 | fusb302_log(chip, |
1665 | "cannot set GPIO Int_N to input, ret=%d", ret); | 1665 | "cannot set GPIO Int_N to input, ret=%d", ret); |
1666 | gpio_free(chip->gpio_int_n); | ||
1667 | return ret; | 1666 | return ret; |
1668 | } | 1667 | } |
1669 | ret = gpio_to_irq(chip->gpio_int_n); | 1668 | ret = gpio_to_irq(chip->gpio_int_n); |
1670 | if (ret < 0) { | 1669 | if (ret < 0) { |
1671 | fusb302_log(chip, | 1670 | fusb302_log(chip, |
1672 | "cannot request IRQ for GPIO Int_N, ret=%d", ret); | 1671 | "cannot request IRQ for GPIO Int_N, ret=%d", ret); |
1673 | gpio_free(chip->gpio_int_n); | ||
1674 | return ret; | 1672 | return ret; |
1675 | } | 1673 | } |
1676 | chip->gpio_int_n_irq = ret; | 1674 | chip->gpio_int_n_irq = ret; |