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: 129351 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp437125lja; Fri, 23 Feb 2018 02:26:51 -0800 (PST) X-Google-Smtp-Source: AH8x226XbTnIQgMHpvvCQfc22rNYXCpqcf8MGNBa+Lgs6YLs6vGUbJJ1q3looBm7Kc9IEM/xp2If X-Received: by 10.98.117.139 with SMTP id q133mr1291095pfc.64.1519381611372; Fri, 23 Feb 2018 02:26:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519381611; cv=none; d=google.com; s=arc-20160816; b=ZrhMrDsp3Nq+qCF45k+clvpo0XKqYPFvJ1Hx11ApMerkgblQQZtDe8ld7PJfhkFAKh 5u+AacyOawiJSzBD5eMAlwrx9olDs2fiHknIcwJI8aR4dytAsRxVcEP814uyu0/UNUP9 bLw0MdMExNwYy6qgirG4NqFi/Mdc705RB/kSEDhcFPvME9QFYmKqTu0k+2fdrwUyx/hg 1kO0t5k24X0cd/L2oKYAWqs+0jkReu4BA8MlRu/K2z5Z1lhQQtrx41MbPJoDiBJ+ocxN nWFbQQnN/W9P3wO8Ky5ypB4EyZKlFBbkijzMgWYkZwdXwRT1jARYzopi0S8VUhW6T+r3 QeJQ== 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=IX4N6db+RjJ2MZ+2zAzs8Pxe8B0/9+OqWz8edyDgGcE=; b=WEuSACRRogeCH9Xwsib5BvdDRlPVfi04p/XC3Nl9u77n5UVpbwvDfET+zbwYu1gjV5 BKDBteyi/IubaKWdrHrRLFlKKkMIXFpdNQLM3yPxZMzkqx3fa0+d4AKN3bsb5Fmk3uio x+oNVyiRy088llDiW4DG9nw4C0FFO2PcdZuuGqpTmYtGKLi6xWNd6ITx0Mhwz7qCvyU8 VYRkBaycczalarE3qGA30ZhKwEpqnaFEt2HbV3iQXL1/CVu63ZcBhNGqYrt+GDb8d//w shxdlnGjwsnbXIode3B6aTGejUWMPqf4xAEX1EoCx0VCzrJxCBxckhfz9lJaqJ7l/cHr iQQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Du3+6e4U; 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 a186si1359376pgc.36.2018.02.23.02.26.51; Fri, 23 Feb 2018 02:26:51 -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=Du3+6e4U; 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 S1751522AbeBWKYQ (ORCPT + 28 others); Fri, 23 Feb 2018 05:24:16 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:43191 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751444AbeBWKYL (ORCPT ); Fri, 23 Feb 2018 05:24:11 -0500 Received: by mail-pg0-f66.google.com with SMTP id f6so3193822pgs.10 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=SA4VD8/xmIoyk4FdVwoSB5TuuNWtZoIVN4liYjh55YEeh93aP/80bQrgyDYYaBged4 7RCnctHPx3Fu+PLQI9dazavANFsGisb1vLQvMznQ9fWsBFrs1Zls7lQzJ7VakZhmR/Hp yiOSjy5Xx2nAc8gm79K549FGUzU6XpC60Vay3B8xad6nRJSvcRM45r7XpFiycj87mhQU 5pEsTEmBmLIThq3T61JWvSZfaIIGPI/LvLfN4ujtfMc1Wzpw/1aMzk5RZh8tAfquT1vv nWEycD3Cx0NUsJAzPJIBTFwgljynzStYKtHX5xRFqAsazQSN0Rfou9E+IlGBlD3i7uef 02rQ== X-Gm-Message-State: APf1xPCbZrj3GohJ/TXHsINfMIUtEfLbbxkfO9DwwnqeRLDaB2tSHruB CoO0mlMKw91lNJ0QWNBwnD+8jQ== 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 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, olof@lixom.net 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: 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 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,