Skip to content

Commit

Permalink
serial: ucc_uart: limit brg-frequency workaround to PPC32
Browse files Browse the repository at this point in the history
According to Timur Tabi

    This bug in older U-Boots is definitely PowerPC-specific

So before allowing this driver to be built for platforms other than
PPC32, make sure that we don't accept malformed device trees on those
other platforms.

Suggested-by: Timur Tabi <timur@kernel.org>
Reviewed-by: Timur Tabi <timur@kernel.org>
Acked-by: Timur Tabi <timur@kernel.org>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
  • Loading branch information
Rasmus Villemoes authored and Li Yang committed Dec 9, 2019
1 parent 89ad26f commit b0816f8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/tty/serial/ucc_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,13 @@ static int ucc_uart_probe(struct platform_device *ofdev)
if (val)
qe_port->port.uartclk = val;
else {
if (!IS_ENABLED(CONFIG_PPC32)) {
dev_err(&ofdev->dev,
"invalid brg-frequency in device tree\n");
ret = -EINVAL;
goto out_np;
}

/*
* Older versions of U-Boot do not initialize the brg-frequency
* property, so in this case we assume the BRG frequency is
Expand Down

0 comments on commit b0816f8

Please sign in to comment.