lkml.org 
[lkml]   [2019]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] serial: imx: Avoid probe failure in case of missing gpiolib
Date
From: Frieder Schrempf <frieder.schrempf@kontron.de>

If CONFIG_GPIOLIB is not enabled, mctrl_gpio_init() will return
-ENOSYS and cause the probing of the imx UART to fail. As the
GPIOs are optional, we should continue probing in this case.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
drivers/tty/serial/imx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 10db3e54ac9e..51714498dacf 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2237,7 +2237,9 @@ static int imx_uart_probe(struct platform_device *pdev)
timer_setup(&sport->timer, imx_uart_timeout, 0);

sport->gpios = mctrl_gpio_init(&sport->port, 0);
- if (IS_ERR(sport->gpios))
+ if (PTR_ERR(sport->gpios) == -ENOSYS)
+ sport->gpios = NULL;
+ else if (IS_ERR(sport->gpios))
return PTR_ERR(sport->gpios);

sport->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
--
2.17.1
\
 
 \ /
  Last update: 2019-08-01 10:19    [W:0.054 / U:1.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site