diff options
author | ian <ian@FreeBSD.org> | 2013-08-21 04:08:58 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2013-08-21 04:08:58 +0000 |
commit | d5eb41b48a84cd4efc8be15b34a5cedb8e60de26 (patch) | |
tree | feb2f658debf4cda86f348c7c131ee9c3f85c7c3 /sys/dev/uart | |
parent | 016d5f2c083974903d94f476f7673665260606c2 (diff) | |
download | FreeBSD-src-d5eb41b48a84cd4efc8be15b34a5cedb8e60de26.zip FreeBSD-src-d5eb41b48a84cd4efc8be15b34a5cedb8e60de26.tar.gz |
Use an if/else sequence rather than unrelated if statements, so that a
device compatible with multiple drivers matches the more specific driver
first and doesn't overwrite it later with the more generic. Move the
generic ns16550 to the end of the list.
Diffstat (limited to 'sys/dev/uart')
-rw-r--r-- | sys/dev/uart/uart_cpu_fdt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/uart/uart_cpu_fdt.c b/sys/dev/uart/uart_cpu_fdt.c index 0052388..d41cb64 100644 --- a/sys/dev/uart/uart_cpu_fdt.c +++ b/sys/dev/uart/uart_cpu_fdt.c @@ -141,18 +141,18 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) */ if (fdt_is_compatible(node, "fsl,imx-uart")) class = &uart_imx_class; - if (fdt_is_compatible(node, "quicc")) + else if (fdt_is_compatible(node, "quicc")) class = &uart_quicc_class; - if (fdt_is_compatible(node, "lpc")) + else if (fdt_is_compatible(node, "lpc")) class = &uart_lpc_class; - if (fdt_is_compatible(node, "ns16550")) - class = &uart_ns8250_class; - if (fdt_is_compatible(node, "arm,pl011")) + else if (fdt_is_compatible(node, "arm,pl011")) class = &uart_pl011_class; - if (fdt_is_compatible(node, "exynos")) + else if (fdt_is_compatible(node, "exynos")) class = &uart_s3c2410_class; - if (fdt_is_compatible(node, "cadence,uart")) + else if (fdt_is_compatible(node, "cadence,uart")) class = &uart_cdnc_class; + else if (fdt_is_compatible(node, "ns16550")) + class = &uart_ns8250_class; di->bas.chan = 0; di->bas.regshft = (u_int)shift; |