From: Lubomir Rintel Date: Sun, 24 Feb 2019 12:00:53 +0000 (+0100) Subject: serial: 8250_of: assume reg-shift of 2 for mrvl,mmp-uart X-Git-Tag: rel_imx_5.10.35_2.0.0-somdevices.0~5214^2~3 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=f4817843e39ce78aace0195a57d4e8500a65a898;p=linux.git serial: 8250_of: assume reg-shift of 2 for mrvl,mmp-uart There are two other drivers that bind to mrvl,mmp-uart and both of them assume register shift of 2 bits. There are device trees that lack the property and rely on that assumption. If this driver wins the race to bind to those devices, it should behave the same as the older deprecated driver. Signed-off-by: Lubomir Rintel Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c index 17da8af36aa1..0277479c87e9 100644 --- a/drivers/tty/serial/8250/8250_of.c +++ b/drivers/tty/serial/8250/8250_of.c @@ -130,6 +130,10 @@ static int of_platform_serial_setup(struct platform_device *ofdev, port->flags |= UPF_IOREMAP; } + /* Compatibility with the deprecated pxa driver and 8250_pxa drivers. */ + if (of_device_is_compatible(np, "mrvl,mmp-uart")) + port->regshift = 2; + /* Check for registers offset within the devices address range */ if (of_property_read_u32(np, "reg-shift", &prop) == 0) port->regshift = prop;