From patchwork Thu Feb 22 03:46:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 204554 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:aa16:b0:108:e6aa:91d0 with SMTP id by22csp14835dyb; Wed, 21 Feb 2024 19:47:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWOncM6D8IgHtS41YXF9AFmUR3Qw/XL/YkBm3nYw7air81V3JRoUhobMyKtllH/Nw7tYjW0N9vroPfUCq7SzRJxMBo2pw== X-Google-Smtp-Source: AGHT+IGNyhW9gMYNYVf+6h1cGGGheEX+wa51rPMb6/rHy07gkLzWPb9K6uY8dDUov1R2dkGImod5 X-Received: by 2002:a05:6a00:13a6:b0:6e4:c54b:9681 with SMTP id t38-20020a056a0013a600b006e4c54b9681mr1954885pfg.9.1708573619959; Wed, 21 Feb 2024 19:46:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708573619; cv=pass; d=google.com; s=arc-20160816; b=esF98p30KC46YG6GcgI+fQ8U8BWFpf3AJ73vCDZKQLZyErtJx9Hp1Ey9++HuV/y2aZ +ePDwisttmTuzrcWd8fgNxiX9aZ9A2kIIiqE3dI2QlFlG3RIJ/n3segBW9SXc3gvpq3a Pvv+G6tG14+ig5Bk70r8Jeeq76YHfQ5WsLblO+L2wb2aZhjLDw+bNO+2K3iO+umPzHMA PF+WW/HYFpl0CzdKTH0pljDJa1VVKCuJ3UeQZPGtiQr1xTKMdwQzcM/nPVxg36ZU4fz/ LAuIYTmNJPbz7/uZcYAaTQLR3Rr29dbEpcKxD/ISzaIx3w4GCv6cjF3Xx3IgdrkqzxTX 0lZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:references:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:in-reply-to:date :dkim-signature; bh=2RZcm32i75equt/unWf5KMZ/RAcqfb/I89ao1kCyS8A=; fh=L1U5MbITZODrN5iOioWX4JaFGd9/A/fmlRYrMAYwpeA=; b=Vg2omXYFR5bk7D4e3WpeAo2OW1KfRB+zJjQuOK0Hj2FTsjmtIaxtTNbMp6YWegAQ/i 0vAQhR++YqcaqyCTrZ2wxBFUewmD1YZBRnTvxd6+nAwMWJgXyDyQV3aOVIcn2sSOo4w2 EPtFfVljXbrWsLdvKojjV3uAp5JEgaRe6eHu3P44cOgrkzUFBVVSQPdWztY3V1jUHd0V 0+djPDQ4JCwtTrlbbLAxovudPMjoqXV6pCXJAekIJjQYJ7G0eweTW68nqd9LW6r3vZwj 6jphmif+uRv+cj4wQBX/Fk/XwJL/NJcOc9VYf2yuP2g29wwzHvHykENCPHKBOpEgm3r5 RWww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=VNhOeutf; arc=pass (i=1 spf=pass spfdomain=flex--saravanak.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-75869-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75869-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s17-20020a632c11000000b005ced2a6b890si3999272pgs.668.2024.02.21.19.46.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 19:46:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75869-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=VNhOeutf; arc=pass (i=1 spf=pass spfdomain=flex--saravanak.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-75869-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75869-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B8FD4284F66 for ; Thu, 22 Feb 2024 03:46:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95EDB1865B; Thu, 22 Feb 2024 03:46:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="VNhOeutf" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09FC31775F for ; Thu, 22 Feb 2024 03:46:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708573593; cv=none; b=eobd3jys3wFY55YlvpmvslmjE8coqAqWLTmNVqUmy/ixlhhqmcFtGkHf8y+GaICXjCkEIe3gxxJfJJsEikxR1iGP+IbXOYVyuBABmQxhkVlGlZXmjbQnn9Vp8TdtFubJ+p1CJy4NbLLHbtn2XEwlVLR5dYZz7tqPxLLT+uqzvhc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708573593; c=relaxed/simple; bh=O3k+nYu1MYBPKH6TsA/y54d2ADLO3F4v2KYWl0x8bqo=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Cc:Content-Type; b=QdEOWHp0mfCqXN+ONpabgr3rfOyUjNjYGzmcmVZZlO3dDmD/DLYEq4xDkFz5X8an30L1+rXc82Rz9RtwyxpgZwVWqekO20/QrtjqUjmqgVDl1uBnvwJfP7MXWlZRCSYViL9KNMTcPOFEpel5ZzjHJvS3QUJKhZ5Maf5Tl5WKgFk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--saravanak.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=VNhOeutf; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--saravanak.bounces.google.com Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dcbfe1a42a4so2828944276.2 for ; Wed, 21 Feb 2024 19:46:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708573591; x=1709178391; darn=vger.kernel.org; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=2RZcm32i75equt/unWf5KMZ/RAcqfb/I89ao1kCyS8A=; b=VNhOeutf99wuKQ4mc9T//DCHqlek+iA/ffF7r67ow5P4Lgnh7YHO6RKcL0sOEl6Y7r DfBto8hTyDAO0HPwOKi0d14XYSAnEdip8lT5BieTWasTF67ZCn4GNAZZ49dvAsJbOMQ7 pBxVoR9Mx+G4iUqCVIKmhWBso5ydF6rdnETLa3WeJd7Vz27yEtrOtZjzQtS+mN7QWMY0 8oKgy/7yiHtaKqAtIccGj5e3apAPGlP+9lAqbwBF87oVmVxRjYDXyQ3yrX6GcdzBSukw NV/TdsQ4Jp220XbFeijE/pm8MioibnU9S8UmuII37oIUpLbRfxoMjSwCkGMItFKFF/Uu kHEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708573591; x=1709178391; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2RZcm32i75equt/unWf5KMZ/RAcqfb/I89ao1kCyS8A=; b=aaKt/HDBpxYZY4H0W/FlCvJ8O6bwQaLR6fosgk2/Py5JX7EIEzaHStvB9OEVurugan eQri5eA5gESZ8dkqRWQJRMd6p4IlYstMXXn0Zex5YY/21UfF2a+QxVkkNfv8L1l5n/Io peIUFt1gT79o0pTRcvjk7R16Hgw1Bqh56BoPEqFxYhLALC9uVnC/UKvX071noyoQlCJR LHcwzTzCNapIccHEGTheJAbiCGC5WnGJpsAGfppYbhmDgMYJzSZNNXsqzL2fsoluMLvz gtYut/jKUA077JKnn6sC7LAGSqv6xb7CVugziBI3oGdnEbnGTOf70ejumW6stFphHRfT /3HA== X-Forwarded-Encrypted: i=1; AJvYcCWTirNMsJsiOfTalhZluYi8Ex0MCgrgbnUuLAt47XYrBYPoVLauzflJ0x778J1a4R9tjLgT7C6u4RAh6ON7YPLrLVL4olwyG5dM9T19 X-Gm-Message-State: AOJu0YxE9pN35iBtNPKz68AC6uh4fsBO7J6O2oeqL+XhkX+K35z+vzXm lHGIvL5U3PN2rqixcmfTMFNW+s9lEJsaBy7fC04gMk/+kLdplmAm90I6MegM7vkqkWwlDoAYz4F U5OjvMjLHcVENNg== X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:451c:c6c5:1fb1:a2a1]) (user=saravanak job=sendgmr) by 2002:a05:6902:150c:b0:dc6:e1ed:bd1a with SMTP id q12-20020a056902150c00b00dc6e1edbd1amr340344ybu.2.1708573591099; Wed, 21 Feb 2024 19:46:31 -0800 (PST) Date: Wed, 21 Feb 2024 19:46:19 -0800 In-Reply-To: <20240222034624.2970024-1-saravanak@google.com> Message-Id: <20240222034624.2970024-2-saravanak@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240222034624.2970024-1-saravanak@google.com> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog Subject: [PATCH v4 1/4] driver core: Adds flags param to fwnode_link_add() From: Saravana Kannan To: Saravana Kannan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , "Rafael J. Wysocki" , Ard Biesheuvel , Frank Rowand , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Len Brown Cc: kernel-team@android.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-efi@vger.kernel.org, linux-acpi@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791569292117845618 X-GMAIL-MSGID: 1791569292117845618 Allow the callers to set fwnode link flags when adding fwnode links. Signed-off-by: Saravana Kannan --- drivers/base/core.c | 5 +++-- drivers/firmware/efi/sysfb_efi.c | 2 +- drivers/of/property.c | 2 +- include/linux/fwnode.h | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 9828da9b933c..adeff041d472 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -92,12 +92,13 @@ static int __fwnode_link_add(struct fwnode_handle *con, return 0; } -int fwnode_link_add(struct fwnode_handle *con, struct fwnode_handle *sup) +int fwnode_link_add(struct fwnode_handle *con, struct fwnode_handle *sup, + u8 flags) { int ret; mutex_lock(&fwnode_link_lock); - ret = __fwnode_link_add(con, sup, 0); + ret = __fwnode_link_add(con, sup, flags); mutex_unlock(&fwnode_link_lock); return ret; } diff --git a/drivers/firmware/efi/sysfb_efi.c b/drivers/firmware/efi/sysfb_efi.c index 456d0e5eaf78..cc807ed35aed 100644 --- a/drivers/firmware/efi/sysfb_efi.c +++ b/drivers/firmware/efi/sysfb_efi.c @@ -336,7 +336,7 @@ static int efifb_add_links(struct fwnode_handle *fwnode) if (!sup_np) return 0; - fwnode_link_add(fwnode, of_fwnode_handle(sup_np)); + fwnode_link_add(fwnode, of_fwnode_handle(sup_np), 0); of_node_put(sup_np); return 0; diff --git a/drivers/of/property.c b/drivers/of/property.c index b71267c6667c..bce849f21ae2 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1085,7 +1085,7 @@ static void of_link_to_phandle(struct device_node *con_np, tmp_np = of_get_next_parent(tmp_np); } - fwnode_link_add(of_fwnode_handle(con_np), of_fwnode_handle(sup_np)); + fwnode_link_add(of_fwnode_handle(con_np), of_fwnode_handle(sup_np), 0); } /** diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h index 2a72f55d26eb..c964749953e3 100644 --- a/include/linux/fwnode.h +++ b/include/linux/fwnode.h @@ -210,7 +210,8 @@ static inline void fwnode_dev_initialized(struct fwnode_handle *fwnode, } extern bool fw_devlink_is_strict(void); -int fwnode_link_add(struct fwnode_handle *con, struct fwnode_handle *sup); +int fwnode_link_add(struct fwnode_handle *con, struct fwnode_handle *sup, + u8 flags); void fwnode_links_purge(struct fwnode_handle *fwnode); void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode);