Received: by 10.223.164.202 with SMTP id h10csp2317871wrb; Fri, 24 Nov 2017 09:03:24 -0800 (PST) X-Google-Smtp-Source: AGs4zMbGet6tCulRuymRaxq6FLTIhNAxDZ89O7o9mi4bPEplpU6Mf4w9NySZ7+RJHgIvx/kDww7n X-Received: by 10.98.130.4 with SMTP id w4mr27359058pfd.238.1511543003978; Fri, 24 Nov 2017 09:03:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511543003; cv=none; d=google.com; s=arc-20160816; b=rsTDIzMO963bhw71Suw8xc0ic30+uMCwPaB6Z6lOqFc9deDlKHxZGvXU76acDuYaj1 LxTNADXrTYzyEinN7Se4MdH0b2+s+WRNV0Dx7tkNugQTf/sKf054q2wE3LxGr+AyyOOk fswtyXVC8vkCBuCKL0zHG+ZwjgGwUefD5gz7sZ0xdmqM6ZR1DqE7iwPBFDNUCNy+DEW1 c+R1FPjgPdriUt1WkpF9YkbUuJRZhMbnrlBL9JzUpMZ4cAmoAmKE3Pn3dEdwbH6HRMNr 5qv9cj8p56dH4RqiODS5vrRzcjp/KWA2Joo1HffG1yrBJZ4lTnroerpYl/S88n35OdeQ K7+A== 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=AO0Y/XAoEWAnA7X9Vuz92LqF5vY25Kg5tassIxZJ4L0=; b=icq3OmtfW0mCsEBLZb0V6E670S+DFqcZDzJWQvvUCPHDZ2cOSYGQmvEX3+sSdlTP90 KADW7va4D5Syfflby7IKwiWFbhse9xH3Pl+9T1Rg2xjJzbZ2tEub8HMGZHx4gzsQMgvj B2QUeugiblFApg5y1hAyOBzSH/c4oKlAIWTiHZj0Ibuo+0ionygl0SuYUHDlcQ1mQMD2 nis/B24JEIgpLsrpiUCbE0bUn1vMgM2z0CUmvQTJHVdjeHOLiANarf3n5Y5dSxezw9GP 3nuwDNEjcgO5QAi/WqS/Oe2p55kYFmFqKtt0e5dqMhsvWbSmI0QmMui6mlMB+qcyYH67 9iWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Er0nJ86b; 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 d62si20427790pfl.79.2017.11.24.09.03.12; Fri, 24 Nov 2017 09:03:23 -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=Er0nJ86b; 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 S1753565AbdKXRB7 (ORCPT + 77 others); Fri, 24 Nov 2017 12:01:59 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:45190 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750731AbdKXRB6 (ORCPT ); Fri, 24 Nov 2017 12:01:58 -0500 Received: by mail-pl0-f66.google.com with SMTP id f6so4722514pln.12; Fri, 24 Nov 2017 09:01:58 -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=AO0Y/XAoEWAnA7X9Vuz92LqF5vY25Kg5tassIxZJ4L0=; b=Er0nJ86baJ8uVBo2qaqkkjJfa01JLwa4w0UvQckC0I3dEqi+aruOgRHZDV8IyU3jJO FU9E6XZlzYtFijrwTUhSYWZyl7d8SMge9CFKR6aHTL9dke4HZFUhdocCTuoQxkGQLSSQ gcbvftEPgwyEaB2ECtODD8JuuAQtYkUdC8SFzN21PVM2E7SG9fjehsf7GlqkFwkNYp5d ey6Det5cq+wBPEHJ1OveVqA80FZBsAeRoJBCb3aZPIkTKb0MRhmvH2yECAxgmgDAGP0v 76TTdc9FNmd8ljwZZChCj4qjACcgFbeRo8uGeRw05MMJVDrGcV3rQeVQYRgR8aOFaZPz Q/XQ== 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=AO0Y/XAoEWAnA7X9Vuz92LqF5vY25Kg5tassIxZJ4L0=; b=R25MvQJ9aRzHPXG9DQR/SHJtDbSoz++z6tOtfsY9OW0sI8gzRo3mBSwI4duPjITyl+ ktmAQKIjcDioSgzTyONiZRGS0Gbrbp/l+d8pV8NPBAiA0wj7LOx++w4Z5l9hoGkDNpT8 nLRnp9zjubfJZdFra7LiJ8LVvSTPaYDps5spzz0XY30HYroPuwwkTbQnPU9isOulNxHA oANpWk6NnsegF8RFmHZFSyFvJO2zdySRAvCu3tgnORGBvHNfLz4imBEk+MANdkPrT873 +b5NXOp9d0atRr7OAsQxpCH4CJffgFuWmyaRfTaIt3+VW/Ptpvo3PJ2qGqzx2ZdScta9 d4Bg== X-Gm-Message-State: AJaThX623Phz7qk1cBwajm6RHyNms36vYgCg4UWRCNME1xoYcD/g51kL U2XHKhUtelAnPJkc6sg7TIrxvw== X-Received: by 10.84.129.70 with SMTP id 64mr29771327plb.444.1511542918097; Fri, 24 Nov 2017 09:01:58 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id d6sm39057294pfc.29.2017.11.24.09.01.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Nov 2017 09:01:56 -0800 (PST) From: Arvind Yadav To: sre@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH] power: supply: cpcap-battery: Fix platform_get_irq_byname's error checking Date: Fri, 24 Nov 2017 22:31:40 +0530 Message-Id: <638d9bb5ac4c0ef44d3e83cc0f74d6e80cddcf7d.1511542695.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_byname() function returns -1 if an error occurs. zero or positive number on success. platform_get_irq_byname() error checking for zero is not correct. Signed-off-by: Arvind Yadav --- drivers/power/supply/cpcap-battery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c index ee71a2b..98ba078 100644 --- a/drivers/power/supply/cpcap-battery.c +++ b/drivers/power/supply/cpcap-battery.c @@ -586,8 +586,8 @@ static int cpcap_battery_init_irq(struct platform_device *pdev, int irq, error; irq = platform_get_irq_byname(pdev, name); - if (!irq) - return -ENODEV; + if (irq < 0) + return irq; error = devm_request_threaded_irq(ddata->dev, irq, NULL, cpcap_battery_irq_thread, -- 2.7.4 From 1585403248092803093@xxx Wed Nov 29 12:25:58 +0000 2017 X-GM-THRID: 1585403248092803093 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread