diff mbox series

[4.4.y-cip,3/4] serial: sh-sci: Don't check for mctrl_gpio_init() returning -ENOSYS

Message ID 20200903142719.13010-4-prabhakar.mahadev-lad.rj@bp.renesas.com (mailing list archive)
State Rejected
Headers show
Series serial mctrl_gpio/sh-sci Fixes | expand

Commit Message

Lad Prabhakar Sept. 3, 2020, 2:27 p.m. UTC
From: Frieder Schrempf <frieder.schrempf@kontron.de>

commit e55a09732be9b4e13cf3b5d2b9bb41b3e60e5ea6 upstream.

Now that the mctrl_gpio code returns NULL instead of ERR_PTR(-ENOSYS)
if CONFIG_GPIOLIB is disabled, we can safely remove this check.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Acked-by: Uwe Kleine-Knig <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20190802100349.8659-3-frieder.schrempf@kontron.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/tty/serial/sh-sci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pavel Machek Sept. 3, 2020, 8:51 p.m. UTC | #1
Hi!

> Now that the mctrl_gpio code returns NULL instead of ERR_PTR(-ENOSYS)
> if CONFIG_GPIOLIB is disabled, we can safely remove this check.

No, sorry, I don't think this is correct.

In 4.4, we still have

static inline struct gpio_desc *__must_check
devm_gpiod_get_index_optional(struct device *dev, const char *con_id,
                                unsigned int index, enum gpiod_flags flags)
{
        return ERR_PTR(-ENOSYS);
}

and that propagates through mctrl_gpio_init().

NAK.
								Pavel

> +++ b/drivers/tty/serial/sh-sci.c
> @@ -2778,7 +2778,7 @@ static int sci_probe_single(struct platform_device *dev,
>  		return ret;
>  
>  	sciport->gpios = mctrl_gpio_init(&sciport->port, 0);
> -	if (IS_ERR(sciport->gpios) && PTR_ERR(sciport->gpios) != -ENOSYS)
> +	if (IS_ERR(sciport->gpios))
>  		return PTR_ERR(sciport->gpios);
>  
>  	if (p->capabilities & SCIx_HAVE_RTSCTS) {
> -- 
> 2.17.1
>
diff mbox series

Patch

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 166ca04aad4e..7d7008e4dc75 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2778,7 +2778,7 @@  static int sci_probe_single(struct platform_device *dev,
 		return ret;
 
 	sciport->gpios = mctrl_gpio_init(&sciport->port, 0);
-	if (IS_ERR(sciport->gpios) && PTR_ERR(sciport->gpios) != -ENOSYS)
+	if (IS_ERR(sciport->gpios))
 		return PTR_ERR(sciport->gpios);
 
 	if (p->capabilities & SCIx_HAVE_RTSCTS) {