lkml.org 
[lkml]   [2013]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] of: match the compatible in the order set by the dts file
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.



\
 
 \ /
  Last update: 2013-07-10 23:38    [W:0.089 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site