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: 5309821 Return-Path: X-Original-To: patchwork-linux-arm@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 A22239F440 for ; Fri, 14 Nov 2014 22:12:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D91402015D for ; Fri, 14 Nov 2014 22:12:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A4A120149 for ; Fri, 14 Nov 2014 22:12:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XpP4N-0004nL-83; Fri, 14 Nov 2014 22:10:19 +0000 Received: from mail-ie0-f180.google.com ([209.85.223.180]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XpP4I-0003B2-MZ for linux-arm-kernel@lists.infradead.org; Fri, 14 Nov 2014 22:10:15 +0000 Received: by mail-ie0-f180.google.com with SMTP id rl12so3437742iec.39 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=FjN8wJqjnE5Fdf4ObL9Mr8nS1W8eeNpmdTp3Qx96AlwMpVpH3Qz9KycAi5qc3t0xJt 1VJHwG4wk5VTyAuu6IHyTnmDUe32uewQb3DrBooFK5kGgrI7geAONfEukpn0NnWmrbJh 1NxS/5Y5j9Rnq2wRlLw3STPg2HKV4nVefYgZsE1xy+CBHL+npdRJPQiAv2xVgpOOIuJ6 J8pPrhgtuoeYXypkmj9Ob0sCyQC/of6hVKwdw88YpIqaT1fQlAx17XwLF3ldC1ySiie8 e84v5Fd9SQ8kwzRTQzX1gQX5m7Nnu9ZBHymR0z83t4F2GQ7Yj8glXvk9mcH3ezeqPy0s iWng== X-Gm-Message-State: ALoCoQkpvxk9GVkCIT41DQzwlWDij3Vj0zmGoDn1R/MVh1nTODEG1mNkm0Y+DASP8tUPaR2mIVFj 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 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141114_141014_821132_3EF8665C X-CRM114-Status: GOOD ( 13.17 ) X-Spam-Score: -0.7 (/) Cc: Kukjin Kim , Sylwester Nawrocki , Wolfram Sang , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Kyungmin Park , Tomi Valkeinen , Philipp Zabel , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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);