diff options
author | Emil Goode <emilgoode@gmail.com> | 2012-08-18 12:12:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-05 15:33:40 -0400 |
commit | 23e7c6a765df64cafebff2d50fc51345797ca99a (patch) | |
tree | 74e01f0e6225d3a5193cbd3b665b0ffeeec364a5 /drivers/tty/serial/max310x.c | |
parent | 1a16afa2cecd36bc4b6ba00fe4c83fcf5ca6e710 (diff) |
tty: serial: max310x: Check return code of gpiochip_remove
The gpiochip_remove function may fail to remove a gpio_chip
if any GPIOs are still requested. This patch informs the caller
of such a senario.
Sparse is warning because the function prototype has a
__must_check annotation.
Sparse warning:
drivers/tty/serial/max310x.c:1223:18: warning:
ignoring return value of ‘gpiochip_remove’,
declared with attribute warn_unused_result
[-Wunused-result]
Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/max310x.c')
-rw-r--r-- | drivers/tty/serial/max310x.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 534e44851b7..06ff5ad7563 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c | |||
@@ -1207,6 +1207,7 @@ static int __devexit max310x_remove(struct spi_device *spi) | |||
1207 | { | 1207 | { |
1208 | struct device *dev = &spi->dev; | 1208 | struct device *dev = &spi->dev; |
1209 | struct max310x_port *s = dev_get_drvdata(dev); | 1209 | struct max310x_port *s = dev_get_drvdata(dev); |
1210 | int ret = 0; | ||
1210 | 1211 | ||
1211 | dev_dbg(dev, "Removing port\n"); | 1212 | dev_dbg(dev, "Removing port\n"); |
1212 | 1213 | ||
@@ -1219,8 +1220,11 @@ static int __devexit max310x_remove(struct spi_device *spi) | |||
1219 | uart_unregister_driver(&s->uart); | 1220 | uart_unregister_driver(&s->uart); |
1220 | 1221 | ||
1221 | #ifdef CONFIG_GPIOLIB | 1222 | #ifdef CONFIG_GPIOLIB |
1222 | if (s->pdata->gpio_base) | 1223 | if (s->pdata->gpio_base) { |
1223 | gpiochip_remove(&s->gpio); | 1224 | ret = gpiochip_remove(&s->gpio); |
1225 | if (ret) | ||
1226 | dev_err(dev, "Failed to remove gpio chip: %d\n", ret); | ||
1227 | } | ||
1224 | #endif | 1228 | #endif |
1225 | 1229 | ||
1226 | dev_set_drvdata(dev, NULL); | 1230 | dev_set_drvdata(dev, NULL); |
@@ -1232,7 +1236,7 @@ static int __devexit max310x_remove(struct spi_device *spi) | |||
1232 | 1236 | ||
1233 | devm_kfree(dev, s); | 1237 | devm_kfree(dev, s); |
1234 | 1238 | ||
1235 | return 0; | 1239 | return ret; |
1236 | } | 1240 | } |
1237 | 1241 | ||
1238 | static const struct spi_device_id max310x_id_table[] = { | 1242 | static const struct spi_device_id max310x_id_table[] = { |