From patchwork Mon Jul 14 07:12:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 33551 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D0E7F20CAD for ; Mon, 14 Jul 2014 07:33:36 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id ij19sf15588752vcb.6 for ; Mon, 14 Jul 2014 00:33:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=Xy+4Uep1PV5uYujyYzhgEtFqfqyp64ZFP/8LWgoCEdM=; b=A8wDQyFULzaL4R8Wac8nIsa7qa8PyWROrBb65y34v16UnAsdTGt3MmDex4a3eewvmc 7E5oSGU6ARqVuaFu/B9E3YCxn6+Jupk6MaCPbTfqgisINBv5yuhGHXXUynkHfek2MbOW EgpA5I+QhIwDlIHW6ufZ3gtBFKr8cmi21Ti/SLRfEu9z7BnHEP7EdDH3s/KGiIK6MgR4 xe3iOD4mrAUI5hDH0TVmh9xS48WavYo1kmNV9Ti8zbPt+O7YrS2K9LV+P/5qBF2kaVus xh3tslv/9jpl4ipZjMs65PCGu6HfRYbdnAgEy93ahWa9wW7TMpH/RghBkCIeUyVztIC6 ynjA== X-Gm-Message-State: ALoCoQmWjBt1JXPmLjpQTFsj3MszeTnJzS5mwLjovCyzA6Sbajz2n53y+ojGopd8e2k6I4QhbAen X-Received: by 10.236.124.100 with SMTP id w64mr2467792yhh.57.1405323216546; Mon, 14 Jul 2014 00:33:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.46.99 with SMTP id j90ls961984qga.49.gmail; Mon, 14 Jul 2014 00:33:36 -0700 (PDT) X-Received: by 10.220.68.140 with SMTP id v12mr14889221vci.13.1405323216451; Mon, 14 Jul 2014 00:33:36 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id r6si633216vei.7.2014.07.14.00.33.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jul 2014 00:33:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id hu12so1364664vcb.34 for ; Mon, 14 Jul 2014 00:33:36 -0700 (PDT) X-Received: by 10.52.0.177 with SMTP id 17mr12527062vdf.12.1405323216388; Mon, 14 Jul 2014 00:33:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp112905vcb; Mon, 14 Jul 2014 00:33:35 -0700 (PDT) X-Received: by 10.68.57.232 with SMTP id l8mr15142863pbq.79.1405323215531; Mon, 14 Jul 2014 00:33:35 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ka6si8513035pbc.153.2014.07.14.00.33.34; Mon, 14 Jul 2014 00:33:34 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753265AbaGNHdd (ORCPT + 8 others); Mon, 14 Jul 2014 03:33:33 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:50335 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752785AbaGNHda (ORCPT ); Mon, 14 Jul 2014 03:33:30 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N8O00G69YBN0X90@mailout1.w1.samsung.com>; Mon, 14 Jul 2014 08:33:23 +0100 (BST) X-AuditID: cbfec7f5-b7f626d000004b39-6b-53c387c72b2d Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 3B.F3.19257.7C783C35; Mon, 14 Jul 2014 08:33:27 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N8O00FFGYBLTX50@eusync3.samsung.com>; Mon, 14 Jul 2014 08:33:27 +0100 (BST) From: Marek Szyprowski To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marek Szyprowski , Benjamin Herrenschmidt , linaro-mm-sig@lists.linaro.org, devicetree@vger.kernel.org, Arnd Bergmann , Michal Nazarewicz , Grant Likely , Tomasz Figa , Sascha Hauer , Laura Abbott , Nishanth Peethambaran , Marc , Josh Cartwright , Catalin Marinas , Will Deacon , Paul Mackerras , Jon Medhurst , Joonsoo Kim , "Aneesh Kumar K.V." , Andrew Morton Subject: [PATCH v2 2/4] drivers: of: initialize and assign reserved memory to newly created devices Date: Mon, 14 Jul 2014 09:12:44 +0200 Message-id: <1405321966-28184-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1405321966-28184-1-git-send-email-m.szyprowski@samsung.com> References: <1405321966-28184-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFLMWRmVeSWpSXmKPExsVy+t/xq7rH2w8HG0x4ZGgxZ/0aNovHr+ex WPyddIzd4kNTK7PF+2U9jBbzj5xjtTjwZwejxcruZjaLneveMVqcbXrDbrG9cwa7xZcrD5ks Nj2+xmpxedccNou1R+6yW2x4eZDJYsHxFlaLP9PlLNYcWcxu8Xf7JhaL9TNes1gsnH+f3eLl xxMsDuIea+atYfT4/WsSo8flvl4mj52z7rJ79LxpYfXoenuFyePOtT1sHidm/GbxeHBoM4vH 5iX1Hrf/PWb2WPfnFZNH/18Dj7m7+hg9+rasYvT4vEkuQCCKyyYlNSezLLVI3y6BK+PFxkbW gqN8Fas3/mdrYJzO08XIySEhYCJxY2srG4QtJnHh3nogm4tDSGApo8SyBc2MIAkhgT4miffH JEFsNgFDia63XWANIgJuEv/WHQJrYBZYwCZx9P8PsAZhgVSJC2+2sYDYLAKqEk1/bzOD2LwC HhK/XhxmgtgmJ/H/5Qowm1PAU2Lj5G+sEMs8JA7v28M4gZF3ASPDKkbR1NLkguKk9FwjveLE 3OLSvHS95PzcTYyQ+Pq6g3HpMatDjAIcjEo8vAX8h4OFWBPLiitzDzFKcDArifCGuwGFeFMS K6tSi/Lji0pzUosPMTJxcEo1MG4JiWRh6265Jdrjkf3n2uar6x/+Ovj+3rsXAjsiz/GkbD3z 7VGoVXqrkb5v/EMvfs1TeR4rIoMzKox5163S3mb7NCY8Qax15cw7h32W50w6HuAgzJuvufdT A+vpvGNrd15t9zjD5jrRxbM/7ztzcPHPiH55rR41o3ufo+T7/kbv8OW8/qH1ihJLcUaioRZz UXEiAIrYSJKNAgAA Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m.szyprowski@samsung.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Use recently introduced of_reserved_mem_device_init() function to automatically assign respective reserved memory region to the newly created platform and amba device. Signed-off-by: Marek Szyprowski --- drivers/of/platform.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 6c48d73a7fd7..a7f967866f13 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -21,6 +21,7 @@ #include #include #include +#include #include const struct of_device_id of_default_bus_match_table[] = { @@ -237,12 +238,15 @@ static struct platform_device *of_platform_device_create_pdata( dev->dev.bus = &platform_bus_type; dev->dev.platform_data = platform_data; + of_reserved_mem_device_init(&dev->dev); + /* We do not fill the DMA ops for platform devices by default. * This is currently the responsibility of the platform code * to do such, possibly using a device notifier */ if (of_device_add(dev) != 0) { + of_reserved_mem_device_release(&dev->dev); platform_device_put(dev); goto err_clear_flag; } @@ -304,6 +308,8 @@ static struct amba_device *of_amba_device_create(struct device_node *node, else of_device_make_bus_id(&dev->dev); + of_reserved_mem_device_init(&dev->dev); + /* Allow the HW Peripheral ID to be overridden */ prop = of_get_property(node, "arm,primecell-periphid", NULL); if (prop) @@ -330,6 +336,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node, return dev; err_free: + of_reserved_mem_device_release(&dev->dev); amba_device_put(dev); err_clear_flag: of_node_clear_flag(node, OF_POPULATED);