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: 831730 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="eW7Z8JqI"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yPzW53R8lz9t1t for ; Mon, 30 Oct 2017 00:49:37 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751540AbdJ2NtT (ORCPT ); Sun, 29 Oct 2017 09:49:19 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:48765 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751487AbdJ2NtQ (ORCPT ); Sun, 29 Oct 2017 09:49:16 -0400 Received: by mail-pg0-f68.google.com with SMTP id v78so9111676pgb.5 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=CYlkValx8I98nmFNlsl5ab956XfSA82B60W2fK1HNel1m8r1HJukigRNYxVi7/dvOs XRPewwL0yNuhuqlr74WClPx7BR2fKKaQ+9t/ks6K/FZXxZxHnXq5c4PGxXWCcevVORM5 RT22T86CdcSWy2Oyy2NjnOOzKcA50crYp7vtYxF7eCabE4ybRMs0VRzHs0cmiuQsK75F raMgnKlXgUI4gJn++wbyir6z75XvR/+pDVP6jJv6rq4RO9IUNaKK3okaulAsZXTAYAbi kKSwillKx8M3VHEq7Bb8WVpCO78zInI4lxdEWgEE0XCPgxaGS9KbOCfWzqRUGq/fIh0h ZmOA== X-Gm-Message-State: AMCzsaU2ejQgVsdIos//bwZ6q6blBctR/xiQN6ZsayPAOROMK0za+hdG 0wg+opiSZsadyi7O3seI3SnnDA== 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 Cc: Viresh Kumar , Vincent Guittot , Stephen Boyd , Rajendra Nayak , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robdclark@gmail.com, s.hauer@pengutronix.de, l.stach@pengutronix.de, shawnguo@kernel.org, fabio.estevam@nxp.com, nm@ti.com, xuwei5@hisilicon.com, robh+dt@kernel.org, Frank Rowand , devicetree@vger.kernel.org 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: Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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)