From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72A49C4332F for ; Wed, 23 Nov 2022 18:03:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239509AbiKWSDR (ORCPT ); Wed, 23 Nov 2022 13:03:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239370AbiKWSCW (ORCPT ); Wed, 23 Nov 2022 13:02:22 -0500 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8E9197358; Wed, 23 Nov 2022 10:02:21 -0800 (PST) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id AACAA31FF; Wed, 23 Nov 2022 19:02:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1669226539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XAy6w8gmcdBCGB2WqwHd4YD9OIJ2+H3z5Lml3ZnuA1g=; b=Jk8A2EV9KEcSNasbByjuQt4+++GQ/KW67C5/I+Tf74dT/Y9tJd0oBWBzVfadSmgmsDjArL AwzGAodXnZxJGtF/OXmHxDbXMVcO2nlIfqe+EGYtKNX5MUpeUR9FjTiqx3hnu+lG0D6IpL z3Pu8ymOvfx9YDxHRfql5QvX8DH3r2dTAD0TLg+NFpRNEbvvULeFZQPUDaHtPy6g4KRywO 2pLEPltOCEFDDv108Kdxli/pBN+sIAuvezSL5OsBqQ9u0Ld2A9pSqTBNmJIUIta5ofYhZg 6aqrcvjZlb6tUa25OXK9vii2aF+Ptl+J9YuYCRii3iSsJ0FvMHRhc3XiunlkVw== From: Michael Walle To: Jonathan Corbet , Srinivas Kandagatla , Miquel Raynal , Rob Herring , Frank Rowand , Sascha Hauer Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Michael Walle Subject: [PATCH v4 03/20] of: property: make #.*-cells optional for simple props Date: Wed, 23 Nov 2022 19:01:34 +0100 Message-Id: <20221123180151.2160033-4-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221123180151.2160033-1-michael@walle.cc> References: <20221123180151.2160033-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam: Yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sometimes, future bindings for phandles will get additional arguments. Thus the target node of the phandle will need a new #.*-cells property. To be backwards compatible, this needs to be optional. Prepare the DEFINE_SIMPLE_PROPS() to handle the cells name as optional. Signed-off-by: Michael Walle Tested-by: Miquel Raynal --- changes since v3: - new patch drivers/of/property.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/of/property.c b/drivers/of/property.c index 967f79b59016..9773bfeaed9f 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1254,8 +1254,8 @@ static struct device_node *parse_suffix_prop_cells(struct device_node *np, if (strcmp_suffix(prop_name, suffix)) return NULL; - if (of_parse_phandle_with_args(np, prop_name, cells_name, index, - &sup_args)) + if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index, + &sup_args)) return NULL; return sup_args.np; -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 181C4C3A59F for ; Wed, 23 Nov 2022 18:03:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SwsVhefy6byzLk1PVZoBDoaaquL1borfqPMPyxKM+bU=; b=ygkRSYivyUSr6c 96ft2/um2TUZJui3OTqpubStleq5qM1wmNSkwD0G7QKneKCDBl0R4x1H6JxJYvwyZpkUMiVPEfpBo rh1BsAgg/29gXimayAN2/Ou0blTPtjaztWdBRh0Uhgr068YGfPDuYx5sLDg/V81bq5IfujECvshSx WBv7BjL/2x7g88ZoS5T+LyLk1+KctUHQZCD/BVKf9Wb3WdQ8ugk7WPdP5q2mhTMaVjDyIOCzhZPeG gPsq/GhjrWneYd87Vaa47Zbj6fkGP6FITqYeLuDsXeBfudGA261NWwxTUTEl+KocdKGA0m1CastOu l0wDD3pG2HBN4kumoGBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxu56-001OPr-JW; Wed, 23 Nov 2022 18:02:44 +0000 Received: from 0001.3ffe.de ([159.69.201.130] helo=mail.3ffe.de) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxu4k-001OFu-Gp for linux-arm-kernel@lists.infradead.org; Wed, 23 Nov 2022 18:02:25 +0000 Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id AACAA31FF; Wed, 23 Nov 2022 19:02:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1669226539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XAy6w8gmcdBCGB2WqwHd4YD9OIJ2+H3z5Lml3ZnuA1g=; b=Jk8A2EV9KEcSNasbByjuQt4+++GQ/KW67C5/I+Tf74dT/Y9tJd0oBWBzVfadSmgmsDjArL AwzGAodXnZxJGtF/OXmHxDbXMVcO2nlIfqe+EGYtKNX5MUpeUR9FjTiqx3hnu+lG0D6IpL z3Pu8ymOvfx9YDxHRfql5QvX8DH3r2dTAD0TLg+NFpRNEbvvULeFZQPUDaHtPy6g4KRywO 2pLEPltOCEFDDv108Kdxli/pBN+sIAuvezSL5OsBqQ9u0Ld2A9pSqTBNmJIUIta5ofYhZg 6aqrcvjZlb6tUa25OXK9vii2aF+Ptl+J9YuYCRii3iSsJ0FvMHRhc3XiunlkVw== From: Michael Walle To: Jonathan Corbet , Srinivas Kandagatla , Miquel Raynal , Rob Herring , Frank Rowand , Sascha Hauer Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Michael Walle Subject: [PATCH v4 03/20] of: property: make #.*-cells optional for simple props Date: Wed, 23 Nov 2022 19:01:34 +0100 Message-Id: <20221123180151.2160033-4-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221123180151.2160033-1-michael@walle.cc> References: <20221123180151.2160033-1-michael@walle.cc> MIME-Version: 1.0 X-Spam: Yes X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221123_100222_814476_C62183C2 X-CRM114-Status: GOOD ( 12.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Sometimes, future bindings for phandles will get additional arguments. Thus the target node of the phandle will need a new #.*-cells property. To be backwards compatible, this needs to be optional. Prepare the DEFINE_SIMPLE_PROPS() to handle the cells name as optional. Signed-off-by: Michael Walle Tested-by: Miquel Raynal --- changes since v3: - new patch drivers/of/property.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/of/property.c b/drivers/of/property.c index 967f79b59016..9773bfeaed9f 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1254,8 +1254,8 @@ static struct device_node *parse_suffix_prop_cells(struct device_node *np, if (strcmp_suffix(prop_name, suffix)) return NULL; - if (of_parse_phandle_with_args(np, prop_name, cells_name, index, - &sup_args)) + if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index, + &sup_args)) return NULL; return sup_args.np; -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel