Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7769450rwb; Wed, 23 Nov 2022 10:28:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf41yga5L9oWApAz/WnJXExYlEZEFX/dFPh8ldw2bwkoPu50qwK1fH5WudS4kNgfQfUR690t X-Received: by 2002:a63:1f48:0:b0:439:db5:f817 with SMTP id q8-20020a631f48000000b004390db5f817mr8563626pgm.310.1669228093012; Wed, 23 Nov 2022 10:28:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669228092; cv=none; d=google.com; s=arc-20160816; b=xaoEVLMwnV1qqKI7YGF4yrMf5GS1yB6bSgBR5xMCa3dIkI473CApfAk2iAssDDZgEc 0S3ntOeSIFRp8mjgNnz7hS6DxvlPjTfA4Eap6TCGqRFqd0ZjFj9FkQfLzkeqZxkG/Q83 yMG/lSYZYANcvPlst9+gOdZZv/nMtPHx3u7kx3qMB1N+Gdr0G7rhyqv02VOincXGg82q qrAQbz7aNrJeV40OcDLpPBbTrGMT9dyZC+E25rCzNsKuoORlwBgLypgyPx76vzOX8jkj xA012g9xPA7aXVouA21WgySBF1Y1rJVPp5QUdNUpOWh+vqOjaiTfFC6A5XV+jApLtaNQ N1fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XAy6w8gmcdBCGB2WqwHd4YD9OIJ2+H3z5Lml3ZnuA1g=; b=rt0X7yGOXh1Up0IjMJOt7jzbWioMp6z8RW1sb4tPWshKGaP12jhglarc5JIsT6jWtj /sW2jeFjztmOx4hRz7NsWiOMRjxU33JVtf9ju8zCw2wdMWYJ3i4GQhnbCCP0apdGylYa cacY9bjGHchpA2AAk+ZTXbLJlkVCmsq8SHcdB2UXKZ5l0enAcrVbMXTfqEnWkTWOlpHu bPyw3i+YoXHeASWnsT5moegOFgR59YFyHDmD0oVTd8/GMJAscG39axLyxR/l4QI5HsYb 4jb5IeFieyJLBKS8uTNhG1CVweO94aWQLb6FS04/cOfvPEahf+KAZkyTtvlSqTCnd7Gg aALA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=Jk8A2EV9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b3-20020a056a00114300b0056c8da80411si17826840pfm.43.2022.11.23.10.27.59; Wed, 23 Nov 2022 10:28:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=Jk8A2EV9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239507AbiKWSDQ (ORCPT + 88 others); Wed, 23 Nov 2022 13:03:16 -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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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