提交 2c7c282d 编写于 作者: L Lubomir Rintel 提交者: Xie XiuQi

serial: 8250_of: assume reg-shift of 2 for mrvl,mmp-uart

commit f4817843 upstream.

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: NLubomir Rintel <lkundrak@v3.sk>
Cc: stable@vger.kernel.org
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 7207ead4
...@@ -130,6 +130,10 @@ static int of_platform_serial_setup(struct platform_device *ofdev, ...@@ -130,6 +130,10 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
port->flags |= UPF_IOREMAP; 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 */ /* Check for registers offset within the devices address range */
if (of_property_read_u32(np, "reg-shift", &prop) == 0) if (of_property_read_u32(np, "reg-shift", &prop) == 0)
port->regshift = prop; port->regshift = prop;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册