All of lore.kernel.org
 help / color / mirror / Atom feed
From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] of: match the compatible in the order set by the dts file
Date: Tue, 09 Jul 2013 08:27:00 -0600	[thread overview]
Message-ID: <51DC1DB4.3050802@wwwdotorg.org> (raw)
In-Reply-To: <20130709070541.GQ516@pengutronix.de>

On 07/09/2013 01:05 AM, Sascha Hauer wrote:
> On Fri, Jul 05, 2013 at 04:43:38PM +0800, Huang Shijie wrote:
>> If we set the uart compatible in the dts file like this:
>>    ------------------------------------------------------
>>     compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
>>    ------------------------------------------------------
>>
>> and we set the uart compatible in the uart driver like this:
>>    ------------------------------------------------------
>> 	{ .compatible = "fsl,imx1-uart", ... },
>> 	{ .compatible = "fsl,imx21-uart", ... },
>> 	{ .compatible = "fsl,imx6q-uart", ... },
>> 	{ /* sentinel */ }
>>    ------------------------------------------------------
>>
>> the current code will match the "fsl,imx21-uart" in the end.
>>
>> Of course, this is not what we want. We want it to match the "fsl,imx6q-uart".
>>
>> This patch rewrites the match code, and make it to check the compatible
>> in the order set by the DTS file.
> 
> Why don't you set the matching order in the driver the way you want it
> to be, i.e.:
> 
> 	{ .compatible = "fsl,imx6q-uart", ... },
> 	{ .compatible = "fsl,imx21-uart", ... },
> 	{ .compatible = "fsl,imx1-uart", ... },

DT semantics are that earlier entries in the compatible property are
supposed to be matched first, irrespective of how the driver is constructed.

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren@wwwdotorg.org>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Huang Shijie <b32955@freescale.com>,
	grant.likely@linaro.org, devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, rob.herring@calxeda.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] of: match the compatible in the order set by the dts file
Date: Tue, 09 Jul 2013 08:27:00 -0600	[thread overview]
Message-ID: <51DC1DB4.3050802@wwwdotorg.org> (raw)
In-Reply-To: <20130709070541.GQ516@pengutronix.de>

On 07/09/2013 01:05 AM, Sascha Hauer wrote:
> On Fri, Jul 05, 2013 at 04:43:38PM +0800, Huang Shijie wrote:
>> If we set the uart compatible in the dts file like this:
>>    ------------------------------------------------------
>>     compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
>>    ------------------------------------------------------
>>
>> and we set the uart compatible in the uart driver like this:
>>    ------------------------------------------------------
>> 	{ .compatible = "fsl,imx1-uart", ... },
>> 	{ .compatible = "fsl,imx21-uart", ... },
>> 	{ .compatible = "fsl,imx6q-uart", ... },
>> 	{ /* sentinel */ }
>>    ------------------------------------------------------
>>
>> the current code will match the "fsl,imx21-uart" in the end.
>>
>> Of course, this is not what we want. We want it to match the "fsl,imx6q-uart".
>>
>> This patch rewrites the match code, and make it to check the compatible
>> in the order set by the DTS file.
> 
> Why don't you set the matching order in the driver the way you want it
> to be, i.e.:
> 
> 	{ .compatible = "fsl,imx6q-uart", ... },
> 	{ .compatible = "fsl,imx21-uart", ... },
> 	{ .compatible = "fsl,imx1-uart", ... },

DT semantics are that earlier entries in the compatible property are
supposed to be matched first, irrespective of how the driver is constructed.

  parent reply	other threads:[~2013-07-09 14:27 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-05  8:43 [PATCH] of: match the compatible in the order set by the dts file Huang Shijie
2013-07-05  8:43 ` Huang Shijie
2013-07-05  8:43 ` Huang Shijie
2013-07-09  7:05 ` Sascha Hauer
2013-07-09  7:05   ` Sascha Hauer
2013-07-09  7:46   ` Huang Shijie
2013-07-09  7:46     ` Huang Shijie
2013-07-09  7:46     ` Huang Shijie
2013-07-09  7:51     ` Sascha Hauer
2013-07-09  7:51       ` Sascha Hauer
2013-07-09  8:10       ` Huang Shijie
2013-07-09  8:10         ` Huang Shijie
2013-07-09  8:10         ` Huang Shijie
2013-07-09 12:03         ` Rob Herring
2013-07-09 12:03           ` Rob Herring
2013-07-09 14:40           ` Stephen Warren
2013-07-09 14:40             ` Stephen Warren
2013-07-10  2:58           ` Huang Shijie
2013-07-10  2:58             ` Huang Shijie
2013-07-20  5:44         ` Grant Likely
2013-07-20  5:44           ` Grant Likely
2013-07-20  5:44           ` Grant Likely
2013-07-21  6:35           ` Thierry Reding
2013-07-21  6:35             ` Thierry Reding
2013-07-21  6:35             ` Thierry Reding
2013-07-21 20:45           ` Rob Herring
2013-07-21 20:45             ` Rob Herring
2013-07-21 20:45             ` Rob Herring
2013-07-21 23:36             ` Grant Likely
2013-07-21 23:36               ` Grant Likely
2013-07-09 14:27   ` Stephen Warren [this message]
2013-07-09 14:27     ` Stephen Warren

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=51DC1DB4.3050802@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=linux-arm-kernel@lists.infradead.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.