Received: by 10.223.164.202 with SMTP id h10csp116247wrb; Thu, 30 Nov 2017 07:45:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMYei1+4msMJScVDyaeMGTucpFYP2YTw3JQwZRAn6Razz6cDh8djZq3fMdygcLAx2RJMB7dh X-Received: by 10.99.174.1 with SMTP id q1mr2758049pgf.434.1512056720413; Thu, 30 Nov 2017 07:45:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512056720; cv=none; d=google.com; s=arc-20160816; b=Vg1gA1edt9fmAbj9y64WdlH8b3gZMxXihKM76VZgCfAZkSK1gm+eF8Y7Lu0L2uIUbE I6LfZUshiRtzjvWzwqtn7SmxBFxX017fBPKYHmyHs7LyvnStFMt4FtIPdvwlv2TZKrqD 5gg/yyq0hawl8egY3DAsaqGEvr8AsxR/rv4M2ZHhwi2VI12wxMjUzUHNhh4tDGsAOmFE TLid514BhDOOsFRMUHzeg8e3C39uzAs/eCqC28ttBfhzy26zXI0Ns0ukHvCTu4YPZ1/z R16BstLlvuQOCdhgkPILDS1nmhRWrRMRYyp7s4KZcNqwVnw5FpN8HADRBMiLz1lPsZ/2 bggw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=nEfH5Bh5dLis5zYJ9zXMlp73VeBckIL/dlHzsQH9uA4=; b=XIMoft3cinMI9oEpw5EeAQI9zkjDApzyKiH41APRgCLQOMnIwnaBJEI7vbyz69Sqb3 KudC4LMgT+1mHkmP6K8wbQPQ92cCu7C6wxCBF9A2ECoNQ6nXNOPwYW1U8NwOOk0gJ47I 9GfsBS089jHlb9NX7TBcVrEpJoVGuaOs2qZIwT55zHLDwzUoRGGNF8+ESyyywVqEZtO3 VUBL5N9OX3UnRChiql9O6fp6I8OivNRDVegAUSNZOO3xhfWfXwTrKpniS+/UsS8ttuS0 oQPrzrjtBwMTjJtg0axXjHV+erjqWjlOL9Xrpufx/iL9pEP0u0VbTGY3n0y4Vc6SVsaH qDsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RGXjb445; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c23si310419plo.627.2017.11.30.07.45.00; Thu, 30 Nov 2017 07:45:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RGXjb445; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752609AbdK3Pn5 (ORCPT + 99 others); Thu, 30 Nov 2017 10:43:57 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:41295 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750885AbdK3Pnz (ORCPT ); Thu, 30 Nov 2017 10:43:55 -0500 Received: by mail-pl0-f68.google.com with SMTP id g2so4461632pli.8; Thu, 30 Nov 2017 07:43:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nEfH5Bh5dLis5zYJ9zXMlp73VeBckIL/dlHzsQH9uA4=; b=RGXjb445dPw7YpkqFMS8Qwu3SDsG/Eo5A37xmSMzmq4YQrJbH4o/r0oKAvdxY5xUa3 OtbeGb0Hiqu4rCOytN7Uw6s+qq5LJL8+9zj/sOwR+RO9bhy0Dnq9t7DmVTo5vnegNDC0 /E4dROeXZQM3m0VRDw6Vn5PB8I7YbPBT/7VBSYNluKhTV2IBFxS3Ud17XSPGlP346p9u TD8XNCUvEYR+BJqDuWAIf9eRAxvtR+RW/rnhSch+6Tnvk29othN/M47pOROxH3n9xaHA 7yaIQmzhcM2cXv5im4yuq6z1nHQGRZt6zzZO9SBKIbp/n/OITVea1KnQ0//GcEV3XYn0 n2iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nEfH5Bh5dLis5zYJ9zXMlp73VeBckIL/dlHzsQH9uA4=; b=ekaFwzcZTQUg6k3GYvb2+59QlhUYEf/fZT6vRZ6c+kww8d3mvUJsu1VCF4AsWjYHa9 PDJ+j7Lt3s4j168WqCUXTZZTOuhpRnAQQd0SoEWYr4FM+7BuxLgA0h8EA1TjAJfEKC5v XvU9Jo3+AZZQVE3ewkjt67q7TvmfffguTHLAF3RrqVBHM4Tm0sRomNsr1Lw75RR9wgpm uCqZ1LywjpStWBNIyD1so1uzQ3ZcoBsIDTeurvdijrCT9SM0sJEt/6Qsqi9/wDWrznNQ 9Din68vfdtXrcJBtz9IkHCEV8cj9hLdG+f4KavarSwt4Oy1VXWiq3b4PHRNtmNST8rG/ YHbQ== X-Gm-Message-State: AJaThX6PEYsznaEV3Dws8tIyQLrXUH9Qu+luO+xweAgnXat4zG9aZgCs +udCvVdyfI9pqUJ9eLyjPmc= X-Received: by 10.84.245.149 with SMTP id j21mr3049046pll.315.1512056634729; Thu, 30 Nov 2017 07:43:54 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id f79sm8687440pfd.45.2017.11.30.07.43.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Nov 2017 07:43:53 -0800 (PST) From: Arvind Yadav To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, samuel@sortiz.org Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, netdev@vger.kernel.org Subject: [PATCH 1/3] iio: trigger: Fix platform_get_irq's error checking Date: Thu, 30 Nov 2017 21:13:34 +0530 Message-Id: <1512056616-21065-2-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512056616-21065-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1512056616-21065-1-git-send-email-arvind.yadav.cs@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The platform_get_irq() function returns negative if an error occurs. zero or positive number on success. platform_get_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav --- drivers/staging/iio/trigger/iio-trig-bfin-timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c index d80dcf8..f389f5c 100644 --- a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c +++ b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c @@ -187,9 +187,9 @@ static int iio_bfin_tmr_trigger_probe(struct platform_device *pdev) return -ENOMEM; st->irq = platform_get_irq(pdev, 0); - if (!st->irq) { + if (st->irq < 0) { dev_err(&pdev->dev, "No IRQs specified"); - return -ENODEV; + return st->irq; } ret = iio_bfin_tmr_get_number(st->irq); -- 2.7.4 From 1585864896763535021@xxx Mon Dec 04 14:43:41 +0000 2017 X-GM-THRID: 1585864896763535021 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread