From patchwork Tue Jun 4 13:15:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 165785 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5844513ili; Tue, 4 Jun 2019 06:19:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVu/9loKHJZtJhrVQIwwQCn8PlPQa0AdEqPM7ay2RFnrkO34euR71oeAnjtogilrP5/DPn X-Received: by 2002:a17:90a:8c82:: with SMTP id b2mr36316843pjo.97.1559654353720; Tue, 04 Jun 2019 06:19:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559654353; cv=none; d=google.com; s=arc-20160816; b=SpziBVGxCVs2M95I6J0v2zXEHX7vlFdOcPPGQeINlpGKlxsUCcx8Dr4IilDWozRjIC RN6CAw40KXHS8HvipqBnpOlsU5D00C8peBZFbSHckpGOVwD3B68acWjAq8aKvTCN3FY5 fsMXX56KBFN+IvglbCO5Uo63hll+BGMMe0sh+1c+9dA+lvSfIxp6RM3nxCwbx9WLga2o B7gn8D85TUq8ouTTrPSSFPs4uATyQX1hcp5sOB4t/QcbMg6ltUIxeEtv3ybwoSW7D34p d39ZxONjvzqNPxdj+UH3+2TqEQ6TEhvIWdeBQS0ea9ahC907R056luiu6ZnzLTGfcS72 gyvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=3RfvV7ZEVCE0D/QH1puvv34eRoVr5xAL88W1PeCX6A4=; b=i2TcJgm67frgiO8bjAB9MRWKnDPCGEF61xZGptaYvVFGZO2hV5gBrItAQk3yCVLwlE WAjE9wzQvbeKnnRwKX/UtbdrdrKzgAUy8RkLtL0WOIGg+bQcoCzZ80uyAgCkHfcWkoDX AvRO4xtE2hnMS/Whk0tZg9fu0bA9Qd5CyzV1u1Ii28K7O8USKYo2zqstAyKkfCShSfvE 2XKrHl8D5qmfk7JSfnUW7fW5DG+CrRjt1XrorkS1nwmcOei/h8PGPxb1XhBmqT0rNDIX z8vdTvGsmPapWhjySMdhyZm/jx1UppE3IWs70uzfaeBrkUXj4qnhD9n9JQ+uPDHLpfvr kLcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lqjILHti; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u14si8719154pgm.401.2019.06.04.06.19.13; Tue, 04 Jun 2019 06:19:13 -0700 (PDT) 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=@ti.com header.s=ti-com-17Q1 header.b=lqjILHti; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727907AbfFDNTM (ORCPT + 30 others); Tue, 4 Jun 2019 09:19:12 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:55114 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727876AbfFDNTG (ORCPT ); Tue, 4 Jun 2019 09:19:06 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x54DIrkc028239; Tue, 4 Jun 2019 08:18:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559654333; bh=3RfvV7ZEVCE0D/QH1puvv34eRoVr5xAL88W1PeCX6A4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=lqjILHti8GW+J9yPp0G2kM2m0NZYyrO/BSfrIqPN8c7pyHo1d+TOvideKNaLfh4WW QE1pti+R/YsfDiRspBX5/hRgrw5rwaxjTshIUyRxDvBxwCaDvYEgIY1SY8BH5SaYEB gX5DqC/pDEPB++4O+vUUISSafhwcpPPycN31ytEA= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x54DIraS044727 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 4 Jun 2019 08:18:53 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 4 Jun 2019 08:18:52 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 4 Jun 2019 08:18:52 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x54DGdGd098972; Tue, 4 Jun 2019 08:18:48 -0500 From: Kishon Vijay Abraham I To: Tom Joseph , Bjorn Helgaas , Rob Herring , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Gustavo Pimentel CC: Greg Kroah-Hartman , Frank Rowand , Jingoo Han , , , , , , , Kishon Vijay Abraham I Subject: [RFC PATCH 23/30] of/platform: Export of_platform_device_create_pdata() Date: Tue, 4 Jun 2019 18:45:09 +0530 Message-ID: <20190604131516.13596-24-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604131516.13596-1-kishon@ti.com> References: <20190604131516.13596-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Export of_platform_device_create_pdata() to be used by drivers to create child devices with the given platform data. This can be used by platform specific driver to send platform data core driver. For e.g., this will be used by TI's J721E SoC specific PCIe driver to send ->start_link() ops and ->is_link_up() ops to Cadence core PCIe driver. Signed-off-by: Kishon Vijay Abraham I --- drivers/of/platform.c | 9 ++++----- include/linux/of_platform.h | 3 +++ 2 files changed, 7 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 04ad312fd85b..94e0f733461a 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -169,11 +169,9 @@ EXPORT_SYMBOL(of_device_alloc); * Returns pointer to created platform device, or NULL if a device was not * registered. Unavailable devices will not get registered. */ -static struct platform_device *of_platform_device_create_pdata( - struct device_node *np, - const char *bus_id, - void *platform_data, - struct device *parent) +struct platform_device * +of_platform_device_create_pdata(struct device_node *np, const char *bus_id, + void *platform_data, struct device *parent) { struct platform_device *dev; @@ -203,6 +201,7 @@ static struct platform_device *of_platform_device_create_pdata( of_node_clear_flag(np, OF_POPULATED); return NULL; } +EXPORT_SYMBOL(of_platform_device_create_pdata); /** * of_platform_device_create - Alloc, initialize and register an of_device diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 84a966623e78..0f1f58775086 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -70,6 +70,9 @@ extern int of_platform_device_destroy(struct device *dev, void *data); extern int of_platform_bus_probe(struct device_node *root, const struct of_device_id *matches, struct device *parent); +extern struct platform_device * +of_platform_device_create_pdata(struct device_node *np, const char *bus_id, + void *platform_data, struct device *parent); #ifdef CONFIG_OF_ADDRESS extern int of_platform_populate(struct device_node *root, const struct of_device_id *matches,