Received: by 10.223.164.202 with SMTP id h10csp2348769wrb; Sat, 18 Nov 2017 19:54:40 -0800 (PST) X-Google-Smtp-Source: AGs4zMboCoJjLk+LaKhjtjMOcAYeHdswxaYeoII5W5w9e1BaWw03yLWIcHckMTU97BhBn+eZSDQZ X-Received: by 10.98.92.129 with SMTP id q123mr7049629pfb.147.1511063680359; Sat, 18 Nov 2017 19:54:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511063680; cv=none; d=google.com; s=arc-20160816; b=RtP9+rEo0keVNmeQf7z2G2vorGOgYwWK7oGo7XlE+YRTKY2++mIfROvBHOL1kGVpeB un+4F16h3zMb1qsih+LECEoBNYDD98+h7TtUR7DmFEuX0mtt1NWpnupA0LaWX7BtmAKj 3SVkVkK17AkCF5gAhrOB5JDOkv8gDEM/EWn+LymSATASo7YTMko5RX18lJI6iCwW+oye yQ10XCTP7OJr1FlK0h41u6ApFmyAiW/ZuL3FrS06un+bthITeljuTVvr5sArvnhlAgKk Y+A9guxT+taod7VE0f4yjt3gldeGyEgLGhuyigFU7207QTrL9CSNskfDdgqfviN9FQF/ 0sEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=W9SbKURaUTnshkC1WVqxHcVRuW0PmmdDAB8A2LQaRjs=; b=rCxWzIB0A9LCWnN/8PMc3UoXlrgypyKiTWDd1PrOiQYhGFgE4Wgpj/hQkgG09Vkv7q sJjK0HMqcuAojU6T9P8lCEBunNgSKKD4wVB+0XPK1mAa7hP0VG0DhCAAqTH+txuBv5y/ 4rRwXE6QwXvw3zceBDljxezsLLZnZQk3lgRJC09aLD+mFJmrZeOFa8s6VrA1F5XDcHij pA81GELwgIygUNwgccglcmhqrynYqbByC4XHUKCHtuakL83rqmEywqLMUCufNG56G/Ld SByeRDyJQWKIumswO0f/JffaAmmoiphppYyA9GzX3XnvTk5DqoAN955cVyG2093AFmQu UAJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WqjH/lc8; 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 o6si927290pls.613.2017.11.18.19.54.27; Sat, 18 Nov 2017 19:54:40 -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=WqjH/lc8; 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 S937704AbdKRJMh (ORCPT + 93 others); Sat, 18 Nov 2017 04:12:37 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:39346 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163059AbdKRJLS (ORCPT ); Sat, 18 Nov 2017 04:11:18 -0500 Received: by mail-pg0-f66.google.com with SMTP id 70so3726227pgf.6 for ; Sat, 18 Nov 2017 01:11:18 -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; bh=W9SbKURaUTnshkC1WVqxHcVRuW0PmmdDAB8A2LQaRjs=; b=WqjH/lc8NddHL7TJVRxZB+ItIV6p0Btkyts83+TQJWOIb0bv1180i67nNrXzOKGSqb JcdG4KrlNInVQL08Jng3R+HCTynRfM7OVXWrO14jviR1AzbEZCWCP9+PoWefr7OKrK6O ne982II/F2Ml4s5yKK7KXtOYCCsbPEgFEmG9MIliGdCe53LupnwaBsAj9e18bAix+ZZf n4D7DKwEtsyn1gx963/vLcVlO+DxjqmD7CPlJN+7G0FVBeSsAekQia8j31I2JEqoQUJH VibH9Boxlqg+LIYKyJkJieUb1JmmVFvKkpJpJ8DeFLkEyjiUjcNJAnB7BEaaaXrOV8W3 mnKg== 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; bh=W9SbKURaUTnshkC1WVqxHcVRuW0PmmdDAB8A2LQaRjs=; b=KJ26UHl/LI0cq9qAvyyagOV2Ydv/y0Cn7DzGUbMGq5wY7q/tuyYxrNBr29qsLnCNij 1FzG/4pft8xdgosOcRoZstX9KQNfV7/+Ce3yPUx4LdQJF2v+JUs3acCHQfan/mrwNXlo TDKfsakoey8TRNZBl1CmdZkd8Wmf8w8GL9/T5ov3MjWhGW6aCarEHrtGTHBRHgWsvMbZ UOOwFtR9dealzHM+EfjqKg5d461ZHFGIqhOFjLC+96Yk3zh8zg6FFwQASwlZ7245cozR aNfsvkoU6ffs+MRQGm4L56WaiLQPjw45zNkB9AILOl7eCt3npbqxfxS+jQTqkG5jOc8Y dIHw== X-Gm-Message-State: AJaThX4xjN3WiI/A4n8R5hiridCyHEORTW92MUtHPuNuLXXUOzF3HuR0 VODozzdzR2aaMK11z9N6d0Q= X-Received: by 10.84.130.67 with SMTP id 61mr7754501plc.368.1510996277820; Sat, 18 Nov 2017 01:11:17 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id h81sm11158803pfh.119.2017.11.18.01.11.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 01:11:17 -0800 (PST) From: Arvind Yadav To: arnd@arndb.de, gregkh@linuxfoundation.org, joel@jms.id.au, nicolas.ferre@microchip.com, alexandre.belloni@free-electrons.com, linux@armlinux.org.uk Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2 v2] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 14:40:12 +0530 Message-Id: <6e238a28aa79c581c90329060805c0b07e2187a7.1510995185.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 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 --- changes in v2 : Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid. drivers/misc/aspeed-lpc-snoop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/aspeed-lpc-snoop.c b/drivers/misc/aspeed-lpc-snoop.c index cb78c98..14c3c90 100644 --- a/drivers/misc/aspeed-lpc-snoop.c +++ b/drivers/misc/aspeed-lpc-snoop.c @@ -115,8 +115,8 @@ static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop, int rc; lpc_snoop->irq = platform_get_irq(pdev, 0); - if (!lpc_snoop->irq) - return -ENODEV; + if (lpc_snoop->irq <= 0) + return lpc_snoop->irq; rc = devm_request_irq(dev, lpc_snoop->irq, aspeed_lpc_snoop_irq, IRQF_SHARED, -- 2.7.4 From 1584458457570814497@xxx Sun Nov 19 02:08:56 +0000 2017 X-GM-THRID: 1584458457570814497 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread