From: Tobias Klauser <tklauser@distanz.ch>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Thomas Chou <thomas@wytron.com.tw>,
nios2-dev@sopc.et.ntust.edu.tw,
Greg Kroah-Hartman <gregkh@suse.de>,
linux-serial@vger.kernel.org,
devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org
Subject: Re: [Nios2-dev] [PATHV v2] tty: serial: altera_uart: Add devicetree support
Date: Fri, 18 Feb 2011 09:15:46 +0100 [thread overview]
Message-ID: <20110218081546.GC759@distanz.ch> (raw)
In-Reply-To: <AANLkTinDD71YQbYovBSwU8YSCCZ56wQf35X97WFoY6R9@mail.gmail.com>
On 2011-02-18 at 09:08:53 +0100, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Thu, Feb 17, 2011 at 6:28 PM, Thomas Chou <thomas@wytron.com.tw> wrote:
> > On 02/17/2011 03:48 PM, Tobias Klauser wrote:
> >>>>
> >>>> + 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
next prev parent reply other threads:[~2011-02-18 8:15 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-09 9:51 [PATCH 0/4] *** SUBJECT HERE *** Tobias Klauser
2011-02-09 9:51 ` [PATCH 1/4] tty: serial: altera_uart: Handle pdev->id == -1 in altera_uart_remove Tobias Klauser
2011-02-09 9:56 ` Tobias Klauser
2011-02-09 9:53 ` [PATCH 0/4] *** SUBJECT HERE *** Tobias Klauser
2011-02-09 9:55 ` [PATCH 0/4] tty: serial: Updates for altera_uart driver Tobias Klauser
2011-02-09 9:56 ` [PATCH 1/4] tty: serial: altera_uart: Handle pdev->id == -1 in altera_uart_remove Tobias Klauser
2011-02-09 10:46 ` Anton Vorontsov
2011-02-09 9:57 ` [PATCH 2/4] tty: serial: altera_uart: Use port->regshift to store bus shift Tobias Klauser
2011-02-09 10:46 ` Anton Vorontsov
2011-02-09 9:58 ` [PATCH 3/4] tty: serial: altera_uart: Add devicetree support Tobias Klauser
2011-02-16 4:32 ` Grant Likely
2011-02-16 7:43 ` Tobias Klauser
2011-02-16 12:07 ` Grant Likely
2011-02-16 16:12 ` [PATHV v2] " Tobias Klauser
2011-02-17 2:24 ` [Nios2-dev] " Thomas Chou
2011-02-17 7:48 ` Tobias Klauser
2011-02-18 1:28 ` Thomas Chou
2011-02-18 8:08 ` Grant Likely
2011-02-18 8:15 ` Tobias Klauser [this message]
2011-02-18 10:35 ` [PATCH 3/4 v3] " Tobias Klauser
2011-02-25 17:58 ` Greg KH
[not found] ` <20110225175856.GA17072-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2011-02-28 8:31 ` Grant Likely
2011-02-09 9:58 ` [PATCH 4/4] MAINTAINERS: Add myself as a maintainer for altera_uart/altera_jtaguart Tobias Klauser
2011-02-17 3:16 ` [Nios2-dev] " Thomas Chou
2011-02-17 7:51 ` Tobias Klauser
2011-02-17 18:02 ` Arnd Bergmann
2011-02-17 19:29 ` Tobias Klauser
2011-02-17 19:32 ` [PATCH 0/4] tty: serial: Updates for altera_uart driver Greg KH
2011-02-17 19:38 ` Tobias Klauser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110218081546.GC759@distanz.ch \
--to=tklauser@distanz.ch \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=nios2-dev@sopc.et.ntust.edu.tw \
--cc=thomas@wytron.com.tw \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).