summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart/uart_dev_quicc.c
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2013-04-01 00:44:20 +0000
committerian <ian@FreeBSD.org>2013-04-01 00:44:20 +0000
commit5b38501da66ed672b34922190744d3b78ac38915 (patch)
tree7e8822165fb7859a3446e9b064f7645e377504e3 /sys/dev/uart/uart_dev_quicc.c
parent720da1df6b6f787228bb96d6f4ea9475a9918504 (diff)
downloadFreeBSD-src-5b38501da66ed672b34922190744d3b78ac38915.zip
FreeBSD-src-5b38501da66ed672b34922190744d3b78ac38915.tar.gz
Fix low-level uart drivers that set their fifo sizes in the softc too late.
uart(4) allocates send and receiver buffers in attach() before it calls the low-level driver's attach routine. Many low-level drivers set the fifo sizes in their attach routine, which is too late. Other drivers set them in the probe() routine, so that they're available when uart(4) allocates buffers. This fixes the ones that were setting the values too late by moving the code to probe().
Diffstat (limited to 'sys/dev/uart/uart_dev_quicc.c')
-rw-r--r--sys/dev/uart/uart_dev_quicc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/uart/uart_dev_quicc.c b/sys/dev/uart/uart_dev_quicc.c
index df327a8..337591e 100644
--- a/sys/dev/uart/uart_dev_quicc.c
+++ b/sys/dev/uart/uart_dev_quicc.c
@@ -293,9 +293,6 @@ quicc_bus_attach(struct uart_softc *sc)
quicc_setup(bas, 9600, 8, 1, UART_PARITY_NONE);
}
- sc->sc_rxfifosz = 1;
- sc->sc_txfifosz = 1;
-
/* Enable interrupts on the receive buffer. */
rb = quicc_read2(bas, QUICC_PRAM_SCC_RBASE(bas->chan - 1));
st = quicc_read2(bas, rb);
@@ -417,6 +414,9 @@ quicc_bus_probe(struct uart_softc *sc)
if (error)
return (error);
+ sc->sc_rxfifosz = 1;
+ sc->sc_txfifosz = 1;
+
snprintf(buf, sizeof(buf), "quicc, channel %d", sc->sc_bas.chan);
device_set_desc_copy(sc->sc_dev, buf);
return (0);
OpenPOWER on IntegriCloud