From patchwork Thu Nov 30 15:43:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10085133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4D36860311 for ; Thu, 30 Nov 2017 15:45:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 350E52A14E for ; Thu, 30 Nov 2017 15:45:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29DED2A1A6; Thu, 30 Nov 2017 15:45:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C00D82A14E for ; Thu, 30 Nov 2017 15:45:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752501AbdK3Pn5 (ORCPT ); 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-Google-Smtp-Source: AGs4zMbAPpfD//En2jjFQSZ6yf4WooO+GR+hQDW5+xU2QLtpwSyxoWQxN6Oq3+2y/Q0LbjEza7cLLw== 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-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);