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: 2218311 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id AE4693FCF2 for ; Tue, 5 Mar 2013 09:24:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755159Ab3CEJYs (ORCPT ); Tue, 5 Mar 2013 04:24:48 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:12098 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754978Ab3CEJYr (ORCPT ); Tue, 5 Mar 2013 04:24:47 -0500 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-samsung-soc@vger.kernel.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 Cc: sbkim73@samsung.com, broonie@opensource.wolfsonmicro.com, kgene.kim@samsung.com, arnd@arndb.de, vinod.koul@intel.com, grant.likely@secretlab.ca, jon-hunter@ti.com, boojin.kim@samsung.com, robherring2@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+eTZp0oywH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edtJZbijERDLeai4kQAN0uA0woDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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__);