From patchwork Wed Nov 23 18:01:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 25104 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2941700wrr; Wed, 23 Nov 2022 10:04:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf4thPOuRkRtSMiJiRAyK1MagzKdH3c+a/dXVwd313f213Ota9rjxqqSx49OruORQ/9+dm4+ X-Received: by 2002:ac2:5453:0:b0:4a2:2c23:a6d4 with SMTP id d19-20020ac25453000000b004a22c23a6d4mr9085935lfn.257.1669226686362; Wed, 23 Nov 2022 10:04:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669226686; cv=none; d=google.com; s=arc-20160816; b=kyQwNEolQLJgTijlMMMbPZjj/p/y4p1oe+IOL4XiIRtwKseAmc8xxIzZC183KGw3zC SbtpX36QyCbEV7K4oaV9unEgq1oV21r1MYZiV+h2Z+0DukgK1z8EJPY4W3LY3XPffJdQ ngIcn4mvOINFvNX0jVsIc2eRfLyKMweQY10DKYtCTRbcQPdnFON6Nx7t/MoXHamsPeGZ SgBiG1gq7Ngo4GAQn1/qe/He2iodPccGfYu3wBmFqJPmUAP3WH2IhY5MOe87/MDXjxiY ndmTMU/aZDaam3O6Oqe1VARhXIXSQJCOhxoSdoBw0LTyJ+YhzRfFI86YrDvY0PTESYQQ l3xw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw4-20020a170906478400b007919c624eadsi15447864ejc.522.2022.11.23.10.04.11; Wed, 23 Nov 2022 10:04:46 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750311041604797064?= X-GMAIL-MSGID: =?utf-8?q?1750311041604797064?= 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 Reviewed-by: Rob Herring --- 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;