Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1726448pxb; Fri, 25 Mar 2022 04:35:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymKlt9WiIAO1ZmAsKQC+cydfjrNH0ooZYEH70QuRkGWYTnuxQIkKHoL3pO55QqIlklxksh X-Received: by 2002:aa7:cd81:0:b0:410:d64e:aa31 with SMTP id x1-20020aa7cd81000000b00410d64eaa31mr12761597edv.167.1648208099653; Fri, 25 Mar 2022 04:34:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648208099; cv=none; d=google.com; s=arc-20160816; b=VZCEfOUkcz0bynYRhNoG9f+TRmgF6kpcCh9sOOERvXxj5Mk9xS00BW6HELnv/FWwG/ WWLHUXhCKoDSMkdPcPdJgBmYF0E4QI9CsLGyubAlZSelQ1+hEoXykKrmhKrk97k3BI2D AqqLbKUBwv8C5I4mBWV2/2vNQVq6mRsLGZWeUdL8xDHqmyLr0WojclYM3BEiuBVUUd/o 9ia4/LuutLO26kWNuv+CAIDowLMdjc7HpUyyaTU81dQop9wIfc/ORmsOa3hCiDjDBB6G ADLtV0UIxomNiv6CtrindS+yCxk/Bkqby6FDikYs3zR6slbMz42MDDXKz3R74axAvcmB Pl1g== 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=xkc1E79+EMhZIZKmqJGwa4SoDzH/uFspi1OYFAhWuYc=; b=tYsE5ay4L/IvGLNLBLQ4qagORkpb1OCsHXddUSukK2StIO7zDT7V4UmBsINigdjdrW hax7OSSs0SdqNRQEJZB95ZdDNAQYu8we8dfab7tapBTM+mKToS7+ZDJKZLfZdbpyHESx +lHzXL7UqZoPRFRtRODNZ2bFdL6r5C03ldPq1shI3+6L6KhSUMIHDhIAkteCA+kOSIfj fRBXnKqMI0Ctm5DohJDP9iEaSvEBGdS6TlksSsZxjzhh4V5N94x+VchqG3o/UDGfszhx pZJN5pF1CQzdhig0Qr383g9IY3N6NUbsicianr/j4+N7+fuxUDgAcNqGB3i3W8b0R9vI TUQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=HMp8G494; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay1-20020a170906d28100b006df76385e45si2209004ejb.741.2022.03.25.04.34.34; Fri, 25 Mar 2022 04:34:59 -0700 (PDT) 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=@bootlin.com header.s=gm1 header.b=HMp8G494; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238095AbiCWJxZ (ORCPT + 99 others); Wed, 23 Mar 2022 05:53:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243337AbiCWJxX (ORCPT ); Wed, 23 Mar 2022 05:53:23 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 753804130B for ; Wed, 23 Mar 2022 02:51:50 -0700 (PDT) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id D41251C0014; Wed, 23 Mar 2022 09:51:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1648029108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xkc1E79+EMhZIZKmqJGwa4SoDzH/uFspi1OYFAhWuYc=; b=HMp8G494ZGJ8dv9CWnZAwJMMWPisuRH0yVkrzEFNzrOQh1VkePeFTOqpe+gNKa2lUL9n7Z 3MC0uZpNbQycqoWoF2zyncR1/nIjucleXnG2QyY53cDI+JDsigGjLFPFjDq6AAIVuaC4zj +TdEM4ETfIjLgHurt5U/Uz7CQu1FuCHj6KELK13dZvko+K9ePMc3K4Gz65XtAMS/QVTrI8 JCOoU/CS48c7bgakubLn7IPMEhR8Pakabm7oMtaGDuea/FPAv4YMV6+PI5HJ0PYSCZNFok OBV9QbiljEECGZx3oD2jOOzt/BY9WUBJ57vFXu2WPzFgCblIXj2MvqwM+zS7vw== From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= To: Philipp Zabel , Rob Herring , Frank Rowand Cc: Thomas Petazzoni , Alexandre Belloni , Allan Nielsen , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= Subject: [PATCH 1/2] of: add function to convert fwnode_reference_args to of_phandle_args Date: Wed, 23 Mar 2022 10:50:21 +0100 Message-Id: <20220323095022.453708-2-clement.leger@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220323095022.453708-1-clement.leger@bootlin.com> References: <20220323095022.453708-1-clement.leger@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Add of_phandle_args_from_fwnode_reference_args() which convert a struct fwnode_reference_args to an of_phandle_args. This is used to maintain compatibility for device-tree specifiers translation functions that are used by various subsystem. Signed-off-by: Clément Léger --- include/linux/of.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/linux/of.h b/include/linux/of.h index 2dc77430a91a..1f6c8927c5ff 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -175,6 +175,18 @@ static inline bool is_of_node(const struct fwnode_handle *fwnode) &__of_fwnode_handle_node->fwnode : NULL; \ }) +static inline void +of_phandle_args_from_fwnode_reference_args(struct of_phandle_args *of_args, + const struct fwnode_reference_args *fwnode_args) +{ + int i; + + of_args->np = to_of_node(fwnode_args->fwnode); + of_args->args_count = fwnode_args->nargs; + for (i = 0; i < fwnode_args->nargs; i++) + of_args->args[i] = fwnode_args->args[i]; +} + static inline bool of_have_populated_dt(void) { return of_root != NULL; @@ -543,6 +555,12 @@ static inline struct device_node *of_find_node_with_property( #define of_fwnode_handle(node) NULL +static inline void +of_phandle_args_from_fwnode_reference_args(struct of_phandle_args *of_args, + const struct fwnode_reference_args *fwnode_args) +{ +} + static inline bool of_have_populated_dt(void) { return false; -- 2.34.1