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: 25108 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 515AF20143 for ; Fri, 21 Feb 2014 12:26:58 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id i7sf3352918oag.0 for ; Fri, 21 Feb 2014 04:26:57 -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=KBaAEm5GAjsnG6yFfEwAYDbUSopLDMpGcko6GxWpn6D9R06quyCXVIC5azQWT0aaIR 0fH8n4cKl50QnZPWB1SdjxJwoCpQnc8wdYK/QlGoBjj9bKyDJwYJmT7uJ4BVFiiOGOvY m6dFDHLy06g1ELdXseMIOK74HDFaxgxTypWr/QpnG0FYVwopTuJ9txZWL4LB6ozmCvBK svXxYC6WE18Z74bMmmVI2veQH1/BPeLBPwhpylmifAMEtdwM0ui9h2Q8DqrMwkfDFBCv anj26IXakJpWr3VQClklCop38wy/CSjLtIXBySjWDBySExZJjLpQKZFTx0+XTe0wwRK5 Cxvg== X-Gm-Message-State: ALoCoQns4TKS+YbW+NcPffGU3395hIxyj735NrHCEpKKXwwEE0Imo4MC01ABR0ONsGUvEkAhReWA X-Received: by 10.182.108.136 with SMTP id hk8mr1811481obb.11.1392985617852; Fri, 21 Feb 2014 04:26:57 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.71 with SMTP id d65ls937228qgf.60.gmail; Fri, 21 Feb 2014 04:26:57 -0800 (PST) X-Received: by 10.220.110.210 with SMTP id o18mr4600338vcp.49.1392985617739; Fri, 21 Feb 2014 04:26:57 -0800 (PST) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id b2si2915372vcy.85.2014.02.21.04.26.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Feb 2014 04:26:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.180 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.180; Received: by mail-vc0-f180.google.com with SMTP id ks9so3175975vcb.39 for ; Fri, 21 Feb 2014 04:26:57 -0800 (PST) X-Received: by 10.221.26.10 with SMTP id rk10mr4661193vcb.0.1392985617567; Fri, 21 Feb 2014 04:26:57 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp30060vcz; Fri, 21 Feb 2014 04:26:57 -0800 (PST) X-Received: by 10.15.26.199 with SMTP id n47mr8241140eeu.30.1392985615936; Fri, 21 Feb 2014 04:26:55 -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 c43si15945605eeo.17.2014.02.21.04.26.54 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Feb 2014 04:26:55 -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 1WGpAd-0004HB-E4; Fri, 21 Feb 2014 12:25:35 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WGpA4-0004D8-IY for linaro-mm-sig@lists.linaro.org; Fri, 21 Feb 2014 12:25:00 +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 linaro-mm-sig@lists.linaro.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 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= 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 v5 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.180 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; }