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: 121985 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp6964292qgn; Thu, 14 Dec 2017 07:37:28 -0800 (PST) X-Google-Smtp-Source: ACJfBotojkgXWYgCbXuiLVd6k54i7bFyweUmwzZ2/Ry5NMLU6B0LpNJKrBMLKEnxbkSVWxSymjnm X-Received: by 10.101.101.12 with SMTP id x12mr8927401pgv.420.1513265848757; Thu, 14 Dec 2017 07:37:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513265848; cv=none; d=google.com; s=arc-20160816; b=gLxMPSdunL46jn9DwjuOQKAVBVw93u6LAVzR1AR/GCiUIQy48vCEiPvrPCqRuuedxH ksRRnwPJg0ahlsC8mJbxHYx1Z5SJO2QYTP4mQnqRvAVdaPKw7dLtNE77Nk4XueVQOS+y 68JMzI7LW01QXXDtD8Y6DdCG4n8z65zYYqmz2dl9fZlu7tzlc+uSES/DaFqCGH79Z7BL dj8q7X98XOthJ73Rx6UDUv3xF83BTRzg4UZ4WD35jd/oMbPQ11B2O/CakHYyGD7GL8Vi OzzgbSxxG6mHe2B+2Nz/xMk+IWKiuhIl70aFmAojHA/4o/faNXksj6Fb2vIrYjlMnGOm 6X9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=zH/FzqdJj80clYWMIBvDY0RhHgfpv/mcx5mR70beTL4=; b=Y1EaDJIMYTJZiU7k+u4qKoMYnbDpIqqTb4HxMzp+5VfQrUOkYhETgLedbp4TwL7g5q Qx4AVW4xlBAn+2eekowdVkf2/Lx+vYDigMzlm0TKS75S03jIxW6JD7n8ILU8ZFUxoQ78 FN9uTEMdyXKII7c/rTHKj0/TBMsO38hK0EWTpcrN/9sDy0CoCjeS2oSwDmigXizj4wCo llnqNaPN664Z1Kgn3JHFeSNfM2gnab47mPHi7rU1tH6p8r507cMEKfLXmFZH2fabYdD6 AOI0dL2J0FrSFa20n7cs3dMZINaaVEdPFeOCHXHXfy63cS/Jtx7NGmtiep09pF5AtFZc JupQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PXQ3BPZ5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13si3263990plp.665.2017.12.14.07.37.28; Thu, 14 Dec 2017 07:37:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PXQ3BPZ5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753666AbdLNPhY (ORCPT + 19 others); Thu, 14 Dec 2017 10:37:24 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:46480 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753298AbdLNPd4 (ORCPT ); Thu, 14 Dec 2017 10:33:56 -0500 Received: by mail-pf0-f195.google.com with SMTP id c204so3833885pfc.13 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=lO03Dqf93SzEf0oUJdxzRTs++pNY+MDvq5RFQCuPuPUrE7WkW8KKj9FONWfosPHoaW KFHAW0fZ2CcZrg0JY5AUl7C7PvOB/84952SUKTl65wtwHITk/uGg2pnPCIBX9r9HhOLq bmKeN2OuaE8xL1WEysj8a9+Z+jc6TyCr0/XQgU9drtS9HNmKj3zlqadlZ+rNYAomopUC q5ghtxdQfIscXxmoIG/PYgLxqsX8rsbaLW3i11GMtkxilwavAcPLRLdMUVYpDn+8bUsQ V5+ZAp7PFTecLYgK/lGFfj92tVGCNvt2hfqcroRsqCno3/lsyQUYvTdNtaGY+oUcw8rM 0WWQ== X-Gm-Message-State: AKGB3mKymZ3WCiTc7AlZ1P01oUXGUtR86cSD4ZDM1gHUjDlHN84F1DnY iTrqu2FXjBqnxbnLNZWE4lF2TA== 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 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 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: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. Signed-off-by: Viresh Kumar --- drivers/of/platform.c | 8 ++++---- include/linux/of_platform.h | 11 +++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) -- 2.15.0.194.g9af6a3dea062 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,