Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp184213pxb; Wed, 4 Nov 2020 19:02:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSYb9xmuztm3ibbbH9SJSinvzXIBjfX0b2+wbJgKC2rO6Oec4mR7Kda9xvislKACWJtufG X-Received: by 2002:a17:906:50f:: with SMTP id j15mr184446eja.198.1604545370955; Wed, 04 Nov 2020 19:02:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604545370; cv=none; d=google.com; s=arc-20160816; b=rFcn+zRmVaWdzsujeUK5hI8rwmyVpjeEvbI65mQrgqx80o3WtI565X8NSZnu1Dcim2 FllSW/k8FvshuiE45fBBvld3ftZQ+mx42kK8re1yVjX4xpm2pkPl5QtKFRCB01Q6e4O0 2cE8M7GDc0gJ++fkZMHaH73dcgyUuhLd4tFkx/fucoCm+P3CWGd6U+StonHrdsVBFBMZ F1Re/cjV+H7qypBng63j/8tvIu97PbBmfkuKQUH7cFUldsuI2EcWBxI9X/gyNOypApKw Nqs81pOLCvKjZvByt2pcb7ZuF0ls6Ka2sNIS3g7Wxb0YAA/DcmgRz/4uFrK7EIDxE1Lw oLAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=eEB1sRKmOhyKT2s+qdOFoinbYDGAwcO7NeYhfFMxg+Q=; b=YfpADJuP3UOaW6gbgLWUIMplxUlFdXPqBAolfhlBqIjD3IEmDtQYEaBbd2KtdAkO+T T05a4hKK0BZtex2J1pabr3AkgcgKZyGs/mZOouC9HHprxYXh06AUMUXyrGv42LdYd8bu RhPNH7M7mIr/MJXZTxWT7FaZXy9ERRWtJQJnp4Q/NHr0tqJoJYd6EO75cLqiwE6w/dil Q4uXa+lQMSk1uoObzxgCOeIwapEoPo+03E2NDtm7ztbcHuRtSLySURAdbflysWoTVLuy /JZjD+vMyEidxP8FB7D8MTyzQn7584KQSF0gp4W1b/NPNKFI9t82lSxmP58sMENHpPtV VenA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tUt9OmDw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si243429edy.65.2020.11.04.19.02.18; Wed, 04 Nov 2020 19:02:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tUt9OmDw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733077AbgKDXZ1 (ORCPT + 99 others); Wed, 4 Nov 2020 18:25:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732753AbgKDXY2 (ORCPT ); Wed, 4 Nov 2020 18:24:28 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C31EC0613D4 for ; Wed, 4 Nov 2020 15:24:28 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id u11so409814ybh.6 for ; Wed, 04 Nov 2020 15:24:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=eEB1sRKmOhyKT2s+qdOFoinbYDGAwcO7NeYhfFMxg+Q=; b=tUt9OmDwJhcPPhrZNj/nqogKhaEd+90/qdGhb2nTA+Yz2dfpD3noSnHhMam2QzHPjo 9qQ5kwHjM9vLUYpIr7v/CJdtGPmYJF1F9ydUaH4foaY72lus5HdCCq1ZIuU/mN1WiLQY Rrmabtm+iFFUQLIHiC/CR8s53IYF8R3pqCP65NUS7O7coMjWE4Gi0OUhK1LawZAYrjAr LNWhrQdANyVNdGRQ4+lXoU03/4t+zBhZkSb9LJtFWyQ2RjmF6L74Et5xHuwPRcJOMP1Z rv3lHcS4gvr/Tmn8+aT/QZWr3/8fKJeA+W5S/l+iPmK7Q6tS1+T/ImK9dzpcjai2Eamh ZJAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=eEB1sRKmOhyKT2s+qdOFoinbYDGAwcO7NeYhfFMxg+Q=; b=Gj3J0NqMLcBCWk4othIkBbhvgRXAGgCQwnN4nxcbapf104xvYsWAvLNiQop5+DZIT4 xftMKIoOE8Hp+UsQws+FaRnB/x8/tcHHSZDRvrSQ0vRfSh9sV6iMdX+bULACmZiMP9ew 9HDrk/imPHvvMn5G0FWWOkdrL3pHN+Yy1mFB6BJgVKTeczYOP32x7WA1aPQjHZSzq47P wnM1lofsZeCuS2otrLCKRVG2HEQfk/F/jAs5jTx0dL/h4AKvzhe5IbUm64dPQzICerKk 8r793jZzc1565FIsL9xzHCbym5WY2q+6kNr1QGRr/4Hpo7UMMHhi7X9+jfeugtR37lAY k8qg== X-Gm-Message-State: AOAM530li1wXBPT06N/VvqM8M3L+IvGDuL9W0sYeC5tE1Xley/Awq0rl O5NUfwitCptnKn96j3bPbxaCHwejh2EqVTE= Sender: "saravanak via sendgmr" X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:7220:84ff:fe09:fedc]) (user=saravanak job=sendgmr) by 2002:a25:b792:: with SMTP id n18mr294244ybh.93.1604532267406; Wed, 04 Nov 2020 15:24:27 -0800 (PST) Date: Wed, 4 Nov 2020 15:23:48 -0800 In-Reply-To: <20201104232356.4038506-1-saravanak@google.com> Message-Id: <20201104232356.4038506-12-saravanak@google.com> Mime-Version: 1.0 References: <20201104232356.4038506-1-saravanak@google.com> X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog Subject: [PATCH v1 11/18] driver core: Redefine the meaning of fwnode_operations.add_links() From: Saravana Kannan To: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Len Brown , Greg Kroah-Hartman , Ard Biesheuvel , Rob Herring , Frank Rowand , Marc Zyngier , Thomas Gleixner Cc: Saravana Kannan , Tomi Valkeinen , Laurent Pinchart , Grygorii Strashko , kernel-team@android.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, devicetree@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change the meaning of fwnode_operations.add_links() to just create fwnode links by parsing the properties of a given fwnode. This patch doesn't actually make any code changes. To keeps things more digestable, the actual functional changes come in later patches in this series. Signed-off-by: Saravana Kannan --- include/linux/fwnode.h | 42 +++--------------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h index afde643f37a2..ec02e1e939cc 100644 --- a/include/linux/fwnode.h +++ b/include/linux/fwnode.h @@ -78,44 +78,8 @@ struct fwnode_reference_args { * endpoint node. * @graph_get_port_parent: Return the parent node of a port node. * @graph_parse_endpoint: Parse endpoint for port and endpoint id. - * @add_links: Called after the device corresponding to the fwnode is added - * using device_add(). The function is expected to create device - * links to all the suppliers of the device that are available at - * the time this function is called. The function must NOT stop - * at the first failed device link if other unlinked supplier - * devices are present in the system. This is necessary for the - * driver/bus sync_state() callbacks to work correctly. - * - * For example, say Device-C depends on suppliers Device-S1 and - * Device-S2 and the dependency is listed in that order in the - * firmware. Say, S1 gets populated from the firmware after - * late_initcall_sync(). Say S2 is populated and probed way - * before that in device_initcall(). When C is populated, if this - * add_links() function doesn't continue past a "failed linking to - * S1" and continue linking C to S2, then S2 will get a - * sync_state() callback before C is probed. This is because from - * the perspective of S2, C was never a consumer when its - * sync_state() evaluation is done. To avoid this, the add_links() - * function has to go through all available suppliers of the - * device (that corresponds to this fwnode) and link to them - * before returning. - * - * If some suppliers are not yet available (indicated by an error - * return value), this function will be called again when other - * devices are added to allow creating device links to any newly - * available suppliers. - * - * Return 0 if device links have been successfully created to all - * the known suppliers of this device or if the supplier - * information is not known. - * - * Return -ENODEV if the suppliers needed for probing this device - * have not been registered yet (because device links can only be - * created to devices registered with the driver core). - * - * Return -EAGAIN if some of the suppliers of this device have not - * been registered yet, but none of those suppliers are necessary - * for probing the device. + * @add_links: Create fwnode links to all the suppliers of the fwnode. Return + * zero on success, a negative error code otherwise. */ struct fwnode_operations { struct fwnode_handle *(*get)(struct fwnode_handle *fwnode); @@ -155,7 +119,7 @@ struct fwnode_operations { (*graph_get_port_parent)(struct fwnode_handle *fwnode); int (*graph_parse_endpoint)(const struct fwnode_handle *fwnode, struct fwnode_endpoint *endpoint); - int (*add_links)(const struct fwnode_handle *fwnode, + int (*add_links)(struct fwnode_handle *fwnode, struct device *dev); }; -- 2.29.1.341.ge80a0c044ae-goog