From patchwork Tue Mar 5 09:25:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmavathi Venna X-Patchwork-Id: 2218341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 25896DF24C for ; Tue, 5 Mar 2013 09:28:04 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UCo7E-0003ei-0A; Tue, 05 Mar 2013 09:24:56 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UCo79-0003eM-U8 for linux-arm-kernel@lists.infradead.org; Tue, 05 Mar 2013 09:24:53 +0000 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJ6001OVKT4S6W0@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 05 Mar 2013 18:24:45 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.125]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id AC.64.17763.DD9B5315; Tue, 05 Mar 2013 18:24:45 +0900 (KST) X-AuditID: cbfee690-b7f6b6d000004563-8a-5135b9ddbf3f Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 8E.69.03918.DD9B5315; Tue, 05 Mar 2013 18:24:45 +0900 (KST) Received: from padma-linuxpc.sisodomain.com ([107.108.83.35]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MJ600I6NKSPEB20@mmp2.samsung.com>; Tue, 05 Mar 2013 18:24:45 +0900 (KST) From: Padmavathi Venna To: linux-samsung-soc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, padma.v@samsung.com, padma.kvr@gmail.com Subject: [PATCH] dma: of-dma: return error when 'dma-cells' not found Date: Tue, 05 Mar 2013 14:55:30 +0530 Message-id: <1362475531-32260-1-git-send-email-padma.v@samsung.com> X-Mailer: git-send-email 1.7.4.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFIsWRmVeSWpSXmKPExsWyRsSkVvfuTtNAg/XNChZ/Jx1jt3hz8g+b xb/Zp9gsDsx+yGrx6sxGNotlU7cxW/QuuMpmsenxNVaLGef3MVm0L5vDavH75nc2i+/fvrFZ XFzxhcniZd9+Fgc+j9+/JjF67Jx1l91j8Z6XTB6bl9R7nJ+xkNHj5cTfbB59W1Yxevx8qeNx /MZ2Jo/Pm+QCuKK4bFJSczLLUov07RK4MvYvn8pc8JKjordpGlMDYzt7FyMnh4SAiUTH8wUs ELaYxIV769m6GLk4hASWMko0L93GDFM0Y9E/qMR0RolbSzayQjg9TBLvL3QAZTg42AR0JFrO uoDERQTmAHVvn8EI4jAL3GaU+PrpPhPIKGEBV4nXD5ezgdgsAqoSX5ofg63gFXCWODb7NxvE OgWJY1O/gm2QELjFLvH5+TdmiAYBiW+TD7GAbJMQkJXYdADqPEmJgytusExgFFzAyLCKUTS1 ILmgOCm9yESvODG3uDQvXS85P3cTIzBeTv97NmEH470D1ocYk4HGTWSWEk3OB8ZbXkm8obGJ uamxqZmRpaWlKWnCSuK88pdkAoUE0hNLUrNTUwtSi+KLSnNSiw8xMnFwSjUwysbMfNWbZLK/ 1qnTN++EzhOJ1Gmlc8Jyp/i+eTZp0oywHt8m7WzeHfcV7nRP/3haZ9+zuIJia5WuyGMnhAV2 H5l9KjPJ+dWdPU96VCc84VguVqLy+XPNqctZ7yccDDU7nSE0p1vkzKQtOxn+tLwS3yySWnD9 2NN3Il+VA/9EmsstnFET/85psxJLcUaioRZzUXEiAMKl/H2tAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOIsWRmVeSWpSXmKPExsVy+t9jQd27O00DDbquiFr8nXSM3eLNyT9s Fv9mn2KzODD7IavFqzMb2SyWTd3GbNG74CqbxabH11gtZpzfx2TRvmwOq8Xvm9/ZLL5/+8Zm cXHFFyaLl337WRz4PH7/msTosXPWXXaPxXteMnlsXlLvcX7GQkaPlxN/s3n0bVnF6PHzpY7H 8RvbmTw+b5IL4IpqYLTJSE1MSS1SSM1Lzk/JzEu3VfIOjneONzUzMNQ1tLQwV1LIS8xNtVVy 8QnQdcvMAfpASaEsMacUKBSQWFyspG+HaUJoiJuuBUxjhK5vSBBcj5EBGkhYw5ixf/lU5oKX HBW9TdOYGhjb2bsYOTkkBEwkZiz6xwZhi0lcuLceyObiEBKYzihxa8lGVginh0ni/YUOoAwH B5uAjkTLWReQuIjAHEaJ5u0zGEEcZoHbjBJfP91nAhklLOAq8frhcrCxLAKqEl+aHzOD2LwC zhLHZv+GWqcgcWzqV9YJjNwLGBlWMYqmFiQXFCel5xrqFSfmFpfmpesl5+duYgRH4zOpHYwr GywOMQpwMCrx8DIcNQkUYk0sK67MPcQowcGsJMKrN8s0UIg3JbGyKrUoP76oNCe1+BBjMtD2 icxSosn5wESRVxJvaGxibmpsamliYWJmSZqwkjgv46knAUIC6YklqdmpqQWpRTBbmDg4pRoY GXYvWtJ6dmHkIqUHxyKu+T15V9O2JPn7i6bk5Tv+b+LffNVEbbLhjkq9PNl5IR3S+gmKsveT 9vDP/lkRXrDuhddEKwUhrUl7YgQrvs785dSqeO9SyfwfAtFv5voZlAbMje6PXRnVl/lY7U5o nxzHRPe98wPqKtI8bJfphs1VVvu5/YmkHedtJZbijERDLeai4kQAN0uA0woDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130305_042452_196936_A6BDB980 X-CRM114-Status: UNSURE ( 8.08 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.4 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.24 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 HDRS_LCASE Odd capitalization of message header Cc: kgene.kim@samsung.com, arnd@arndb.de, boojin.kim@samsung.com, sbkim73@samsung.com, broonie@opensource.wolfsonmicro.com, grant.likely@secretlab.ca, vinod.koul@intel.com, jon-hunter@ti.com 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 This patch returns error when 'dma-cells' property not found in the corresponding device node. With out this change there is a crash in the generic dma incompatible platforms. Signed-off-by: Padmavathi Venna --- Based on Vinod Koul next branch. drivers/dma/of-dma.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c index 69d04d2..46aca0d 100644 --- a/drivers/dma/of-dma.c +++ b/drivers/dma/of-dma.c @@ -92,6 +92,7 @@ int of_dma_controller_register(struct device_node *np, void *data) { struct of_dma *ofdma; + const __be32 *ip; int nbcells; if (!np || !of_dma_xlate) { @@ -103,7 +104,12 @@ int of_dma_controller_register(struct device_node *np, if (!ofdma) return -ENOMEM; - nbcells = be32_to_cpup(of_get_property(np, "#dma-cells", NULL)); + ip = of_get_property(np, "#dma-cells", NULL); + if (!ip) + return -ENXIO; + + nbcells = be32_to_cpup(ip); + if (!nbcells) { pr_err("%s: #dma-cells property is missing or invalid\n", __func__);