Hi, Andy > -----原始邮件----- > 发件人: andy@surfacebook.localdomain > 发送时间: 2021-07-13 04:34:41 (星期二) > 收件人: "Huacai Chen" <chenhuacai@xxxxxxxxxxx> > 抄送: "Greg Kroah-Hartman" <gregkh@xxxxxxxxxxxxxxxxxxx>, linux-serial@xxxxxxxxxxxxxxx, "Xuefeng Li" <lixuefeng@xxxxxxxxxxx>, "Jiaxun Yang" <jiaxun.yang@xxxxxxxxxxx>, "Jianmin Lv" <lvjianmin@xxxxxxxxxxx> > 主题: Re: [PATCH V2] serial: 8250_pnp: Support configurable clock frequency > > Mon, Jul 05, 2021 at 09:00:10PM +0800, Huacai Chen kirjoitti: > > From: Jianmin Lv <lvjianmin@xxxxxxxxxxx> > > > > ACPI-based Loongson boards need configurable rather than fixed clock > > frequency for serial ports. > > ... > > > #include <linux kernel.h=""> > > #include <linux serial_core.h=""> > > #include <linux bitops.h=""> > > +#include <linux property.h=""> > > Can you try to keep it ordered (to some extend), please? Existing headers is not in order, should I sort them completely? > > ... > > > uart.port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF; > > if (pnp_irq_flags(dev, 0) & IORESOURCE_IRQ_SHAREABLE) > > uart.port.flags |= UPF_SHARE_IRQ; > > - uart.port.uartclk = 1843200; > > + if (device_property_read_u32(&dev->dev, "clock-frequency", &uart.port.uartclk)) > > + uart.port.uartclk = 1843200; > > uart.port.dev = &dev->dev; > > You can avoid conditional completely by calling > > device_property_read_u32(&dev->dev, "clock-frequency", &uart.port.uartclk); I want to get the property by this function, and set to default value (1843200) if fails. If remove the condition, how to set the default? Thanks. Huacai > > here. > > -- > With Best Regards, > Andy Shevchenko > </linux></linux></linux></linux></lvjianmin@xxxxxxxxxxx></lvjianmin@xxxxxxxxxxx></jiaxun.yang@xxxxxxxxxxx></lixuefeng@xxxxxxxxxxx></gregkh@xxxxxxxxxxxxxxxxxxx></chenhuacai@xxxxxxxxxxx>