public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] serial: mctrl-gpio: fix build warning
@ 2015-03-11 10:25 Arnd Bergmann
  2015-03-11 13:01 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2015-03-11 10:25 UTC (permalink / raw)
  To: linux-arm-kernel

A recent fix to the error handling in this driver introduced a
harmless warning:

serial/serial_mctrl_gpio.c: In function 'mctrl_gpio_init':
serial/serial_mctrl_gpio.c:110:4: warning: return makes pointer from integer without a cast
serial/serial_mctrl_gpio.c:90:6: warning: unused variable 'err' [-Wunused-variable]

This removes the unused variable and uses the ERR_CAST helper
to return the error value as the correct type.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 1d267ea6539f2 ("serial: mctrl-gpio: simplify init routine")

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-11 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-11 10:25 [PATCH] serial: mctrl-gpio: fix build warning Arnd Bergmann
2015-03-11 13:01 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox