devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Stephen Warren <swarren@wwwdotorg.org>,
	Thierry Reding <thierry.reding@avionic-design.de>
Cc: Mitch Bradley <wmb@firmworks.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Mike Frysinger <vapier@gentoo.org>,
	Ryan Mallon <rmallon@gmail.com>, Arnd Bergmann <arnd@arndb.de>,
	devicetree-discuss@lists.ozlabs.org,
	Colin Cross <ccross@android.com>,
	Rob Herring <rob.herring@calxeda.com>,
	Olof Johansson <olof@lixom.net>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Richard Purdie <rpurdie@rpsys.net>,
	Bernhard Walle <walle@corscience.de>,
	Matthias Kaehlcke <matthias@kaehlcke.net>,
	linux-tegra@vger.kernel.org, Eric Miao <eric.y.miao@gmail.com>,
	Shawn Guo <shawn.guo@linaro.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	linux-arm-kernel@lists.infradead.org,
	Kurt Van Dijck <kurt.van.dijck@eia.be>
Subject: Re: [PATCH v5 09/16] pwm: tegra: Add device tree support
Date: Fri, 06 Apr 2012 18:44:34 -0700	[thread overview]
Message-ID: <20120407014434.D28983E23CD@localhost> (raw)
In-Reply-To: <4F7C93A4.5000906@wwwdotorg.org>

On Wed, 04 Apr 2012 12:32:04 -0600, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 04/03/2012 11:00 PM, Thierry Reding wrote:
> > * Grant Likely wrote:
> >> On Tue, 3 Apr 2012 19:55:11 +0200, Thierry Reding <thierry.reding@avionic-design.de> wrote:
> >>> * Stephen Warren wrote:
> >>>> On 04/02/2012 02:37 AM, Thierry Reding wrote:
> >>>>> * Stephen Warren wrote:
> >>>>>> On 03/28/2012 08:33 AM, Thierry Reding wrote:
> >>>>>>> Add auxdata to instantiate the PWFM controller from a device tree,
> >>>>>>> include the corresponding nodes in the dtsi files for Tegra 20 and
> >>>>>>> Tegra 30 and add binding documentation.
> >>>>>>>
> >>>>>>> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
> >>>>>>> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
> >>>>>>
> >>>>>>> diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
> >>>>>> ...
> >>>>>>> +#ifdef CONFIG_OF
> >>>>>>> +static struct of_device_id tegra_pwm_of_match[] = {
> >>>>>>> +	{ .compatible = "nvidia,tegra20-pwm" },
> >>>>>>> +	{ .compatible = "nvidia,tegra30-pwm" },
> >>>>>>
> >>>>>> Could you swap those two lines, so that tegra30-pwm matches first. It
> >>>>>> makes no difference at present, but might in the future if the driver
> >>>>>> actually has to differentiate the two SoCs.
> >>>>>
> >>>>> I thought the matching order was determined by the compatible property in the
> >>>>> device tree, not the OF match table of the driver.
> >>>>
> >>>> At least logically, yes. However, of_match_device() appears to iterate
> >>>> over each match table entry, checking whether it matches any string in
> >>>> the compatible flag. Perhaps this could be considered a bug?
> >>>
> >>> It certainly is counter-intuitive. Maybe Grant or Rob can comment?
> >>
> >> Yes, it is a bug.  The order of of_device_id should be entirely
> >> irrelevant, and the order in the DT compatible property should
> >> determine which match entry is returned.
> > 
> > I've had a look at the code and it looks like a fix will not be entirely
> > trivial. I think moving out the compatible check out of the while loop in
> > of_match_node() and separately iterate over all strings in the compatible
> > property would be the easiest. That will also prioritize the compatible
> > match over matches by name and type but I think that's exactly what we
> > want. From a quick look it certainly seems like the large majority of
> > drivers match by compatible anyway.
> > 
> > Do you want me to prepare a patch or can you take care of it?

yes please.

g.

  reply	other threads:[~2012-04-07  1:44 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-28 14:33 [PATCH v5 00/16] Add PWM framework and device tree support Thierry Reding
     [not found] ` <1332945238-14897-1-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-28 14:33   ` [PATCH v5 01/16] pwm: Add PWM framework support Thierry Reding
     [not found]     ` <1332945238-14897-2-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-29 21:41       ` Mark Brown
2012-04-04  6:36       ` Shawn Guo
     [not found]         ` <20120404063605.GB7264-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-04-04  6:39           ` Thierry Reding
2012-03-28 14:33   ` [PATCH v5 02/16] pwm: Allow chips to support multiple PWMs Thierry Reding
     [not found]     ` <1332945238-14897-3-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-29 21:50       ` Mark Brown
2012-04-04  6:44       ` Shawn Guo
2012-03-28 14:33   ` [PATCH v5 03/16] pwm: Add debugfs interface Thierry Reding
     [not found]     ` <1332945238-14897-4-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-29 21:56       ` Mark Brown
2012-04-04  6:47       ` Shawn Guo
2012-03-28 14:33   ` [PATCH v5 04/16] pwm: Add table-based lookup for static mappings Thierry Reding
     [not found]     ` <1332945238-14897-5-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-29 22:03       ` Mark Brown
2012-03-30  5:06         ` Thierry Reding
     [not found]           ` <20120330050641.GA21823-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-03-30 10:18             ` Mark Brown
     [not found]               ` <20120330101800.GD21950-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-03-30 10:38                 ` Thierry Reding
     [not found]                   ` <20120330103840.GB961-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-03-31 14:30                     ` Thierry Reding
     [not found]                       ` <20120331143021.GA18382-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-04-01 15:20                         ` Shawn Guo
     [not found]                           ` <20120401152042.GE2395-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-04-02  0:47                             ` Shawn Guo
     [not found]                               ` <20120402004730.GA910-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-04-02  4:50                                 ` Thierry Reding
2012-03-28 14:33   ` [PATCH v5 05/16] pwm: Add device tree support Thierry Reding
     [not found]     ` <1332945238-14897-6-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-28 14:53       ` Arnd Bergmann
2012-03-29 21:47       ` Mark Brown
     [not found]         ` <20120329214717.GG4153-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-03-30  6:24           ` Thierry Reding
2012-03-28 14:33   ` [PATCH v5 06/16] ARM: tegra: Fix PWM clock programming Thierry Reding
2012-03-28 14:33   ` [PATCH v5 07/16] ARM: tegra: Provide clock for only one PWM controller Thierry Reding
2012-03-28 14:33   ` [PATCH v5 08/16] pwm: Add NVIDIA Tegra SoC support Thierry Reding
     [not found]     ` <1332945238-14897-9-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-30 18:57       ` Stephen Warren
2012-04-04  6:54       ` Shawn Guo
2012-03-28 14:33   ` [PATCH v5 09/16] pwm: tegra: Add device tree support Thierry Reding
     [not found]     ` <1332945238-14897-10-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-30 19:00       ` Stephen Warren
     [not found]         ` <4F7602CD.2010808-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-04-02  8:37           ` Thierry Reding
     [not found]             ` <20120402083749.GA6576-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-04-02 15:42               ` Stephen Warren
     [not found]                 ` <4F79C8D4.2000306-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-04-03 17:55                   ` Thierry Reding
     [not found]                     ` <20120403175511.GA26399-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-04-03 19:43                       ` Rob Herring
2012-04-03 23:42                       ` Grant Likely
2012-04-04  5:00                         ` Thierry Reding
     [not found]                           ` <20120404050054.GA30807-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-04-04 18:32                             ` Stephen Warren
2012-04-07  1:44                               ` Grant Likely [this message]
2012-03-28 14:33   ` [PATCH v5 10/16] pwm: Move Blackfin PWM driver to PWM framework Thierry Reding
2012-03-28 14:33   ` [PATCH v5 11/16] pwm: Move PXA " Thierry Reding
2012-03-28 14:33   ` [PATCH v5 12/16] ARM i.MX: Move i.MX pwm driver to pwm framework Thierry Reding
2012-03-28 14:33   ` [PATCH v5 13/16] ARM Samsung: Move s3c " Thierry Reding
2012-03-28 14:33   ` [PATCH v5 14/16] ARM vt8500: Move vt8500 " Thierry Reding
2012-03-28 14:33   ` [PATCH v5 16/16] pwm: Take over maintainership of the PWM subsystem Thierry Reding
2012-03-28 14:33 ` [PATCH v5 15/16] pwm-backlight: Add rudimentary device tree support Thierry Reding
     [not found]   ` <1332945238-14897-16-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-30 19:04     ` Stephen Warren
     [not found]       ` <4F7603BC.2050300-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-04-04 18:11         ` Thierry Reding

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=20120407014434.D28983E23CD@localhost \
    --to=grant.likely@secretlab.ca \
    --cc=arnd@arndb.de \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=ccross@android.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=eric.y.miao@gmail.com \
    --cc=kurt.van.dijck@eia.be \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=matthias@kaehlcke.net \
    --cc=olof@lixom.net \
    --cc=rmallon@gmail.com \
    --cc=rob.herring@calxeda.com \
    --cc=rpurdie@rpsys.net \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.guo@linaro.org \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@avionic-design.de \
    --cc=vapier@gentoo.org \
    --cc=walle@corscience.de \
    --cc=wmb@firmworks.com \
    /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).