Module Name:    src
Committed By:   hkenken
Date:           Wed Jun 20 07:08:35 UTC 2018

Modified Files:
        src/sys/arch/arm/imx: imxuart.c

Log Message:
Move intr_establish() before imxuart_attach_subr().


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/imx/imxuart.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imxuart.c
diff -u src/sys/arch/arm/imx/imxuart.c:1.20 src/sys/arch/arm/imx/imxuart.c:1.21
--- src/sys/arch/arm/imx/imxuart.c:1.20	Fri Sep  8 05:29:12 2017
+++ src/sys/arch/arm/imx/imxuart.c	Wed Jun 20 07:08:35 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: imxuart.c,v 1.20 2017/09/08 05:29:12 hkenken Exp $ */
+/* $NetBSD: imxuart.c,v 1.21 2018/06/20 07:08:35 hkenken Exp $ */
 
 /*
  * Copyright (c) 2009, 2010  Genetec Corporation.  All rights reserved.
@@ -96,7 +96,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.20 2017/09/08 05:29:12 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.21 2018/06/20 07:08:35 hkenken Exp $");
 
 #include "opt_imxuart.h"
 #include "opt_ddb.h"
@@ -306,6 +306,13 @@ imxuart_attach_common(device_t parent, d
 	}
 	regsp->ur_ioh = ioh;
 
+	sc->sc_ih = intr_establish(sc->sc_intr, IPL_SERIAL, IST_LEVEL,
+	    imxuintr, sc);
+	if (sc->sc_ih == NULL) {
+		aprint_error_dev(sc->sc_dev, "intr_establish failed\n");
+		return;
+	}
+
 	imxuart_attach_subr(sc);
 }
 
@@ -377,11 +384,6 @@ imxuart_attach_subr(struct imxuart_softc
 		}
 	}
 
-	sc->sc_ih = intr_establish(sc->sc_intr, IPL_SERIAL, IST_LEVEL,
-	    imxuintr, sc);
-	if (sc->sc_ih == NULL)
-		aprint_error_dev(sc->sc_dev, "intr_establish failed\n");
-
 #ifdef KGDB
 	/*
 	 * Allow kgdb to "take over" this port.  If this is

Reply via email to