From patchwork Wed Jan 10 03:47:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 123998 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4788366qgn; Tue, 9 Jan 2018 19:48:07 -0800 (PST) X-Google-Smtp-Source: ACJfBotWHcDuDcl97AhQD+6QPIcvreDCEJj+RzA57n6o7M8gsLWv7jrtq3WLmEKzoS7MKHSHdlQw X-Received: by 10.159.244.8 with SMTP id x8mr17645045plr.24.1515556087310; Tue, 09 Jan 2018 19:48:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515556087; cv=none; d=google.com; s=arc-20160816; b=0PgihZpF/KehlmRBL1H1dtA1gQMiUtTeKencJlUGIdcMpFI8ANcf8TsCGGSFd5zfq7 7c5sRl0tBOUdMh7qgiTIPoiEN66sX9xo1mohakFAKRphhBB6QYx1s+V8PioKZXycdt8A R6dnprzVn0fVqa3R/h+ejiApZTpRBkqvoEZxF04FaL+avNFEVGAmSI7DFmG4sAJ+yWbE 2jwHyfx/3ApEVGW2yoCYFu+SIUPxsbX/wFCm8aAY5S+rrGAFsOwToCh95Lx2nD6hQOsZ djIGQ3aPbv1ibMJKv6c6pJ/JWl6FlQEgQXeUqY09jcfTQy4KWuXMUtFc9aGkCmYcW3D5 brww== 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:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=hu7kPGEaReq4+9/jCNp4EVxDei3L0FcSw0t3TsHucLE=; b=ch8GJEgbZ0vhPD4fBDErsIWe32J7tQyTwIrKfg2peiSJjUqtcKnwjDpxCYdn4MPUud oHZxI8aJdWmgLChYw8pvv1GmGerjuJwWeYcj+WjjSYDux033RRSZJdX1FCTAtbazZaFc s1JD4iwa8kDoFTeK2wPLKxkdZzFrFM7OCw9dl4bAAOJ07ev4RRqCsX+Dm7gSb3kLTQdc v8AQ3xACB6Do3vKqBZemLZu1VfFOIrJ3iMyRDbpkc4CF9pQv9s1FW+uVnxTWQnlaoDrq +ovX8n1RvQcUPItsF/2967z7fIfftaYrFpqMEhyzJzfWH5WiSntahkK+JFTSluWJpfSv +18g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EQ0fURib; 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 q4si11364208plb.249.2018.01.09.19.48.07; Tue, 09 Jan 2018 19:48:07 -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=EQ0fURib; 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 S965178AbeAJDsD (ORCPT + 28 others); Tue, 9 Jan 2018 22:48:03 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:38894 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965127AbeAJDr6 (ORCPT ); Tue, 9 Jan 2018 22:47:58 -0500 Received: by mail-pg0-f65.google.com with SMTP id t67so9803928pgc.5 for ; Tue, 09 Jan 2018 19:47:58 -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 :in-reply-to:references; bh=hu7kPGEaReq4+9/jCNp4EVxDei3L0FcSw0t3TsHucLE=; b=EQ0fURibvu7+X6Zq+IGBmcLumH+nmFbRnAOg6xnQ0e8adZSKyawVXJlHHWdH2NVD+0 J68fZg1GE9ZbR9GNIOaSdYKxvHWbySJSdaU270uyse5+EXubxlFwvlxFZqLApzMMAHZo 1dVWlRo6devGYpb8VOvZelCVQ6N+prAt8wCaQ= 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:in-reply-to:references; bh=hu7kPGEaReq4+9/jCNp4EVxDei3L0FcSw0t3TsHucLE=; b=oIcF5NbQZZO2MWTkxkvvQubDaHcRBks25w79mYAdfLPcLSJBENUEQAygVq6WqUUwmN Lcp+Im3HYuzBIGqs+oOjDu25IogoLWAoNHABtmZfoMSxd04fuIl+Vfkp5NBkEscJz1vC lKTh1lm2PCS9OhsR5NRgwRPNzCzGZiSt2ViVHMCP+JJ9KSHs9VAdNUXNo3Mfe/3DsvbP H1izlf36dEHofTZfYymGUuz1F24SUylxIq13MstxizmRSQ+3aZgB5TwFhFiEezoSgk02 Jsuw2T5XXwOauKKn+2t1IUD0UTc8OneAV9dOqRSNZHPWv+BiWF1mY2fWAtJ/c7OYBqeJ ebcw== X-Gm-Message-State: AKGB3mLuVwoJH1qZ8w+sCpXiWbq1JhpagibB2gnJH7tHkKMZE9PX8t8C DIzdwjZGXWffDgbMSxlF3Rwkcg== X-Received: by 10.98.201.26 with SMTP id k26mr15705054pfg.103.1515556078099; Tue, 09 Jan 2018 19:47:58 -0800 (PST) Received: from localhost ([122.172.19.39]) by smtp.gmail.com with ESMTPSA id v64sm33106083pfi.187.2018.01.09.19.47.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2018 19:47:57 -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: Wed, 10 Jan 2018 09:17:31 +0530 Message-Id: <543ef96471882c52fa70183c41787bad442f8bcc.1515554879.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 In-Reply-To: References: In-Reply-To: References: 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 --- 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,