Received: by 10.223.164.202 with SMTP id h10csp5770wrb; Thu, 30 Nov 2017 06:14:16 -0800 (PST) X-Google-Smtp-Source: AGs4zMYZtLJhl3dcOrvjxwGkN8zJBFH51qeJqSwG/n21avVuUp2qIk60TuLnuJcue0gMokkE2Dh9 X-Received: by 10.84.240.74 with SMTP id h10mr2757100plt.109.1512051256447; Thu, 30 Nov 2017 06:14:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512051256; cv=none; d=google.com; s=arc-20160816; b=xrGHKQS120a0muDSihLl3d2XD66Ujl81Nc6JRATAh+ORnN/8EKUpiiCIss4KJ43eAj 8fEn1bMt0IsPQfxJDaNNqODlj17+2joTaS4bR0Mjq9ySkdQbnlpLIqzdwwPQoHmYrXh5 JJUUEVHBiU1CpoM49C0b82SL2U8i4V97V2pmuaasY8Wv2GKxp7R4odm76LWOC/b8tlCw cwBgSDr/CO9BXQcNpkc6X9B8sjPuq+P/I9pUQQoMkPwTIuqqAIRYfGzgTrlvLR1JGUr7 qRaB+pBMvHtSIUmUCzvz4spMR4h/SsnESVL7oVQ1E8UCRLO9ku3eC/8kf0nxOtNNXrwH SsFg== 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=S0Ovo3DI3eK3+GTFF9zczxth/B+zwq3Gqn30oJNwVDw=; b=B5VJ62mjHrac46hldt1QJRPAiV7YSW3EQrv8dQAHpudQ74YeP0IEhw4Hmw/zrsXkdG rR2NW7u4QvGQ3YJ6wINXRIjsREXz89c0I90pP1FX/60WJzq61B3YwHPRcu4j/hAOVazT Ayi3rLPo/c2FA9enX7fpMDtPoIex55hVG/WshJM1/uZ3CXVyAfb4Yyco6ZXmriUO/9BQ RNWiahz/vmpS7h0OdoMWu0XtkrMs2DZ4ej2OcpgeGM2ZGeuQiCmlI9OegwROPn5UtITH kA/NjhFi6HhZxltewIpGKjxHAgr5jodq5weLrUFHl6YQimCvh1jYXOz46H4VTdc5Cuf3 coAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZXvkAVfl; 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 d62si3325461pfl.79.2017.11.30.06.14.02; Thu, 30 Nov 2017 06:14:16 -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=ZXvkAVfl; 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 S1752609AbdK3OMq (ORCPT + 99 others); Thu, 30 Nov 2017 09:12:46 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:39042 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751443AbdK3OMo (ORCPT ); Thu, 30 Nov 2017 09:12:44 -0500 Received: by mail-pg0-f67.google.com with SMTP id w7so3038791pgv.6; Thu, 30 Nov 2017 06:12:44 -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=S0Ovo3DI3eK3+GTFF9zczxth/B+zwq3Gqn30oJNwVDw=; b=ZXvkAVflu6Q7Dndg8dWvAHYauHlJG7Al5X4S+gno2Br2ozifgaLsaDOQmtu1F6i9tm 5JaHMRNGBUXdplO8pxUuPC3v0GFipWdmYj+V4msSUgGAX2etR6ua9cjK7SCJB+zy9zSI ABf9/FLVQFeNSHV6iMKt2Tj73C8FzL2Wecq7GipYyYfN2s4z0djruk3O5yzurzk4cVKR eDQYgR7TRjikNbsZWz/196uwjws66bpKxe08nmky+qHB19UM8+sTF5avyFNWkl4uADLd JUQ3dFWZ42q9D6XdKVe9MKtuNjp1ChwaqP/N4WN4E/jyRcxc8P96QAxBcxxHFUMwC17M HbUA== 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=S0Ovo3DI3eK3+GTFF9zczxth/B+zwq3Gqn30oJNwVDw=; b=HMc9m24qerNkdff+wOx/FBZ3fv45lDt4l5gVFj4tzSC3EcIvmpYlcMXqB3AC5GLA+t lHIaRABiAMwgOdCdJNZJWtixoXJujMdV2ssHA/eDyl1cn9Djr10L6qI8JYttXIJLQO5u ghligfePqSshlCHtuTmB/Jhv/zJlZAbCZKKA09Hg2AMNCMNAkakK/YHcqv9+3ctjm/3A WwFLNkdg4xrTgJBXRWqY7WMuX87qKjepN70mL4t7zoNCKEQD5fboO5psuN62QuXozJ4E WwBAytv1c3J3gKTXFshbwQ/8i0lspWPpfiSjXtA+nBXEmplIE27oXWDZMPl4a8/9ozXg xPzg== X-Gm-Message-State: AJaThX6wRe4D3iBW4GgWhYVWu57taeEZzOhaxE3e/+0VApS7qUkTTk9R dQZwo29d/997MwfSvs72zeXnSg== X-Received: by 10.98.213.71 with SMTP id d68mr6578371pfg.171.1512051164157; Thu, 30 Nov 2017 06:12:44 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id o63sm8579924pfi.137.2017.11.30.06.12.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Nov 2017 06:12:42 -0800 (PST) From: Arvind Yadav To: linus.walleij@linaro.org Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH] gpio: ftgpio010: Fix platform_get_irq's error checking Date: Thu, 30 Nov 2017 19:42:32 +0530 Message-Id: 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 --- drivers/gpio/gpio-ftgpio010.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-ftgpio010.c b/drivers/gpio/gpio-ftgpio010.c index 7b3394f..feff86a 100644 --- a/drivers/gpio/gpio-ftgpio010.c +++ b/drivers/gpio/gpio-ftgpio010.c @@ -176,8 +176,8 @@ static int ftgpio_gpio_probe(struct platform_device *pdev) return PTR_ERR(g->base); irq = platform_get_irq(pdev, 0); - if (!irq) - return -EINVAL; + if (irq < 0) + return irq; ret = bgpio_init(&g->gc, dev, 4, g->base + GPIO_DATA_IN, -- 2.7.4 From 1587226707062984182@xxx Tue Dec 19 15:29:04 +0000 2017 X-GM-THRID: 1585848737230345964 X-Gmail-Labels: Inbox,Category Forums