From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ns1.gatteins.it (ns1.gatteins.it [193.58.239.94]) by ozlabs.org (Postfix) with ESMTP id 917822C0141 for ; Tue, 2 Apr 2013 20:49:27 +1100 (EST) Message-ID: <515AA9A2.1090100@sirius-es.it> Date: Tue, 02 Apr 2013 11:49:22 +0200 From: Matteo Facchinetti MIME-Version: 1.0 To: Anatolij Gustschin Subject: Re: [PATCH 3/3] powerpc/mpc512x: add platform code for MPC5125. References: <1363801314-16967-1-git-send-email-matteo.facchinetti@sirius-es.it> <1363801314-16967-4-git-send-email-matteo.facchinetti@sirius-es.it> <20130330233241.25846714@crub> In-Reply-To: <20130330233241.25846714@crub> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Cc: gregkh@linuxfoundation.org, linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 03/30/2013 11:32 PM, Anatolij Gustschin wrote: >> +{ >> + char *psc_compats[] = { >> + "fsl,mpc5121-psc", >> + "fsl,mpc5125-psc" >> + }; >> + int i; >> + >> + for (i = 0; i < ARRAY_SIZE(psc_compats); i++) >> + if (of_find_compatible_node(NULL, NULL, psc_compats[i])) >> + return psc_compats[i]; > I don't like this, better would be to use something like: > > if (of_machine_is_compatible("fsl,mpc5121")) > return "fsl,mpc5121-psc"; > > if (of_machine_is_compatible("fsl,mpc5125")) > return "fsl,mpc5125-psc"; > > but note that it will only work if we add these compatibles > to the compatible list of the root nodes in 5121 and 5125 > device trees. I agree with you. But I don't like that: "fsl,mpc5121" is already present in and after its inclusion in , compatible root node value is replaced by "fsl,mpc5121ads". Idea is automatically generate compatible = "fsl,mpc5121", "fsl,mpc5121ads"; using dtsi hierarchy. Is there a way to extend compatible values instead of replace it? Matteo