Thread (13 messages) 13 messages, 4 authors, 2011-02-28

Re: [Nios2-dev] [PATHV v2] tty: serial: altera_uart: Add devicetree support

From: Tobias Klauser <tklauser@distanz.ch>
Date: 2011-02-18 08:15:49
Also in: linux-serial, lkml

On 2011-02-18 at 09:08:53 +0100, Grant Likely [off-list ref] wrote:
On Thu, Feb 17, 2011 at 6:28 PM, Thomas Chou [off-list ref] wrote:
quoted
On 02/17/2011 03:48 PM, Tobias Klauser wrote:
quoted
quoted
quoted
+       ret = altera_uart_get_of_uartclk(pdev, port);
+       if (ret&&   platp)
+               port->uartclk = platp->uartclk;
+       else if (ret)
+               return ret;
+
Better reverse the priority, with platform data checked first.

       if (platp)
               port->uartclk = platp->uartclk;
       else {
               ret = altera_uart_get_of_uartclk(pdev, port);
               if (ret)
                       return ret;
       }
Do you have a specific reasoning for this? I thought it might make sense
to do it in the same order as with the resources above, but I have no
problem changing it to the way you suggest.
Not quite sure. But I see some drivers follow this order, and I just
followed, too.
The reason to check for platform_data first is that if a device has
*both* platform data and a device node pointer, then more than likely
the platform_data is indented to override the device node data.
Thanks Grant and Thomas for the explanation. I was just wondering. I'll
send an updated patch including the changes suggested by Thomas.

Tobias
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help