diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2019-11-28 15:55:38 +0100 |
---|---|---|
committer | Li Yang <leoyang.li@nxp.com> | 2019-12-09 13:54:35 -0600 |
commit | b0816f88b9b5a829401a1473e51c7001940d616f (patch) | |
tree | f9276b2dfba06650df804a41965e22df8159a513 /drivers/tty/serial/ucc_uart.c | |
parent | 89ad26f5f8bbcbdb54096bc8786d9b6f0acb79e6 (diff) | |
download | linux-stable-b0816f88b9b5a829401a1473e51c7001940d616f.tar.gz linux-stable-b0816f88b9b5a829401a1473e51c7001940d616f.tar.bz2 linux-stable-b0816f88b9b5a829401a1473e51c7001940d616f.zip |
serial: ucc_uart: limit brg-frequency workaround to PPC32
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>
Diffstat (limited to 'drivers/tty/serial/ucc_uart.c')
-rw-r--r-- | drivers/tty/serial/ucc_uart.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index c055abf4c919..9436b93d5cfa 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -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 |