Re: [PATCH] of: match the compatible in the order set by the dts file

From: Grant Likely
Date: Sat Jul 20 2013 - 08:22:43 EST


On Tue, 9 Jul 2013 16:10:53 +0800, Huang Shijie <b32955@xxxxxxxxxxxxx> wrote:
> äº? 2013å¹´07æ??09æ?¥ 15:51, Sascha Hauer å??é??:
> > On Tue, Jul 09, 2013 at 03:46:34PM +0800, Huang Shijie wrote:
> >> äº? 2013å¹´07æ??09æ?¥ 15:05, Sascha Hauer å??é??:
> >>> 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", ... },
> >>>
> >> yes. i can set it like this.
> >>
> >> but this method looks like a ugly workaround.
> > If a driver has different ways of supporting a single device, then
> > putting the preferred or most feature rich on top doesn't look very ugly
> > to me.
> this method makes it much _coupled_ between the driver and the dts file.
>
> IMHO, it's an unnecessary _burden_ to the driver programmer:
> he should puts the most feature compatible on the top.
>
> it's much graceful if we let the driver programmer be transparent about
> this.

Absolutely true. Applied, thanks.

g.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/