From patchwork Fri Feb 28 13:42:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 25551 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8270920543 for ; Fri, 28 Feb 2014 13:43:32 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id fa1sf1683760pad.0 for ; Fri, 28 Feb 2014 05:43:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=Pz82EUjsqbC6iF7URijJUWL9Q8f3Y9QXVErKVIve6/I=; b=K3o8IdpDLp4wd56zRU7tJqUYdcj/3/fEycYISo9NzaL5mBmMRNZMlbOkGTxnG69Oo8 h64GV0ZrQ40UDfEBN2timl1fgy4jg1EJz31aoHEkr0j9W7iH0Jiaf/2/KTB/ApBSUFxp Yjq9zYxztVhhW8xKxofcZPp+Y+Y3vepKyv4Z/XToSlKBvGmpIcKvFRFy9JwObMtOOWDV 3PLOrhrtloysSYH+ktCwIIHCTCKiuDXh/Fssvgz2jDFXn+bwsP4MgGb3nKB07u/OnnRx 9QaDK0/PzLg0IHas3bMNYatKq9wf0/3Klwbjtg8xE8WqoHow/WOFRrgSVmFlOV6mFfCc /CVg== X-Gm-Message-State: ALoCoQl0VF0CTXY8y2nQvMyuANnzxC6HBu1d7PUihbdk2H8Tm79qranvObAwIXRpb1ZhkN1wNGx+ X-Received: by 10.67.21.145 with SMTP id hk17mr1141873pad.35.1393595011452; Fri, 28 Feb 2014 05:43:31 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.233 with SMTP id p96ls1037952qgd.33.gmail; Fri, 28 Feb 2014 05:43:31 -0800 (PST) X-Received: by 10.221.66.73 with SMTP id xp9mr2594768vcb.27.1393595011283; Fri, 28 Feb 2014 05:43:31 -0800 (PST) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id xn5si585681vdc.55.2014.02.28.05.43.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Feb 2014 05:43:31 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id lf12so734131vcb.3 for ; Fri, 28 Feb 2014 05:43:31 -0800 (PST) X-Received: by 10.58.37.232 with SMTP id b8mr2649699vek.27.1393595011201; Fri, 28 Feb 2014 05:43:31 -0800 (PST) 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.220.130.193 with SMTP id u1csp54575vcs; Fri, 28 Feb 2014 05:43:30 -0800 (PST) X-Received: by 10.195.13.17 with SMTP id eu17mr2897868wjd.24.1393595010036; Fri, 28 Feb 2014 05:43:30 -0800 (PST) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id pk6si1685694wjc.82.2014.02.28.05.43.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 28 Feb 2014 05:43:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WJNhP-0008Ia-PT; Fri, 28 Feb 2014 13:41:59 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WJNhE-0008HH-Nf for linaro-mm-sig@lists.linaro.org; Fri, 28 Feb 2014 13:41:48 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N1P00I22KRY7P80@mailout2.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Fri, 28 Feb 2014 13:43:10 +0000 (GMT) X-AuditID: cbfec7f5-b7fc96d000004885-3b-531092739b9d Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 96.BE.18565.37290135; Fri, 28 Feb 2014 13:43:15 +0000 (GMT) Received: from amdc1339.mshome.net ([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 <0N1P002ZJKROU750@eusync3.samsung.com>; Fri, 28 Feb 2014 13:43:15 +0000 (GMT) From: Marek Szyprowski To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-mm-sig@lists.linaro.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org Date: Fri, 28 Feb 2014 14:42:51 +0100 Message-id: <1393594976-16728-7-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1393594976-16728-1-git-send-email-m.szyprowski@samsung.com> References: <1393594976-16728-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRmVeSWpSXmKPExsVy+t/xq7rFkwSCDT5t4LD4O+kYu8WHplZm i/fLehgt5h85x2rR/2Yhq8WBPzsYLd70drBY7Fz3jtHibNMbdovtnTPYLb5cechksenxNVaL hW1LWCwu75rDZrH2yF12iw0vDzJZLL1+kcliwfEWVos/0+UsTl3/zGax5shidosJ09eyWLTu PcJu8Xf7JhaLVwfbWCzWz3jNYrFq1x9Gi5cfT7A4yHismbeG0eP3r0mMHq8nT2D0uNzXy+Sx c9Zddo+eNy2sHptWdbJ53Lm2h81j85J6j9v/HjN7XDnRxOqx7s8rJo/+vwYec3f1MXr0bVnF 6PF5k1yAYBSXTUpqTmZZapG+XQJXxrIp51gLXvBVfLzRwNLAuIGni5GTQ0LAROLMnnXMELaY xIV769m6GLk4hASWMkrsm3kayulmkriwYT8bSBWbgKFE19suMFtEYCGjxOd5LCBFzAL32SQ6 LvYwgSSEBdIlrryeBGRzcLAIqEr0nZcFMXkFPCQ6Z6eDmBICChJzJtmAFHMKeEo0TL/PCmIL AVXc/nGdcQIj7wJGhlWMoqmlyQXFSem5RnrFibnFpXnpesn5uZsYIdH4dQfj0mNWhxgFOBiV eHgnePIHC7EmlhVX5h5ilOBgVhLhfdIkECzEm5JYWZValB9fVJqTWnyIkYmDU6qBcWfk9LNe Xe7KCjN82pw+X1lyiH87R9bkns5NJTmmSvPrPDc26MdN8S+1vT85RCmhxm1ji1Lgo/1ZE4MU L9QkXtrVEWlbpT3ZoyyCsW1R2g7eywLX7y+8vjpZqLLexnvbxP3FLb7fovR3PI1rneXGbbm3 4ZBW2fXDews+TRVZknlFX9f9p6m4EktxRqKhFnNRcSIA+ZizP6QCAAA= Cc: Mark Rutland , Benjamin Herrenschmidt , Tomasz Figa , Will Deacon , Tomasz Figa , Paul Mackerras , Arnd Bergmann , Josh Cartwright , Catalin Marinas , Grant Likely , Ian Campbell , Pawel Moll , Stephen Warren , Sascha Hauer , Michal Nazarewicz , Rob Herring , Kumar Gala , Olof Johansson Subject: [Linaro-mm-sig] [PATCH v6 06/11] drivers: of: initialize and assign reserved memory to newly created devices X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-mm-sig-bounces@lists.linaro.org Sender: linaro-mm-sig-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m.szyprowski@samsung.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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 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 404d1daebefa..3df0b1826e8b 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[] = { @@ -220,6 +221,8 @@ 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 @@ -227,6 +230,7 @@ static struct platform_device *of_platform_device_create_pdata( if (of_device_add(dev) != 0) { platform_device_put(dev); + of_reserved_mem_device_release(&dev->dev); return NULL; } @@ -282,6 +286,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) @@ -308,6 +314,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); return NULL; }