From: Rasmus Villemoes Date: Thu, 28 Nov 2019 14:55:38 +0000 (+0100) Subject: serial: ucc_uart: limit brg-frequency workaround to PPC32 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b0816f88b9b5a829401a1473e51c7001940d616f;p=linux.git 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 Reviewed-by: Timur Tabi Acked-by: Timur Tabi Signed-off-by: Rasmus Villemoes Signed-off-by: Li Yang --- diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index c055abf4c9197..9436b93d5cfa9 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