Date: Sat, 22 Apr 2006 22:16:48 GMT From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 95896 for review Message-ID: <200604222216.k3MMGmrU076045@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=95896 Change 95896 by marcel@marcel_nfs on 2006/04/22 22:15:54 Calculate the divisor before we set the DLAB bit. We can bail out, and would otherwise leave DLAB set. Affected files ... .. //depot/projects/uart/dev/uart/uart_dev_ns8250.c#41 edit Differences ... ==== //depot/projects/uart/dev/uart/uart_dev_ns8250.c#41 (text+ko) ==== @@ -194,11 +194,11 @@ /* Set baudrate. */ if (baudrate > 0) { - uart_setreg(bas, REG_LCR, lcr | LCR_DLAB); - uart_barrier(bas); divisor = ns8250_divisor(bas->rclk, baudrate); if (divisor == 0) return (EINVAL); + uart_setreg(bas, REG_LCR, lcr | LCR_DLAB); + uart_barrier(bas); uart_setdreg(bas, REG_DL, divisor); uart_barrier(bas); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604222216.k3MMGmrU076045>