From patchwork Fri Feb 23 10:23:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10237345 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 DE377602A0 for ; Fri, 23 Feb 2018 10:29:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C13BD294CC for ; Fri, 23 Feb 2018 10:29:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5C78294FE; Fri, 23 Feb 2018 10:29:28 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 4E848294CC for ; Fri, 23 Feb 2018 10:29:28 +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=aJiPxRQAJpK3JZ/3c8vhe9Fo7GAYUnw/7hZKK2/8CHk=; b=iu6V5Akg4Qpro+qDSCyb6+Aw2o 9VJSsKZywrUT0Bf5MQ5BAQyChj2dTTYn1RuDgd5Udc1rX7761dZTU6Okt+83BE5xTPEjBfXn3cOfw EDGvylnMnRjr+9Ii3ObbxXHAcGWV7aBL/SU8/1Trw0qLWISk7Njwdwq+R5A7boCZVQNFCEWBVYGWM OnVTywKwc+EXStO81U79TvjYeYF8+bpvlzgEegfcUm4ay6zXT3Uu10I8vTFjDZqUbb4N4tv26mqHO YgbJsCSAT4F7rDuh6G3TOy98T7iLABKxw6HfqzDRUuKo1APMWp5g9Rip3Qb7EpjDsFsJLEBAV/r8Z tmuFFLUA==; 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 1epAbS-0001Jo-2D; Fri, 23 Feb 2018 10:29:22 +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 1epAWb-0005xT-O5 for linux-arm-kernel@lists.infradead.org; Fri, 23 Feb 2018 10:26:42 +0000 Received: by mail-pg0-x244.google.com with SMTP id l131so3201301pga.2 for ; Fri, 23 Feb 2018 02:24:11 -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=IX4N6db+RjJ2MZ+2zAzs8Pxe8B0/9+OqWz8edyDgGcE=; b=Du3+6e4UD3MMA3/xxe2MmIsOEbX6Ss88dkaF3te+A/egyfjjcqC9bZjA9bacRkdC5E pi7yhV7KyLGKTX8F6S7ylChztyR272rKb0eFkW82UYCcFPJOkzOiJ6r0NkUi8w7bZvbi 5OvDDX/H7QvUm6o410P4M1EAKRyMaXCHvHEkk= 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=IX4N6db+RjJ2MZ+2zAzs8Pxe8B0/9+OqWz8edyDgGcE=; b=XmT+aUnDCXMhqqPq4+lOE4trBnShAYhCdZWVXOhoY7aA48VbQvj5W2tfggSpGtmOnV 0pPDq9T6IwI0dmT3/UpL2mlLJvGClE3CLlF+inv8jeqcEcYAyWsgBM+SPeNkKlLD0sxx ya1EKDSnxQWniQu/4v16mfzIrrynFaFyiC7voAS9AhwnGgTPdNvMU6K49bzdyyulSg4Q +3ynYw1aZxR7Hroh/h7EugEM3vrGlCvUn9G+RQnBKTCFXlZGHZ3yngKjQ5hnlzVG9aMy /BRyeKKWPWLMMvL23ExmTpb+vJA78u5so9KNwxkoEJFWheHT3+y/nh4tLA9Oms8ZeRyA Garw== X-Gm-Message-State: APf1xPBRgPBgx9PX0du8UbJuifozidoxZde62cKV2VVNaV3DZOLr6AHu 1ljmDZX4TE+3GhagPqRkZO8haw== X-Google-Smtp-Source: AH8x226fj8zUcwMAsMg3NRpWU7xv80dLvEEqKKWfr2DoXT4ekY7HBi69N0V1dipfaDSY9GhDvCiogQ== X-Received: by 10.98.166.85 with SMTP id t82mr1253182pfe.237.1519381450706; Fri, 23 Feb 2018 02:24:10 -0800 (PST) Received: from localhost ([122.167.232.138]) by smtp.gmail.com with ESMTPSA id r28sm4389295pfl.9.2018.02.23.02.24.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 02:24:09 -0800 (PST) From: Viresh Kumar To: Greg Kroah-Hartman Subject: [PATCH V7 02/13] of: platform: Make of_platform_bus_create() global Date: Fri, 23 Feb 2018 15:53:41 +0530 Message-Id: <0f725b5b58bcdc22d03a436ad8243b98c962593a.1519380923.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-20180223_022621_988167_F80BE646 X-CRM114-Status: GOOD ( 13.13 ) 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 , Stephen Boyd , Viresh Kumar , s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, xuwei5@hisilicon.com, olof@lixom.net, 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 72853f9043e6..dfbb9f38cb37 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -392,10 +392,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 5fb20afaf895..7a5313553c2a 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -76,6 +76,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, @@ -89,6 +93,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,