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


Pavel Machek
 

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
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Join cip-dev@lists.cip-project.org to automatically receive all group messages.