From patchwork Fri Nov 14 22:09:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 5309801 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 02365C11AC for ; Fri, 14 Nov 2014 22:10:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26CA020149 for ; Fri, 14 Nov 2014 22:10:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3867820145 for ; Fri, 14 Nov 2014 22:10:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422872AbaKNWJz (ORCPT ); Fri, 14 Nov 2014 17:09:55 -0500 Received: from mail-ig0-f175.google.com ([209.85.213.175]:58868 "EHLO mail-ig0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754389AbaKNWJx (ORCPT ); Fri, 14 Nov 2014 17:09:53 -0500 Received: by mail-ig0-f175.google.com with SMTP id h15so497931igd.8 for ; Fri, 14 Nov 2014 14:09:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=/pD61gW3HBJAdW3qONG06tj9aToYF8H/vxJo1bJ69M4=; b=McK3Svfn2qM5zF3Zw6gCKoOR8mL0vKXkAYNnDQrgg7JFwqYXAAP5fiJ+h6lYrUdWxf wNYrZvWBxpkr3V8gJ0X8scmdf/NvBzq1GZ8iFPKRNv8lZ4V5zyG7CsTp/u8+sOD2BWvt oxRW1JRYUxEFdrcM42nsyau8W16LYFo/5Yw23q3fJGqDsPQ5lr6WpaAaqjkhudAcvCcE yty6XjYN0HKzdm6Fk52BK8JfaKMNqEajfX5go3U/ONUk7eqXX0GBt6uxXdaYc0yuTMlz Qnw10S1jQ/htwSVvq2fnicNFyFBWuZbsNqwQAVq4ZUJSANWRP4Ow/bq53HBKjUsNWPWc EyzQ== X-Gm-Message-State: ALoCoQkyJyie+k6AYlB28k89a1G/Cs5p3hXTBNc/CyWXsf1pJ+cuwpIa/ao2W/8ur/nL+wdVTT9Z X-Received: by 10.107.36.136 with SMTP id k130mr13364331iok.4.1416002992928; Fri, 14 Nov 2014 14:09:52 -0800 (PST) Received: from dtor-ws ([2620:0:1000:1301:8c0e:c406:dbcd:b83b]) by mx.google.com with ESMTPSA id kk2sm1955966igb.14.2014.11.14.14.09.52 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 14 Nov 2014 14:09:52 -0800 (PST) Date: Fri, 14 Nov 2014 14:09:50 -0800 From: Dmitry Torokhov To: Mauro Carvalho Chehab Cc: Kyungmin Park , Sylwester Nawrocki , Kukjin Kim , Tomi Valkeinen , Wolfram Sang , Philipp Zabel , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [media] exynos4-is: fix error handling of irq_of_parse_and_map Message-ID: <20141114220950.GA34576@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@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=ham 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 Return value of irq_of_parse_and_map() is unsigned int, with 0 indicating failure, so testing for negative result never works. Signed-off-by: Dmitry Torokhov --- Not tested, found by casual code inspection. drivers/media/platform/exynos4-is/fimc-is.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-is.c b/drivers/media/platform/exynos4-is/fimc-is.c index 94c6b47..0fdca86 100644 --- a/drivers/media/platform/exynos4-is/fimc-is.c +++ b/drivers/media/platform/exynos4-is/fimc-is.c @@ -814,9 +814,9 @@ static int fimc_is_probe(struct platform_device *pdev) return -ENOMEM; is->irq = irq_of_parse_and_map(dev->of_node, 0); - if (is->irq < 0) { + if (!is->irq) { dev_err(dev, "no irq found\n"); - return is->irq; + return -EINVAL; } ret = fimc_is_get_clocks(is);