Received: by 10.223.164.202 with SMTP id h10csp2348467wrb; Sat, 18 Nov 2017 19:54:11 -0800 (PST) X-Google-Smtp-Source: AGs4zMbqo0odmhX5iklQr2ThHfSe5J5UXJ5R1X1xVUhAVglNhBh6ZDhgW6hlNZ73HV3vJ5mO1o0R X-Received: by 10.84.234.202 with SMTP id i10mr3268496plt.159.1511063651269; Sat, 18 Nov 2017 19:54:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511063651; cv=none; d=google.com; s=arc-20160816; b=cfkNnkFdel3rfk3T91I0hqxYAq3PLR6Su/Cop6NNtSRrbU1YWS1ODifUse3yPANPkf lCW8GV2UvKO2fheoBH9sitSrav2sWqMA0M5FwtowxhXBhHdmoqYxLvkp7eFL2I9wllEq W/JvhgULLUErir73yVgRhHLGID5nr5xuTjNjeEwetDI9Ij7nZv/xYWztJQlwOqOEuHun 2YPoO/h0fnOpx+rw7e3Tolg3ZWacJlZMN39N/JvCPjB95NhzQuzFOZ+uZx2IYPveE9rC ZCeXG9b9/DNZZTlUK3vYOYsH5vz2TNtjVq7NaRD4BlbZcqmmMRk7mWz+EreyoXKMA2Dg qQ5Q== 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:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=b7Nptd2dY05ZnNJ6ISl4yfzpAIdkSeIv7W+nzRNT+/w=; b=WYnxJaL+lwSsc8Sq8ygrCUpsESdWOl9v7wzkooevf35ad/cB8UdlAdS+jitvxHb+J2 /V2D8pjhF9xuQYYZHmZLAzPJCRj45qv/OQhf/ixIuj7pjwBuqX0MgVGmruQlcvrAwPMq nc94EiCwhxlJu2f6T+1CTDMa97qsibsV1pTLJWvV7pszoOpI14tCCWjHKGAVZg2tVsih KF5n41fLucHI6g65F1gpEsqY3cMW7B7g+6TqmdUYVPGDr+wKdETMPZjJzgXgIdqpc/KP GAtwwxia95I99BCZCEknfqvMbepKfcnZevvJ5EwOMJIULpyOLC+RqfMZ0KngaubILOWv r22w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WVY3C+1p; 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 f68si5436224pgc.400.2017.11.18.19.53.58; Sat, 18 Nov 2017 19:54:11 -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=WVY3C+1p; 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 S1947113AbdKRIv2 (ORCPT + 93 others); Sat, 18 Nov 2017 03:51:28 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:39793 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1947084AbdKRIvH (ORCPT ); Sat, 18 Nov 2017 03:51:07 -0500 Received: by mail-pg0-f65.google.com with SMTP id 70so3702993pgf.6 for ; Sat, 18 Nov 2017 00:51:07 -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 :in-reply-to:references; bh=b7Nptd2dY05ZnNJ6ISl4yfzpAIdkSeIv7W+nzRNT+/w=; b=WVY3C+1pfS+5DA9zYVK7TEKJ5xP9xIgKFd4BxwaHtv9aaxL//S9sXij09r/tMD/jee KPLJsXJhX03jAT7JKOq0oiwQ+Y8fV1aLWsfSQtaUvLnJvEE1XZKJWac+CkkglcQwgmG4 QfQ/VXGsV3oxkNfNs2t20/ND7d9FUUOtAWXhbZTDencvrOaBQJ4zV04a0X4+zMzzlP3t i8IbVJXpvYFbbWJtFp9jOItIFBF/vbXx+G0mKI5z2aUtV6JHWWvO51raGG0EKE0rQelV CBydSiZr2BCTM7p4H6c3f2DktD+DCJ9bMVZ64EaApQr2U5UoZeo8Y7wuUoWG9ZKYgc9h DGbw== 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:in-reply-to:references; bh=b7Nptd2dY05ZnNJ6ISl4yfzpAIdkSeIv7W+nzRNT+/w=; b=qcagUd+YMjaTWCcpRo05KfdmUQva8UC5hhptDOveG+VUDgdqcA9StHaMM0boaCa6Bv l245MUJ6UlIkZkip9n/5E2KsP/dc+qMxZhxtm1oPrn//wOg1Iev8z4/pBWqLeN9FY58O 0iwsRDAYMAeMYTWATJO1YFGoTOy1J4vDKlQRwpb5iT3H88RUs7MGi9WzzplIo4yvkYUZ aTkKwbRBKklAu1T09sHTbeLxiW8JIAD6d4tAmIImSmjd3/IfrhNkLahsJBCjpBRNrTXO SNtrJeB0b5geDIe+hQKVEBOGi+XQRejUpPLkPctEZFXt3X50f27BwLt3/gd7G6irDd6C IXTw== X-Gm-Message-State: AJaThX4aZLgKz8i/AyK3vFdazW9kFWGp+cyzocJft8ZpNLU1N1kbKjYe 7XLgMYsSIDlmFm3b3RxTirX2QYu3 X-Received: by 10.101.82.193 with SMTP id z1mr7600811pgp.312.1510995067151; Sat, 18 Nov 2017 00:51:07 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id 3sm11847104pfo.17.2017.11.18.00.51.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 00:51:06 -0800 (PST) From: Arvind Yadav To: lee.jones@linaro.org, maxime.ripard@free-electrons.com, wens@csie.org, linux@armlinux.org.uk Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/3 v2] mfd: sun4i-gpadc: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 14:20:49 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: <4f12b680d2f0d7554e6a1812f15037185a5a9a2a.1510994294.git.arvind.yadav.cs@gmail.com> References: <4f12b680d2f0d7554e6a1812f15037185a5a9a2a.1510994294.git.arvind.yadav.cs@gmail.com> In-Reply-To: <4f12b680d2f0d7554e6a1812f15037185a5a9a2a.1510994294.git.arvind.yadav.cs@gmail.com> References: <4f12b680d2f0d7554e6a1812f15037185a5a9a2a.1510994294.git.arvind.yadav.cs@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org platform_get_irq() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- changes in v2 : Add failure case '<= 0' instead of '< 0'. If IRQ0 is not valid. drivers/mfd/sun4i-gpadc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/sun4i-gpadc.c b/drivers/mfd/sun4i-gpadc.c index 9cfc881..1c89235 100644 --- a/drivers/mfd/sun4i-gpadc.c +++ b/drivers/mfd/sun4i-gpadc.c @@ -100,8 +100,8 @@ static int sun4i_gpadc_probe(struct platform_device *pdev) struct resource *mem; const struct of_device_id *of_id; const struct mfd_cell *cells; - unsigned int irq, size; - int ret; + unsigned int size; + int ret, irq; of_id = of_match_node(sun4i_gpadc_of_match, pdev->dev.of_node); if (!of_id) @@ -148,6 +148,9 @@ static int sun4i_gpadc_probe(struct platform_device *pdev) regmap_write(dev->regmap, SUN4I_GPADC_INT_FIFOC, 0); irq = platform_get_irq(pdev, 0); + if (irq <= 0) + return irq; + ret = devm_regmap_add_irq_chip(&pdev->dev, dev->regmap, irq, IRQF_ONESHOT, 0, &sun4i_gpadc_regmap_irq_chip, -- 2.7.4 From 1584462512018945045@xxx Sun Nov 19 03:13:23 +0000 2017 X-GM-THRID: 1584462512018945045 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread