[PATCH 5/5] dev/sc16is752: Check return values.

Christian Mauderer christian.mauderer at embedded-brains.de
Mon Feb 12 13:39:40 UTC 2018


Escalate a failed installation of the interrupts to the next higher
level.
---
 cpukit/dev/serial/sc16is752.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/cpukit/dev/serial/sc16is752.c b/cpukit/dev/serial/sc16is752.c
index 153b589ac1..39e5df2ae7 100644
--- a/cpukit/dev/serial/sc16is752.c
+++ b/cpukit/dev/serial/sc16is752.c
@@ -234,11 +234,13 @@ static bool sc16is752_first_open(
   set_efr(ctx, EFR_ENHANCED_FUNC_ENABLE);
 
   rtems_termios_set_initial_baud(tty, 115200);
-  sc16is752_set_attributes(base, term);
-
-  (*ctx->install_irq)(ctx);
+  ok = sc16is752_set_attributes(base, term);
+  if (!ok) {
+    return ok;
+  }
 
-  return true;
+  ok = (*ctx->install_irq)(ctx);
+  return ok;
 }
 
 static void sc16is752_last_close(
-- 
2.13.6




More information about the devel mailing list