From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751317AbbI3N5q (ORCPT ); Wed, 30 Sep 2015 09:57:46 -0400 Received: from foss.arm.com ([217.140.101.70]:60225 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878AbbI3N5n (ORCPT ); Wed, 30 Sep 2015 09:57:43 -0400 Date: Wed, 30 Sep 2015 14:57:24 +0100 From: Mark Rutland To: Rob Herring Cc: Marc Zyngier , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Rob Herring , Jason Cooper , Thomas Gleixner , Bjorn Helgaas Subject: Re: [PATCH 1/4] of: Add of_parse_phandle_with_opt_args() helper function Message-ID: <20150930135723.GK10997@leverpostej> References: <1442944336-11754-1-git-send-email-marc.zyngier@arm.com> <1442944336-11754-2-git-send-email-marc.zyngier@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Thread-Topic: [PATCH 1/4] of: Add of_parse_phandle_with_opt_args() helper function Accept-Language: en-GB, en-US Content-Language: en-US User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 29, 2015 at 06:28:11PM +0100, Rob Herring wrote: > On Tue, Sep 22, 2015 at 12:52 PM, Marc Zyngier wrote: > > of_parse_phandle_with_args() is slightly inflexible as it doesn't > > allow the (unusual) case where the #*-cells property is not defined. > > In order to support this, introduce of_parse_phandle_with_opt_args() > > which assumes that #*-cells is zero when it is not defined, > > zero or cell_count - 1? > > I would be okay with always assuming zero rather than being an error > if that simplifies things. It is not really the kernel's job to be a > dtb validator. In most other cases #$foo-cells is strictly required, and you could get bizarre behaviour in drivers by assuming 0. It would be good to keep a warning for those. That said, I guess drivers should be checking that the number of cells is what they expect, so maybe any warnings should exist there. > Also, I assume this was done for some compatibility? Yup. There are existing users without #msi-cells (which is effectively the same as #msi-cells = 0). > In general, we should be explicit, so "#msi-cells = <0>" should be > recommended and we should update dts files if they are not. I agree, assuming we retain support for existing DTBs which lack #msi-cells. Mark.