From patchwork Tue Mar 18 10:41:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 3852991 Return-Path: X-Original-To: patchwork-linux-media@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 445EF9F369 for ; Wed, 19 Mar 2014 17:41:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 78AF92017B for ; Wed, 19 Mar 2014 17:41:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 94BB3203B7 for ; Wed, 19 Mar 2014 17:41:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754812AbaCRKmD (ORCPT ); Tue, 18 Mar 2014 06:42:03 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:24000 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754327AbaCRKmA (ORCPT ); Tue, 18 Mar 2014 06:42:00 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2M00KY6ODYJE50@mailout4.samsung.com>; Tue, 18 Mar 2014 19:41:58 +0900 (KST) X-AuditID: cbfee61a-b7fb26d00000724f-0b-532822f6a7a2 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id FC.E2.29263.6F228235; Tue, 18 Mar 2014 19:41:58 +0900 (KST) Received: from amdc1032.localnet ([106.116.147.136]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2M00KXSODXMT90@mmp2.samsung.com>; Tue, 18 Mar 2014 19:41:58 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Mauro Carvalho Chehab Cc: Archit Taneja , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] v4l: ti-vpe: fix devm_ioremap_resource() return value checking Date: Tue, 18 Mar 2014 11:41:42 +0100 Message-id: <2203316.gzhRfbGDkb@amdc1032> User-Agent: KMail/4.8.4 (Linux/3.2.0-54-generic-pae; KDE/4.8.5; i686; ; ) MIME-version: 1.0 Content-transfer-encoding: 7Bit Content-type: text/plain; charset=us-ascii X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKLMWRmVeSWpSXmKPExsVy+t9jQd1vShrBBu27jSxu7/vNaLHk5y4m i8u75rBZ9GzYympxcZ28A6vHlN8bWT36tqxi9Dh+YzuTx+dNcgEsUVw2Kak5mWWpRfp2CVwZ G++9YS34wlPxvnMtYwPjf64uRk4OCQETicdL5zFB2GISF+6tZ+ti5OIQEpjOKHHh6gpGCKeF SeLy62nMIFVsAlYSE9tXMYLYIgIGEo8XnWQHKWIWaGWUWNa0EGyUsIC/xJ7911hAbBYBVYkf z++A2bwCmhI7Pq8FGyQq4CmxY/tKNoi4oMSPyffAapgF5CX27Z/KCmFrSazfeZxpAiPfLCRl s5CUzUJStoCReRWjaGpBckFxUnquoV5xYm5xaV66XnJ+7iZGcGA+k9rBuLLB4hCjAAejEg/v Czb1YCHWxLLiytxDjBIczEoivCdENIKFeFMSK6tSi/Lji0pzUosPMUpzsCiJ8x5otQ4UEkhP LEnNTk0tSC2CyTJxcEo1MIYZHBeKcfppPC9yaskq7zPm8y50JV54eEXUTvBvdJDSv4IV1Yfq nzZoPDkQl/yh01LU4u/nvfzXomdY8/j/EkvXlchaev71QrulVjdqrhzskrHQ2/bgfI/1Xv3L ak8WzRK+pOn22kNMo0zBY8tevuPKeYXx6Sc3MX5xf97Kd33FzePy5/aEflJiKc5INNRiLipO BAD3y7TxSAIAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 devm_ioremap_resource() returns a pointer to the remapped memory or an ERR_PTR() encoded error code on failure. Fix the checks inside csc_create() and sc_create() accordingly. Cc: Archit Taneja Cc: Hans Verkuil Signed-off-by: Bartlomiej Zolnierkiewicz Tested-by: Archit Taneja --- Compile tested only. drivers/media/platform/ti-vpe/csc.c | 4 ++-- drivers/media/platform/ti-vpe/sc.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: b/drivers/media/platform/ti-vpe/csc.c =================================================================== --- a/drivers/media/platform/ti-vpe/csc.c 2014-03-14 16:45:25.848724010 +0100 +++ b/drivers/media/platform/ti-vpe/csc.c 2014-03-18 11:01:36.595182833 +0100 @@ -187,9 +187,9 @@ struct csc_data *csc_create(struct platf } csc->base = devm_ioremap_resource(&pdev->dev, csc->res); - if (!csc->base) { + if (IS_ERR(csc->base)) { dev_err(&pdev->dev, "failed to ioremap\n"); - return ERR_PTR(-ENOMEM); + return csc->base; } return csc; Index: b/drivers/media/platform/ti-vpe/sc.c =================================================================== --- a/drivers/media/platform/ti-vpe/sc.c 2014-03-14 16:45:25.848724010 +0100 +++ b/drivers/media/platform/ti-vpe/sc.c 2014-03-18 11:02:09.555182273 +0100 @@ -302,9 +302,9 @@ struct sc_data *sc_create(struct platfor } sc->base = devm_ioremap_resource(&pdev->dev, sc->res); - if (!sc->base) { + if (IS_ERR(sc->base)) { dev_err(&pdev->dev, "failed to ioremap\n"); - return ERR_PTR(-ENOMEM); + return sc->base; } return sc;