From patchwork Thu Dec 14 15:33: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: 10112581 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 A241F6019C for ; Thu, 14 Dec 2017 15:44:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9286B29555 for ; Thu, 14 Dec 2017 15:44:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85FE629677; Thu, 14 Dec 2017 15:44:37 +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 0B72629542 for ; Thu, 14 Dec 2017 15:44:37 +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=jBuCULnv1LOv0gR/EYCNMIjNLurN+6CsRpsB8TSTXbc=; b=lmxkQSfB1TyIP/KIjOql/0suEG 4VKrS/zo5a+6LE2CfLCB6ZkBZLOGlvODi5dkRGSssEEh7P7ORjv04ImZ9PWLGxb1diVu2keu5LWOI tJl6GNnbVBicI3PwYUQGw16kP5vj530f+5YzoqRup5JKLeuW8QqebK+qnHyXT1E7QF+9U+Kxj747N 3enw1mG6DuHFUn2TRrso2SoZI/KlQ246To7rpwJBxPZ9XULvd10hhIKebPUq0+AaA2ohLqGQvNkid llTMsadNWqHx1fv0vIySv/y8GESWclrUIMtPPE7PJqR7Lpl97qLP2l3t2AJ2B77mULw0RrTfDBNLF NF5NHaSg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ePVgY-0003qI-Rl; Thu, 14 Dec 2017 15:44:34 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ePVWa-0003dh-Gu for linux-arm-kernel@lists.infradead.org; Thu, 14 Dec 2017 15:34:18 +0000 Received: by mail-pf0-x244.google.com with SMTP id v26so3851981pfl.7 for ; Thu, 14 Dec 2017 07:33:56 -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=zH/FzqdJj80clYWMIBvDY0RhHgfpv/mcx5mR70beTL4=; b=PXQ3BPZ5F47jUP/fzv/x99+H5dl2mZ/Tt5DvDXwiNZXjA9pKl0EXFSdwENFol1CnjU OrCsgFezGGqasijYRlfIhtzd4+iJtkf58fjIxx/3j+M1UxjnreWTcpmBbfgFRAFbV03N Tkr/XG/McjvlqOlMvlRkKjlKUxxlTIxDJOTx0= 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=zH/FzqdJj80clYWMIBvDY0RhHgfpv/mcx5mR70beTL4=; b=TTZq9voKiygDMQwp6dR2Oa4xZfYT+cnSaMqGLOcerwhwsBh4u1Npr65ycoat9rAumY Wot8XYvE1ZBcPG3tLpYn9NYDIDz6qGt16iOxtA5wGtgZ8PzhRS+zd+u9H7QcVvQRYRdI HPHgxuKiIzt4mJ6RbqhgqNtsiY1+nOmAWInmdxYE5sCYc9YlKM/qZemCU2nlTRUzSoRt 4rYEB2sWMUiE4MZEzUYE0QQCDCdhicnXWLm+ZVCAnOKHGlFgRn1LgMuek8yqolIbGgqZ bXGI9hq38EWVS3xlFDplqWDxe7pSIUCWsAWHU0562GAhmddUo4jmrkkoT6p7XtbGdHCb DShQ== X-Gm-Message-State: AKGB3mINgWi2W0pM141gw7Ij0sIMRxUKJXkjA9IuCI49QEvJmFgc/p6q cNx7/1kyRqxjsdxJw9qkrTlBfQ== X-Google-Smtp-Source: ACJfBoskRfX1+dpyxUFD0j0JxdIs8VSCcU5OpMafGgkoeq/5n28naoAiYHhN811WQ20tbTqqK5I1HA== X-Received: by 10.98.8.67 with SMTP id c64mr10080613pfd.50.1513265636313; Thu, 14 Dec 2017 07:33:56 -0800 (PST) Received: from localhost ([122.172.99.7]) by smtp.gmail.com with ESMTPSA id y3sm8772051pff.122.2017.12.14.07.33.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Dec 2017 07:33:55 -0800 (PST) From: Viresh Kumar To: Greg Kroah-Hartman Subject: [PATCH V5 02/13] of: platform: Make of_platform_bus_create() global Date: Thu, 14 Dec 2017 21:03:09 +0530 Message-Id: <3875af7e7e77745f02ad429f09a1ad168a55e248.1513264961.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-20171214_073416_758048_8AA4D69E X-CRM114-Status: GOOD ( 11.40 ) 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..511a59fb8e15 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -77,6 +77,10 @@ extern struct platform_device *of_platform_device_create(struct device_node *np, struct device *parent); extern int of_platform_device_destroy(struct device *dev, void *data); +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_bus_probe(struct device_node *root, const struct of_device_id *matches, struct device *parent); @@ -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,