Skip to content

Commit f059a45

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
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>
1 parent 722ccf4 commit f059a45

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/tty/serial/clps711x.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,8 @@ static int uart_clps711x_probe(struct platform_device *pdev)
501501
platform_set_drvdata(pdev, s);
502502

503503
s->gpios = mctrl_gpio_init(&pdev->dev, 0);
504+
if (IS_ERR(s->gpios))
505+
return PTR_ERR(s->gpios);
504506

505507
ret = uart_add_one_port(&clps711x_uart, &s->port);
506508
if (ret)

0 commit comments

Comments
 (0)