From patchwork Sun Oct 29 13:48:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10031527 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 84616602D6 for ; Sun, 29 Oct 2017 13:59:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D60D20572 for ; Sun, 29 Oct 2017 13:59:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EC4426D05; Sun, 29 Oct 2017 13:59:50 +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 E7DF720572 for ; Sun, 29 Oct 2017 13:59:49 +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=riZ6qGJjAu74CF8WX+GW4JpG5YJK+PBNt/g5eQW7rkM=; b=SE7IYeFarucNQQNu3aeuV8d4Se NVZf8HXV5qCw5QEbf8udhRTEeEuq+PgxhZljMz6PEC9Vcvr21pDQuk9peJDE3f2h7p6ldTSGRfPFN qSei/6g9t1xxCVBVkQGsI0YSohxWTd3/fVwtTjm/wrq223/4EBg35/Gnti9/dRfNFNiBxX7jjPMHx aCAyC5rasWiQDMlET7m8tL6/q00gtFqzJkuzU8jsz9+iRqjPHQJ5lah/DBSkYJrS67uglfiShloEj jlWaQ7Xfvuez79r0UQrY0HPBl4GxsdAdkEy4/7GltLOLuyFu+FPgZDyEQt3gd3vwfRfjpxntO2uJ5 /O8Z9Img==; 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 1e8o7v-0002Fy-TD; Sun, 29 Oct 2017 13:59:47 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e8ny5-0004EI-3N for linux-arm-kernel@lists.infradead.org; Sun, 29 Oct 2017 13:49:39 +0000 Received: by mail-pg0-x244.google.com with SMTP id a192so9100542pge.9 for ; Sun, 29 Oct 2017 06:49:16 -0700 (PDT) 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=i3mB2YTWccTQOCRmFWxHUEe57HzDqBU87FJuMGdYxt4=; b=eW7Z8JqIoA8MkJAaWa2jksiSsnMx9siJuqkV1GW8YwmGZRn8ylphR4yffeBf4mDgAX tNLzPVtG+wVoYFKfP9TdYTWEOOJGQCW0vQ31IsJEDpnOG5kZ3j6hEeWHvHtMUyVD1VHt JvvfTGi436MRDnlr/jUIm4olPCgi9/iGQy4FE= 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=i3mB2YTWccTQOCRmFWxHUEe57HzDqBU87FJuMGdYxt4=; b=P4k0FQ3ICmrI0gxjP7v9Hfvvxc4AuV9yC9bUtK0eGXrfwAO1WwaA6GTDZDMnZZldnO wWGznIF13lYSL7WiAOTWYOVST/OO9ySjBzovRWwoqtwXayhYjJD2gr2I1jqf2BDFYq6i D+TnxiER1hDsj2KIwNVH2DL2nzgDsCeDvZSaAExQKXl27YtFsQfslpOO3CDb0p8FolrO I+sop9Pl82Vtt/F20bky7nQ7uQKyyFFAdYpigH+f82VgXEWNk4YJVbAJkM0ubZgzrSeU rEig3uXDmG7a8SMYL35LKEpDUweTea2TcRs9dDiev2hAjiNehRXcgsLAlRL0d2oTDx6l HGkQ== X-Gm-Message-State: AMCzsaVoLsXgzzJ9gMxpZXEBFBqpq6Pta35E8q7yWCOrZf1XRa4IqWnV 07L0PdvfjK/shzKnO1KPFU83Qw== X-Google-Smtp-Source: ABhQp+Q72ckbzerwSv+oH+eEDkXWmwNJTmuSGDKFQGW2gJy9fgHQCIka8Ie24SlkcXH+/Las8FPiGA== X-Received: by 10.98.156.210 with SMTP id u79mr5772841pfk.50.1509284956055; Sun, 29 Oct 2017 06:49:16 -0700 (PDT) Received: from localhost ([122.167.161.211]) by smtp.gmail.com with ESMTPSA id v15sm23517533pfa.50.2017.10.29.06.49.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Oct 2017 06:49:15 -0700 (PDT) From: Viresh Kumar To: Greg Kroah-Hartman Subject: [PATCH V4 02/12] of: platform: Make of_platform_bus_create() global Date: Sun, 29 Oct 2017 19:18:50 +0530 Message-Id: <0244d3887d8439bb2c65c14fbc37074543b9789d.1509284255.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.rc1.236.g92ea95045093 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171029_064937_190148_1DD04D84 X-CRM114-Status: GOOD ( 11.70 ) 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, devicetree@vger.kernel.org, Rajendra Nayak , Frank Rowand , 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. Cc: Frank Rowand Cc: devicetree@vger.kernel.org Signed-off-by: Viresh Kumar --- drivers/of/platform.c | 8 ++++---- include/linux/of_platform.h | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index b38a8e5908a3..808628842ea8 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -362,10 +362,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 fbf8a6443885..3ee106018b60 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -82,6 +82,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); @@ -118,6 +122,14 @@ static inline int of_platform_device_destroy(struct device *dev, void *data) return -ENODEV; } +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_bus_probe(struct device_node *root, const struct of_device_id *matches, struct device *parent)