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: 5309791 Return-Path: X-Original-To: patchwork-linux-media@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 B5483C11AD for ; Fri, 14 Nov 2014 22:10:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E30D220142 for ; Fri, 14 Nov 2014 22:10:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18EE420149 for ; Fri, 14 Nov 2014 22:10:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422876AbaKNWJ4 (ORCPT ); Fri, 14 Nov 2014 17:09:56 -0500 Received: from mail-ig0-f172.google.com ([209.85.213.172]:49627 "EHLO mail-ig0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754365AbaKNWJx (ORCPT ); Fri, 14 Nov 2014 17:09:53 -0500 Received: by mail-ig0-f172.google.com with SMTP id a13so477188igq.17 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=RGX+LB7CNIT/qViyUvN43UECxiUANX4PSmOnDJl8WxEpwrRn252UJgdVchC7SgzNZ7 cL8CBYN22zHuB8guVCIBFGpWOr3MNSJq2GbwnBZxuKOcBAvuYl9f4U11Z63LLzrQ3z37 f55KVk2ssgsaQMrndkTR2ye1jGw2b1qk8THCElOeGq7HI5vutomQ+Zp5FC8f4ujEBWE6 kcVpHezgD2qib736KeD+Gr57aRXvvKqz9EEfxqZi2zBJz93jnMDHLOA/mV0J9l8YjUfk AFFG9iC1iGwER6oM7NwC73rnn0pOERg1Q6eay27sB+z4TcAWcGHNxMNhxZ8RYJygopgq jU0A== X-Gm-Message-State: ALoCoQnapDa8pKCv4kzQPTmAEEtEPx9OvQdIwUHPmkswOnMUMWjVZdUSYqvbzko0nAb0PZWx//jS 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-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 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);