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: 10153871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 05DA3602D8 for ; Wed, 10 Jan 2018 03:48:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4AC427528 for ; Wed, 10 Jan 2018 03:48:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6B2527853; Wed, 10 Jan 2018 03:48:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 72F6F27528 for ; Wed, 10 Jan 2018 03:48:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ESHZdsEKsz0X+NKepsuZdYlvbGbeRN+izZfV1L5DB4A=; b=dwOjLOI1KkYq6RoSOgnXyCB8de Po56ZJiN3cnTFJgJggx/7aGtlvOMH/j8d8uL/UqbrrsVawKu+tP7apJXspB123khsUlNIma5MT8uy 2nZNVHaIdY2uogY5Whbmel3L3e3e6Y3bBA4O1YAMt9XxqIAV9nVm/onnTu3WjrjdQBblfA89M6pHW DWChaZ5jfZlwg0u4L1KwbYPa+V3e16jrZNlEyetX5/RA4S6+q4S2VC5EzTb/kMjX2LiNT8Dj+fgbW Xj59C76jWirgCgP8pbhBT2SLxqf6yBDo+LGCkWCz/szpYWTzFIYm/3AV6ZLHVPKcPXC2UDGJYJZ+d 5Ey/6ngA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eZ7Nn-000314-99; Wed, 10 Jan 2018 03:48:55 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eZ7N3-00025r-0q for linux-arm-kernel@lists.infradead.org; Wed, 10 Jan 2018 03:48:12 +0000 Received: by mail-pg0-x244.google.com with SMTP id i5so9808516pgq.11 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=eI1lG9dRkracWyRR/ZZ5rdn6yVUWNwkPTWQOdvq1k/MANFmMm3d6+9LFrMczA895IO xD7f7lRRIFMkjvjhkD5ahCk1KrSPls/wn5mjGDKdSndb+nWDEVAHXWsR2R94f7RKA6ZF qyMEu1c1c3nK9oxPXeS/1uCwwZZmyeAnh6DQHTXkg6sssLtghjbpfzMkRrJkuHv69k1h xEyIE9kHk9KfuoH4ZfoxYlXZX5+UtMEyzOi41yo1K5N3EreKlX9KS3SiaHVY8z7HnwBi aHb9mE1dMy6OVYiEXW90O3GbsEUay47IDPiakIydrR1Rs4zyolBImltLUA9fPgOC28et eKSA== X-Gm-Message-State: AKGB3mLsDShgemqNktiHISGeXf6nsl32MfY+fRyJgxvmu6f6rSMA78Tt w9wRREhV/A04hSuu/C2G4gspTQ== X-Google-Smtp-Source: ACJfBouxNBnZ3fpQeYV0PSUPuedWct6gU+s/awXKtMQTAmiQCl/2bseuHAQQ7xzDC8TyzUe0O07Y9Q== 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 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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180109_194809_261407_B6AA5973 X-CRM114-Status: GOOD ( 11.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nm@ti.com, Rajendra Nayak , Viresh Kumar , s.hauer@pengutronix.de, Stephen Boyd , linux-kernel@vger.kernel.org, xuwei5@hisilicon.com, robdclark@gmail.com, robh+dt@kernel.org, fabio.estevam@nxp.com, Vincent Guittot , shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org, l.stach@pengutronix.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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,