Module Name: src
Committed By: tnn
Date: Sat Jul 31 10:04:13 UTC 2021
Modified Files:
src/sys/dev/ic: com.c
Log Message:
only read cpr register if we're going to use the value
To generate a diff of this commit:
cvs rdiff -u -r1.364 -r1.365 src/sys/dev/ic/com.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/dev/ic/com.c
diff -u src/sys/dev/ic/com.c:1.364 src/sys/dev/ic/com.c:1.365
--- src/sys/dev/ic/com.c:1.364 Fri Jul 30 12:46:46 2021
+++ src/sys/dev/ic/com.c Sat Jul 31 10:04:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.364 2021/07/30 12:46:46 tnn Exp $ */
+/* $NetBSD: com.c,v 1.365 2021/07/31 10:04:12 tnn Exp $ */
/*-
* Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.364 2021/07/30 12:46:46 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.365 2021/07/31 10:04:12 tnn Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@@ -539,10 +539,11 @@ com_attach_subr(struct com_softc *sc)
goto fifodelay;
case COM_TYPE_DW_APB:
- cpr = bus_space_read_4(sc->sc_regs.cr_iot, sc->sc_regs.cr_ioh,
- DW_APB_UART_CPR);
- if (!prop_dictionary_get_uint(dict, "fifolen", &sc->sc_fifolen))
+ if (!prop_dictionary_get_uint(dict, "fifolen", &sc->sc_fifolen)) {
+ cpr = bus_space_read_4(sc->sc_regs.cr_iot,
+ sc->sc_regs.cr_ioh, DW_APB_UART_CPR);
sc->sc_fifolen = __SHIFTOUT(cpr, UART_CPR_FIFO_MODE) * 16;
+ }
if (sc->sc_fifolen == 0) {
sc->sc_fifolen = 1;
fifo_msg = "DesignWare APB UART, no fifo";