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: 10113757 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 922DA60224 for ; Fri, 15 Dec 2017 03:58:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D8E829C54 for ; Fri, 15 Dec 2017 03:58:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7256429D46; Fri, 15 Dec 2017 03:58:48 +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 EFEA629C54 for ; Fri, 15 Dec 2017 03:58:47 +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=S7iie7xZfy0bYQQ8/W+kvO5PpVCqwwhBlyBkzLOohX0=; b=JqGJ5sO0JKvEaN8L4UWk7L9Azq uvulofu9Nag8v1JkiDmze559GcODUfH8FX4sh8/bRpEhR85Zz7VT5rYY/BJNlAqrgULomA53aoCAB NhcAOt/R4v85tJW12cO/uG+bA1oj6aSPLzMu6h+TlndAqliz8V8/fvUOygk6OiEfytFksqVNpAoFf FZB2xLMHKWH4J+HbZtP9kath/wAo6VZfSyeK3QSfFg8Ko7UsQDTo9xizC7r1OfPSpm5kWhocVsshP ziKF6SfQuUI5B4PJ45mSNQBJs+GtoWf7ovmLFHIhN+MKjDGAlEJlpjf1K8JTgWNlUeBxeo7LuUjdJ 5IXninlg==; 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 1ePh94-0007uo-IB; Fri, 15 Dec 2017 03:58:46 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ePh8z-0007si-Sn for linux-arm-kernel@lists.infradead.org; Fri, 15 Dec 2017 03:58:44 +0000 Received: by mail-pf0-x242.google.com with SMTP id y89so5265955pfk.0 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=Y0/Z2493cFrpsXrrKxGiY55i64sb8v2zkkSB55kLaTtUH4/EG//Ho3SuPqJ34nuESB O2jmk1Tc5zTY1f6btKGMUujKnqUhZHGRRSOjaanh/UzHZA/egtcTvDumafXFvAP9kIVV QCn8dbntGniXBX/V2/DZfw+MrXKyTU7vmdz9DH29CxK8DJlfjt3VHjzgwTSN7snNb9cz zjPXCRdrvorx+KvBZvhKUYjc1sIMEW0omOgjB1pHn9qfE7FcajdCFXLniwVHlgorERkk wti222lIeujiKzQtjY0ekht2zy9K12qWRc7GWzSOXl6f2xqqABT6o5ba8c5fkKNOcV5k GkWg== X-Gm-Message-State: AKGB3mK4R9m5wU4S/8aEDEdSJyaVM1nO8yIfcw1Zr9qOrQu3pFy+Xs3v SIhEdrlC1I15OptZ5DTJevKkgA== X-Google-Smtp-Source: ACJfBotRnNZWlcmUseXDe2gO4NgeSFzPtb25OgY4HEoPh16I+tQRKr207nIwNNpOdofth79gBtbS9A== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171214_195841_990584_B2EC69D4 X-CRM114-Status: GOOD ( 13.81 ) 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 --- 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(-) 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,