浏览代码

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 <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Uwe Kleine-König 11 年之前
父节点
当前提交
f059a455fc
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/tty/serial/clps711x.c

+ 2 - 0
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)