From: Mark Zhan <rongkai.zhan@windriver.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org
Subject: Re: [PATCH 2/3] 82xx: Parse SMC serial device node in DTS
Date: Tue, 17 Jul 2007 21:53:05 +0800 [thread overview]
Message-ID: <1184680385.18501.51.camel@mark> (raw)
In-Reply-To: <200707171406.03455.arnd@arndb.de>
On Tue, 2007-07-17 at 14:06 +0200, Arnd Bergmann wrote:
> On Tuesday 17 July 2007, Mark Zhan wrote:
> > On Tue, 2007-07-17 at 03:02 +0200, Arnd Bergmann wrote:
> > > On Monday 16 July 2007, Mark Zhan wrote:
> > > > - cpm_uart_data.uart_clk = ppc_proc_freq;
> > > > + if (strstr(model, "SMC")) {
> > > > + cpm_uart_dev = platform_device_register_simple("fsl-cpm-smc:uart",
> > > > + i, &r[0], 3);
> > > > + } else if (strstr(model, "SCC")) {
> > > > + cpm_uart_dev = platform_device_register_simple("fsl-cpm-scc:uart",
> > > > + i, &r[0], 3);
> > > > + }
> > >
> > > You should probably use of_device_is_compatible() to check
> > > if a given device can be used by a particular driver.
> >
> > I think, the function of_find_compatible_node(), which is called in the
> > for loop, has already done that. So definitely, no need to call
> > of_device_is_compatible() any more.
>
> It's a little more complicated than that. The "compatible" property should
> indicate the exact interface of that device, so the "model" does not really
> matter here. I don't know the difference between smc and scc, but if you
> need to register them as different pplatform devices, they should
> normally also have different names in "compatible", possibly in addition
> to the existing one.
>
> If the compatible property contains "fsl,cpm-smc\0cpm_uart", you can scan for
> either of them. The loop will iterate over all cpm_uart compatible devices,
> while the later test will look for an fsl,cpm-smc compatible device.
Arnd,
Yes, basically I agree what you say. That should be the right way.
but, the current situation is that: in all DTS files that are using smc
or scc as uart device, all device node definitions have the same
"compatible" property -- "cpm_uart"
So what I do here is just following the upstream source tree.
Thanks
Mark Zhan
next prev parent reply other threads:[~2007-07-17 13:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-16 9:01 [PATCH 2/3] 82xx: Parse SMC serial device node in DTS Mark Zhan
2007-07-17 1:02 ` Arnd Bergmann
2007-07-17 4:49 ` Mark Zhan
2007-07-17 12:06 ` Arnd Bergmann
2007-07-17 13:53 ` Mark Zhan [this message]
2007-07-17 13:06 ` Arnd Bergmann
2007-07-17 14:29 ` Mark Zhan
2007-07-17 14:18 ` Arnd Bergmann
2007-07-17 16:06 ` Scott Wood
2007-07-17 15:12 ` Segher Boessenkool
2007-07-17 15:08 ` Segher Boessenkool
2007-07-17 14:22 ` Arnd Bergmann
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=1184680385.18501.51.camel@mark \
--to=rongkai.zhan@windriver.com \
--cc=arnd@arndb.de \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.