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.
This commit is contained in:
parent
016d5f2c08
commit
d5eb41b48a
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user