serial: clps711x: fail if mctrl_gpio_init fails
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 12 Feb 2015 14:24:39 +0000 (15:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Mar 2015 02:15:03 +0000 (03:15 +0100)
mctrl_gpio_init is fully aware of being optional. If it returns an error
code this indicates a real error that must not be ignored.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/clps711x.c

index 6e11c275f2ab70d4fe326cf55c8177839408b03d..d5d2dd7c79174820432363d4a7076566eafc2204 100644 (file)
@@ -501,6 +501,8 @@ static int uart_clps711x_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, s);
 
        s->gpios = mctrl_gpio_init(&pdev->dev, 0);
+       if (IS_ERR(s->gpios))
+           return PTR_ERR(s->gpios);
 
        ret = uart_add_one_port(&clps711x_uart, &s->port);
        if (ret)