Re: Re: [PATCH V2] serial: 8250_pnp: Support configurable clock frequency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 14, 2021 at 5:36 AM 陈华才 <chenhuacai@xxxxxxxxxxx> wrote:

...

> &gt; &gt;  #include <linux kernel.h="">
> &gt; &gt;  #include <linux serial_core.h="">
> &gt; &gt;  #include <linux bitops.h="">
> &gt; &gt; +#include <linux property.h="">
> &gt;
> &gt; Can you try to keep it ordered (to some extend), please?
> Existing headers is not in order,

That's why I added in the parentheses "to some extent".

> should I sort them completely?

Just put property.h before serial_core.h.

...

> &gt; &gt;       uart.port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
> &gt; &gt;       if (pnp_irq_flags(dev, 0) &amp; IORESOURCE_IRQ_SHAREABLE)
> &gt; &gt;               uart.port.flags |= UPF_SHARE_IRQ;
> &gt; &gt; -     uart.port.uartclk = 1843200;
> &gt; &gt; +     if (device_property_read_u32(&amp;dev-&gt;dev, "clock-frequency", &amp;uart.port.uartclk))
> &gt; &gt; +             uart.port.uartclk = 1843200;
> &gt; &gt;       uart.port.dev = &amp;dev-&gt;dev;
> &gt;
> &gt; You can avoid conditional completely by calling
> &gt;
> &gt;    device_property_read_u32(&amp;dev-&gt;dev, "clock-frequency", &amp;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.

As I explained above.

x = $default_value;
device_property_read_u32(..., &x);

-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux