diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2015-03-10 12:23:18 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-11 13:55:20 +0100 |
commit | 13bc2bb9a0075342707e853e6dac298f0bbca111 (patch) | |
tree | 7133d2a115f1cb2518611ee6c1365a643f151ecf | |
parent | ac25e8c72b34ad7853aad0b7008633217af0c1df (diff) | |
download | lwn-13bc2bb9a0075342707e853e6dac298f0bbca111.tar.gz lwn-13bc2bb9a0075342707e853e6dac298f0bbca111.zip |
serial: mctrl_gpio: Fix build warnings
Fix the following build warnings:
drivers/tty/serial/serial_mctrl_gpio.c: In function 'mctrl_gpio_init':
drivers/tty/serial/serial_mctrl_gpio.c:110:4: warning: return makes pointer from integer without a cast
return PTR_ERR(gpios->gpio[i]);
^
/home/build/work/batch/drivers/tty/serial/serial_mctrl_gpio.c:90:6: warning: unused variable 'err' [-Wunused-variable]
int err;
^
Return ERR_CAST and remove the unused 'err' variable to fix them.
Fixes: 1d267ea6539f ("serial: mctrl-gpio: simplify init routine")
Reported-by: Olof's autobuilder <build@lixom.net>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/serial_mctrl_gpio.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c index 5027db7b5814..0ec756c62bcf 100644 --- a/drivers/tty/serial/serial_mctrl_gpio.c +++ b/drivers/tty/serial/serial_mctrl_gpio.c @@ -87,7 +87,6 @@ struct mctrl_gpios *mctrl_gpio_init(struct device *dev, unsigned int idx) { struct mctrl_gpios *gpios; enum mctrl_gpio_idx i; - int err; gpios = devm_kzalloc(dev, sizeof(*gpios), GFP_KERNEL); if (!gpios) @@ -107,7 +106,7 @@ struct mctrl_gpios *mctrl_gpio_init(struct device *dev, unsigned int idx) idx, flags); if (IS_ERR(gpios->gpio[i])) - return PTR_ERR(gpios->gpio[i]); + return ERR_CAST(gpios->gpio[i]); } return gpios; |