Received: by 10.223.164.202 with SMTP id h10csp4699860wrb; Wed, 29 Nov 2017 10:22:34 -0800 (PST) X-Google-Smtp-Source: AGs4zMYX5w+LgOCcaP8TfgwxGQ0Cx14/DyQfpgDrQh3C0hj/J/R8B8A325AtzzX9f22IWgG8dEqj X-Received: by 10.84.171.195 with SMTP id l61mr3785565plb.129.1511979754582; Wed, 29 Nov 2017 10:22:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511979754; cv=none; d=google.com; s=arc-20160816; b=bTLqheWdSgaAMTFCljSgqp+9UWDwIxcVbGTU9SqE4l6Ywv5mKzi22Uz7fRcACOQKqd 6aVXUKbt3phrK3qTb6Z7tCAMOkZ2UiCeNxRmWio8sp2BtoCSVqQzbwCfAVisar+naUie mVVxYzbp1D9osMrZ8DAMgqJCOn9wfV4JhvLmNmLTD6Q56RQDqrVzHFzTaaP7GuxVMw0G MxJ+SJPf/6sq7Pp9e/jaxN3aLT8EsuieYfzW0j3h3tLK2qqutZhkRB3vUmyjYkkSfdUi Dk2sEJP4j6bvGsISzwsEak0FuWwSO4nauQSz7QiJ5ZYhbq3jyXuupVXbPECYXxElL4U7 7Jqw== 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=Lk6uZkFuatrIp2wlIGtrMYMBcjW63jZ8nLcFh9jkFuM=; b=e6OLs7w9c+QbOsrDmspf7UCcLSQc3R4e+/L4bVVlNnPwSFXKxsuEWDTRt/IeuzhTh2 gERj+nxrwuxguh+ABbmWE0NosA4dWen9IwJAZkdhOPSqTyVq7KZ7wx76YOChrt2jxUOW A+PdkqblkQIlDhJvCPJWRk8g2hZ+SYaTD09ERUoViiqgYUNzvptFfdwJgSm2WRCYnDqF SGvbGwhL9yP3THSBMi8MZ8qzxzeybegI5SsnzT0kKkiR4gcvdd+yXnSugpPKN2CMm/4X N1FHgogon55QMuX96agI9o2pnnANkrKZ1RL3Ri6DHxmoO3temZ1/2aJtO3HaJbLb5zY+ B7xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Lgk7oHn0; 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 v124si1618097pgb.127.2017.11.29.10.22.24; Wed, 29 Nov 2017 10:22:34 -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=Lgk7oHn0; 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 S1755578AbdK2QRq (ORCPT + 69 others); Wed, 29 Nov 2017 11:17:46 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:33107 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752165AbdK2QRo (ORCPT ); Wed, 29 Nov 2017 11:17:44 -0500 Received: by mail-pl0-f66.google.com with SMTP id q7so2391217plk.0 for ; Wed, 29 Nov 2017 08:17: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=Lk6uZkFuatrIp2wlIGtrMYMBcjW63jZ8nLcFh9jkFuM=; b=Lgk7oHn0Tw9bjkEIp4PZW5rp3zHF7hI/i1cDmz/rSba58K4wExhhqPNHEOhrwns6HH IGegPvf/EkIAarTIYMkUY6IJFf+HAo08gzIU/a0irtg0KbAQ64jsVabkzmUU/KmbvLAh bRdIM7WUSF6MnnH0kzPIlSbxAHSwfk6hZeCNMI4zx7W27Lll/gHgA0rUqVWTRAzoMs6p xwj5awFKfUcU5B8yMOtU2ENik6qy7HOLRL7jSl1z07XUsEEPd568/FxrMTlYa0vcmEHB CaFEI/0C8bVUrtAGw6KsH5lapkVikPDOFiUlWloMljPawmrGr3JMo2d2gU98LvncaBdx QGZg== 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=Lk6uZkFuatrIp2wlIGtrMYMBcjW63jZ8nLcFh9jkFuM=; b=JFbV0wRH0uW6vBcP8TdU+o+2FsLWNoOv/11yd6zbjof43QSSHBCsVxqsF/8M+koIR8 VmfR2jsaRwE40CazwjWGb0Gj/ouqu9pPgfBg4xiZc/8faKIP/FGlJ/sRqpEZxdRs5rsK ILJ1cU7jK0cmHRXSsS95W8XLWaQKCD4idChj0eSf97b+/bkMm7Fltlg3rnhvwvWdrIJS cH5bUNv/zu1bT0rJJK4cQ5rdmmHTXFAUJT4AsX2ChUghdXjM7QQon2eu0OyImWl1l1Er k38zyrcQdn17QKN4YDwW1g6Xb3wqky1ITQFfWW3E0AtQuMKJCweLl5QnaRdZYrI2n2LN RNcg== X-Gm-Message-State: AJaThX5I5XWKL5I+RcEJFNPU1YGr3A9Ar/VDEhrZkrIMj2V0S3uK1CmA 7c6xI7P5+K4P/+M7DGuZWug= X-Received: by 10.159.255.74 with SMTP id u10mr3372924pls.116.1511972264178; Wed, 29 Nov 2017 08:17:44 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id q74sm3867400pfd.134.2017.11.29.08.17.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 08:17:42 -0800 (PST) From: Arvind Yadav To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 1/5 v5] ASoC: ep93xx-ac97: Fix platform_get_irq's error checking Date: Wed, 29 Nov 2017 21:47:10 +0530 Message-Id: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.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 : irq was unsigned. so changed it to signed. changes in v3 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. changes in v4 : Return -ENODEV insted of irq. changes in v5 : Add separate error for irq == 0 and irq < 0. sound/soc/cirrus/ep93xx-ac97.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c index bbf7a92..cd5a939 100644 --- a/sound/soc/cirrus/ep93xx-ac97.c +++ b/sound/soc/cirrus/ep93xx-ac97.c @@ -365,7 +365,7 @@ static int ep93xx_ac97_probe(struct platform_device *pdev) { struct ep93xx_ac97_info *info; struct resource *res; - unsigned int irq; + int irq; int ret; info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); @@ -378,8 +378,8 @@ static int ep93xx_ac97_probe(struct platform_device *pdev) return PTR_ERR(info->regs); irq = platform_get_irq(pdev, 0); - if (!irq) - return -ENODEV; + if (irq <= 0) + return irq < 0 ? irq : -ENODEV; ret = devm_request_irq(&pdev->dev, irq, ep93xx_ac97_interrupt, IRQF_TRIGGER_HIGH, pdev->name, info); -- 2.7.4 From 1585214962186085948@xxx Mon Nov 27 10:33:15 +0000 2017 X-GM-THRID: 1584622392394428056 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread