From patchwork Fri Feb 21 12:25:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 3696281 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 01F0A9F1EE for ; Fri, 21 Feb 2014 13:01:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CE442015A for ; Fri, 21 Feb 2014 13:01:10 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D86B920149 for ; Fri, 21 Feb 2014 13:01:08 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WGpEQ-0007Fp-0v; Fri, 21 Feb 2014 12:29:31 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WGpDY-0000rP-K3; Fri, 21 Feb 2014 12:28:36 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WGpBl-0000Yx-GN for linux-arm-kernel@lists.infradead.org; Fri, 21 Feb 2014 12:26:48 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N1C00FHRIJS6H90@mailout4.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 21 Feb 2014 12:26:16 +0000 (GMT) X-AuditID: cbfec7f4-b7f796d000005a13-a2-530745e6ba5d Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id E3.31.23059.6E547035; Fri, 21 Feb 2014 12:26:14 +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 <0N1C001ZAIJD5M60@eusync3.samsung.com>; Fri, 21 Feb 2014 12:26:14 +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 Subject: [PATCH v5 06/11] drivers: of: initialize and assign reserved memory to newly created devices Date: Fri, 21 Feb 2014 13:25:22 +0100 Message-id: <1392985527-6260-7-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1392985527-6260-1-git-send-email-m.szyprowski@samsung.com> References: <1392985527-6260-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAy2RW0iTYRzGfb99J4eTz6XxaSYxqosgdSH5UpbeWK9XRbvKiJxuqeGmbSrq jTqcuOXmIVORZS4PwXBOlqBbCrqGSpll85SHxCRLnaYpRLZJLrv7/Z//77l6aA6/Bg+jM+W5 UoVcnCUgufjbg5Gp86uJlChaUxoOvbXDFNxWqTnwR0clgM+c4wSschsJOOjpA9Ctq8ChrWsL wHcqNwV7NY0U3JtcxqB1ZZqAxvI2HLrsBhKanYsU7F4bwmD7zAQGW0bKCOhpiIBvZnZJ2Ols pWB1gxmH6gEnBb29VhyuD5Xj0NK4gUOT3QPg2s4onhCOOps7AfqzXwvQxuNqgFx6HYZsTYsU qnSXEchq0pBoYbqfRC/bitH8wQoHTY6qCNTlWcdQlTcaPbXrAdL3mADatUbcDErmxkmkWZn5 UkXU1RRuRkfdOJHzPbBgZ7YELwHdAVrgT7NMDNvz8QtxxMfZD58tpBZwaT7TDtgXc+3/j0cY O6+zUT6LZISsdlNL+jiYMQJ2txn3SRxmiWQrJiox3+MYk87urx38K+DMGdaw9OQwp2kec51V a5APWeYUa6iN8xn+DGLHBr9Rvph/aHRVPKgGvBbgZwIh0ry0HGVqukwYqRTLlHny9Mi0bJkV HM241wdahy85AEMDQQAvhyVFfEKcryyUOQBLcwTBvKEoSsTnScSFRVJF9j1FXpZU6QAY7R9W AvxUr62nYxYmzfKQAfu1y0xU6BUyzvK1zNvaNDWSoA4qEn3SuZLrzMyN0k1jmolzoviOSzN1 N/6hpHQ7aS7RidWnFL666Lgd378qef9LeFaWO8i16R2/Lam2+qRAr2nr53Ls86YQQdVJ+2zN rbHY6FB1wazogoHbvtBSfF/mEODKDLHwHEehFP8FvCsfn6QCAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140221_072645_692589_765D75D1 X-CRM114-Status: GOOD ( 12.17 ) X-Spam-Score: -6.9 (------) Cc: Mark Rutland , 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 , Kumar Gala , Olof Johansson X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }