From patchwork Fri Dec 15 03:58:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 122040 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp7685533qgn; Thu, 14 Dec 2017 19:58:28 -0800 (PST) X-Google-Smtp-Source: ACJfBos4HJ8XH8argtLQuSRaTP3u6C9l337tRQV914Lc+wBin/UHWNd3M0iOxDZKx2hKdcuQfmom X-Received: by 10.84.254.2 with SMTP id b2mr11669749plm.407.1513310308728; Thu, 14 Dec 2017 19:58:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513310308; cv=none; d=google.com; s=arc-20160816; b=vx96rhCW2Ekx6/SxjFVbr2mQyDgY2PUK/kH6r3Mhaigqsu/H7CJ7/Kc+7scBRSakg0 YiCNSyAwgdqrISl2/H++IPDlNyT9ddhmFYN8XoKzbToI3ya2UNg2b/EyKqP9a56aVkXT j2TRCPYdB5lnO+4N+4Cg4e54vhlrPpGyLulQU/2WASKULfKQFgDu1uUotEb41ITZKzl3 xfZnAJWEqGTN9oIbHwgDT7o6EC+AQxv8xpBlGZaZzlTh2iwunXAp/U+tpVRug5DQrNl/ kANnsuhQbeGeDDs+oNUjtRRUS2jydSO5oI7Ctmr6Dq7VTIqyRMuAMg67pzl/nF2Vfttk /HRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=m4OJP995D/nutZ+qFEwJa1S7NarS02dUUdr/N/NZFoI=; b=A/lXx7nI7vFmLRxl7eU3aZKznQ4DLDYwhlcRn1z5mOYWO5rnfkmmvdMUghFn6Ghrkn QYhr+W3GHNtxKIZY1GGFoxt70oVkuPc3LEIjt8WYrC9rS+JPVxVHfkOnVRBck17/UY6J E7AOAszTBI+4tjqkJCyLr2bjMP91RoIbQlvh99UcfzwX8LUH20wisz11gyZncI48bIUb JcYLcsgQC3auSFEkUHs7O9IvhqjFP0H67ud4pgpSuom5bQtlATdNKERCuNSeXpgs76ys +7uHzRGwC2aplTD6DHX+e0QInswvs6UQs6TYNP11DRWy10l94jQ2I/Gx2YZ92UAtzORZ WfTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RwIu97ih; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si2177017plj.342.2017.12.14.19.58.28; Thu, 14 Dec 2017 19:58:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RwIu97ih; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754992AbdLOD6Y (ORCPT + 19 others); Thu, 14 Dec 2017 22:58:24 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:39935 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754972AbdLOD6V (ORCPT ); Thu, 14 Dec 2017 22:58:21 -0500 Received: by mail-pf0-f193.google.com with SMTP id l24so5254232pfj.6 for ; Thu, 14 Dec 2017 19:58:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=m4OJP995D/nutZ+qFEwJa1S7NarS02dUUdr/N/NZFoI=; b=RwIu97ihg9ggP0I27DfsbWx+Ep0jB4TdNOXHPEB7a52A2QR1OG1CsyRcKazuxfuIpH kSqsx4AI/PV8ozOHlR67kifq3A2X5/VAMcdsfqkZNE9bzloruBjKOkZbfIN8nZ7fTudg M0Bb3Hu7gO4lJu8w3AdI/FwNkYgrAV7L+2uv0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=m4OJP995D/nutZ+qFEwJa1S7NarS02dUUdr/N/NZFoI=; b=qG6Pv6eoUofQ8wAMw22eRna5Nh1n8XmWyOpGabgz97rrOcJP8qPBHcbFPEBmxYzGtH pWCLopaC2xVkZwo636Y4DOofRF3+sPM9OCe4C6GFJsFOa3c5LFSE5kERJQmdAhqbzgZw cSDYY6f3vT1FDV+bxb+pBU1Y2NdSoZxoAs7yPau8M8ppFVzV9/TXuxqnKiAB3O0dVLV5 nSUrP4GrRSCsMEG4EsFcBz3qu+YMNfu3XP3E5P3eogmhOdiab6t+2+JsoCceO0/+EpFr K5LQBlGOGVfjM0U2pOd4c/UWzc8IUuiIFqsAII4I9YvoCJRO/Dw8Iw8UimG/FBn3pjwO IEag== X-Gm-Message-State: AKGB3mK4L7ZOJJClCjL39dqIUZPcax+8+cT6Bniohtrr3gyVvaM98g8H FyxzPNoQYFEAZ5I1MS6uQpFGDg== X-Received: by 10.99.108.66 with SMTP id h63mr10701817pgc.362.1513310300824; Thu, 14 Dec 2017 19:58:20 -0800 (PST) Received: from localhost ([122.172.99.7]) by smtp.gmail.com with ESMTPSA id e8sm10936986pfk.6.2017.12.14.19.58.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Dec 2017 19:58:19 -0800 (PST) From: Viresh Kumar To: Greg Kroah-Hartman Cc: Viresh Kumar , Vincent Guittot , Stephen Boyd , Rajendra Nayak , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robdclark@gmail.com, s.hauer@pengutronix.de, l.stach@pengutronix.de, shawnguo@kernel.org, fabio.estevam@nxp.com, nm@ti.com, xuwei5@hisilicon.com, robh+dt@kernel.org Subject: [PATCH V6 02/13] of: platform: Make of_platform_bus_create() global Date: Fri, 15 Dec 2017 09:28:09 +0530 Message-Id: <83a2f2479ecc6c44a1bfdd89f55f315da7bafc7c.1513309217.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 In-Reply-To: <3875af7e7e77745f02ad429f09a1ad168a55e248.1513264961.git.viresh.kumar@linaro.org> References: <3875af7e7e77745f02ad429f09a1ad168a55e248.1513264961.git.viresh.kumar@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The boot constraints core needs to create platform or AMBA devices corresponding to a compatible string and not for rest of the nodes in DT. of_platform_bus_create() fits in the best to achieve that. Allow it to be used outside of platform.c. Signed-off-by: Viresh Kumar --- V6: - Build bot reported a compilation error when CONFIG_OF_ADDRESS isn't selected in .config. - Git didn't catch the change in the file when I rebased the patches to the latest kernel and applied this patch cleanly and so I missed that the function declaration is placed outside of the #ifdef/endif block. - This patch just moves the declaration within the CONFIG_OF_ADDRESS block. drivers/of/platform.c | 8 ++++---- include/linux/of_platform.h | 11 +++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) -- 2.15.0.194.g9af6a3dea062 diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 61a4a81bea9f..6f707bfb348f 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -397,10 +397,10 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l * Creates a platform_device for the provided device_node, and optionally * recursively create devices for all the child nodes. */ -static int of_platform_bus_create(struct device_node *bus, - const struct of_device_id *matches, - const struct of_dev_auxdata *lookup, - struct device *parent, bool strict) +int of_platform_bus_create(struct device_node *bus, + const struct of_device_id *matches, + const struct of_dev_auxdata *lookup, + struct device *parent, bool strict) { const struct of_dev_auxdata *auxdata; struct device_node *child; diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 4909d1aa47ec..ff80fba79c41 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -81,6 +81,10 @@ extern int of_platform_bus_probe(struct device_node *root, const struct of_device_id *matches, struct device *parent); #ifdef CONFIG_OF_ADDRESS +extern int of_platform_bus_create(struct device_node *bus, + const struct of_device_id *matches, + const struct of_dev_auxdata *lookup, + struct device *parent, bool strict); extern int of_platform_populate(struct device_node *root, const struct of_device_id *matches, const struct of_dev_auxdata *lookup, @@ -94,6 +98,13 @@ extern int devm_of_platform_populate(struct device *dev); extern void devm_of_platform_depopulate(struct device *dev); #else +static inline int of_platform_bus_create(struct device_node *bus, + const struct of_device_id *matches, + const struct of_dev_auxdata *lookup, + struct device *parent, bool strict) +{ + return -ENODEV; +} static inline int of_platform_populate(struct device_node *root, const struct of_device_id *matches, const struct of_dev_auxdata *lookup,