[v3,4/4] serial: 8250: Don't check for mctrl_gpio_init() returning -ENOSYS
diff mbox series

Message ID 20190802100349.8659-4-frieder.schrempf@kontron.de
State New
Headers show
Series
  • [v3,1/4] serial: mctrl_gpio: Avoid probe failures in case of missing gpiolib
Related show

Commit Message

Frieder Schrempf Aug. 2, 2019, 10:04 a.m. UTC
From: Frieder Schrempf <frieder.schrempf@kontron.de>

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>
---
Changes in v3
=============
* Adjust the commit message and subject line

Changes in v2
=============
* Add a patch for the 8250 driver
---
 drivers/tty/serial/8250/8250_core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Uwe Kleine-König Aug. 2, 2019, 12:15 p.m. UTC | #1
On Fri, Aug 02, 2019 at 10:04:11AM +0000, Schrempf Frieder wrote:
> From: Frieder Schrempf <frieder.schrempf@kontron.de>
> 
> 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-König <u.kleine-koenig@pengutronix.de>

@greg: This patch doesn't depend on patch 2; ditto for patch 3. So only
taking patches 1, 3 and 4 should be fine. This way Frieder's v4 only
have to care for patch 2. (Assuming noone objects to 1, 3 and 4 of
course.)

Best regards
Uwe
Greg Kroah-Hartman Aug. 2, 2019, 12:26 p.m. UTC | #2
On Fri, Aug 02, 2019 at 02:15:55PM +0200, Uwe Kleine-König wrote:
> On Fri, Aug 02, 2019 at 10:04:11AM +0000, Schrempf Frieder wrote:
> > From: Frieder Schrempf <frieder.schrempf@kontron.de>
> > 
> > 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-König <u.kleine-koenig@pengutronix.de>
> 
> @greg: This patch doesn't depend on patch 2; ditto for patch 3. So only
> taking patches 1, 3 and 4 should be fine. This way Frieder's v4 only
> have to care for patch 2. (Assuming noone objects to 1, 3 and 4 of
> course.)

Sounds good, I'll do that, thanks.

greg k-h
Uwe Kleine-König Aug. 6, 2019, 7:44 a.m. UTC | #3
Hey Greg

On Fri, Aug 02, 2019 at 02:26:23PM +0200, Greg Kroah-Hartman wrote:
> On Fri, Aug 02, 2019 at 02:15:55PM +0200, Uwe Kleine-König wrote:
> > On Fri, Aug 02, 2019 at 10:04:11AM +0000, Schrempf Frieder wrote:
> > > From: Frieder Schrempf <frieder.schrempf@kontron.de>
> > > 
> > > 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-König <u.kleine-koenig@pengutronix.de>
> > 
> > @greg: This patch doesn't depend on patch 2; ditto for patch 3. So only
> > taking patches 1, 3 and 4 should be fine. This way Frieder's v4 only
> > have to care for patch 2. (Assuming noone objects to 1, 3 and 4 of
> > course.)
> 
> Sounds good, I'll do that, thanks.

again you somehow managed to mangle my name :-|

$ git log -3 8f0df898b27926e443d13770adfd828cc0f50148 | grep Uwe
    Acked-by: Uwe Kleine-Knig <u.kleine-koenig@pengutronix.de>
    Acked-by: Uwe Kleine-Knig <u.kleine-koenig@pengutronix.de>
    Reviewed-by: Uwe Kleine-Knig <u.kleine-koenig@pengutronix.de>

in all three instances the ö is missing.

Uwe

Patch
diff mbox series

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index df3bcc0b2d74..e682390ce0de 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -1026,10 +1026,8 @@  int serial8250_register_8250_port(struct uart_8250_port *up)
 		if (!has_acpi_companion(uart->port.dev)) {
 			gpios = mctrl_gpio_init(&uart->port, 0);
 			if (IS_ERR(gpios)) {
-				if (PTR_ERR(gpios) != -ENOSYS) {
-					ret = PTR_ERR(gpios);
-					goto out_unlock;
-				}
+				ret = PTR_ERR(gpios);
+				goto out_unlock;
 			} else {
 				uart->gpios = gpios;
 			}