From patchwork Wed Jul 2 10:48:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 32966 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2534C20560 for ; Wed, 2 Jul 2014 10:51:22 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id fp1sf51325157pdb.4 for ; Wed, 02 Jul 2014 03:51:21 -0700 (PDT) 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:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=Maqd/VvST/PRTQToyjbs7moWKOZvW2cUJ0Yi8oyEAWI=; b=YpPlEUwCXyNtngN6KRFN6xoO8wdDcMTrmzz74NGzXJ62dLLSRt9aZwztS+UpImmvp/ f5/Id1pi/ey9765Y4vFJ/WaHg1FvNnq9HQxf3GFZIAaHmZGSXgCz+x1zbNL6z5krTLmt 96mDpNteRETj/H9qsCADvk7jSjTfOe57v/Cqg80g7R9y18xwm55G4/j9O23j1MU3ti7k mqigFHOE2hrHW8ZuGGKUSYxipeodsz3PPAkHR2YNgcw8eKVEt5gkvbwyP3iRjDuA9Yn0 0UdRJsVHwNOM/UudFI85B8Ddzgr/L/J9SISz88pxQOOTfAD9F98JOOCxb28VMuf4dcvT cmow== X-Gm-Message-State: ALoCoQmYIliNjgrQeYVJBBv6K/HuLjTHZuw+zk8DUPN95YibV429G0+tCg8SKHHjpS6gienu1MBi X-Received: by 10.66.65.109 with SMTP id w13mr1281861pas.21.1404298281455; Wed, 02 Jul 2014 03:51:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.28.4 with SMTP id 4ls1799435qgy.98.gmail; Wed, 02 Jul 2014 03:51:21 -0700 (PDT) X-Received: by 10.52.241.76 with SMTP id wg12mr40927894vdc.5.1404298281334; Wed, 02 Jul 2014 03:51:21 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id sc8si11013229veb.26.2014.07.02.03.51.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Jul 2014 03:51:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id ij19so10138182vcb.23 for ; Wed, 02 Jul 2014 03:51:21 -0700 (PDT) X-Received: by 10.221.4.66 with SMTP id ob2mr48960346vcb.28.1404298281235; Wed, 02 Jul 2014 03:51:21 -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 tc5csp283805vcb; Wed, 2 Jul 2014 03:51:20 -0700 (PDT) X-Received: by 10.66.102.4 with SMTP id fk4mr3123250pab.59.1404298280455; Wed, 02 Jul 2014 03:51:20 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id yf6si29962950pbc.37.2014.07.02.03.51.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Jul 2014 03:51:20 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X2I6j-0000En-Kd; Wed, 02 Jul 2014 10:49:45 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X2I6Q-0008Pw-PS for linux-arm-kernel@lists.infradead.org; Wed, 02 Jul 2014 10:49:27 +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 <0N82009ZQZD9YW90@mailout2.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 02 Jul 2014 11:48:45 +0100 (BST) X-AuditID: cbfec7f5-b7f626d000004b39-31-53b3e39df900 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 40.F9.19257.D93E3B35; Wed, 02 Jul 2014 11:49:01 +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 <0N82004J1ZDILZA0@eusync3.samsung.com>; Wed, 02 Jul 2014 11:49:01 +0100 (BST) 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 Subject: [PATCH 2/4] drivers: of: initialize and assign reserved memory to newly created devices Date: Wed, 02 Jul 2014 12:48:50 +0200 Message-id: <1404298132-6050-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1404298132-6050-1-git-send-email-m.szyprowski@samsung.com> References: <1404298132-6050-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAyXRW0iTYRjA8d5v32EuV1/L4stAchJBeEyJlwz1yl6hC8mLSKGculRyaltK RqDY1Fzq1C5mYeqcK10eciYeK13zgOEp5wHMzE3Iw2yVyyLnym13v4fnD8/Fw2bxmnBPdmr6 HaE4XZDGJzn4B/vIrN8zU0dMYKXhIKxuayahabMGh3uVwxT8nl/AgpbnJQDW6icIKDcrCThg 6waw6dEDEppLH+Kwp/UbgOP5Zgp2FVdR0GpYwaDWNEdAZWEDDmd6q0nYol+i4Kv1QQyq56cx WDciJaBN4QXH5rdJ2KxXUbBc0YLDgjd6Cu51aXG4MViIw7aqTRwqa5cpqOm1Abj+YxSPOIWa a5oB2v1bCdDm43KAZspKMdTzdIlCJWYpgbSaYhLJtgwY+jTXT6LRql0cfdF14KijIRct2k0s ZBjNJ1CrbQND8r3AaI9YzsUkYVpqtlAcEBbPSdmZLKIyhw7dNaktRB5QuMuAG5uhQxir0Ui6 fJyZ+ty2bw6bR6sB89M0yXINZRjz3lrhrEg6iJFtyZz2oJWA2a7BHRGLLmUza31/cMfiKJ3A bA1ZnBFOn2aWpxad5tKXmL72ccJ1zov5t96IOexGI+ZFvxE4zNtv9GYLqxxw68ABDTgmzErM lCQki875SwQiSVZ6sn9ihkgLXO/91Q3Uwxd0gGYDvjt3LUAbwyME2ZIckQ4wbBbfgytf6Ijh cZMEOfeE4owb4qw0oUQHMLabZx64KX7N8e4U7kRLl3WV77ZCp1YHri5wN3/PmgpPSqhMz9X7 3u3n5aGxRZai9I+RLROmJ41RFUZfo8qutMcNRxfW5wSOvcRO5O5Odcapbu/5vKVaj5RMa1Lo sH7riCjKJzK8U3W9wRKuzfM9I71yKyI7WOEXfPna12xe/Ep9aMhhPi5JEQSdZYklgv/dhpBm vAIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140702_034927_030342_12521274 X-CRM114-Status: GOOD ( 10.57 ) X-Spam-Score: -5.0 (-----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-5.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [210.118.77.12 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [210.118.77.12 listed in wl.mailspike.net] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Mark Rutland , Jon Medhurst , Benjamin Herrenschmidt , Tomasz Figa , Will Deacon , Tomasz Figa , Paul Mackerras , Marek Szyprowski , Arnd Bergmann , Josh Cartwright , Catalin Marinas , Grant Likely , Laura Abbott , Ian Campbell , Pawel Moll , Stephen Warren , Sascha Hauer , Michal Nazarewicz , Marc , Nishanth Peethambaran , Rob Herring , Andrew Morton , "Aneesh Kumar K.V." , Kumar Gala , Olof Johansson , Joonsoo Kim X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.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.178 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 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 500436f9be7f..a9055d3da5c2 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[] = { @@ -233,12 +234,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; } @@ -300,6 +304,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) @@ -326,6 +332,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);