From: Uwe Kleine-König Date: Thu, 12 Feb 2015 14:24:39 +0000 (+0100) Subject: serial: clps711x: fail if mctrl_gpio_init fails X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f059a455fc979e0e7f155d98bf628fccab1c5b88;p=openwrt%2Fstaging%2Fblogic.git serial: clps711x: fail if mctrl_gpio_init fails 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c index 6e11c275f2ab..d5d2dd7c7917 100644 --- a/drivers/tty/serial/clps711x.c +++ b/drivers/tty/serial/clps711x.c @@ -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)