Received: by 10.223.164.202 with SMTP id h10csp2366775wrb; Sat, 18 Nov 2017 20:23:56 -0800 (PST) X-Google-Smtp-Source: AGs4zMbPWzJ6PyAzGCHc2C5eXtoedXWmSCWAd6+sBpUR2/bc86mAlxtL+xb26GkdtDclln3uyx6N X-Received: by 10.84.253.1 with SMTP id z1mr6034048pll.115.1511065436237; Sat, 18 Nov 2017 20:23:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511065436; cv=none; d=google.com; s=arc-20160816; b=L6gP1Vc6+ZuRUcjTXbEB+6iAIKMoL0uGOIERsKldiYOwMtfeMcwiZpje/UtaUkwSFl dlBkDmeG9DK2WKlm3izsV4z3b0HXudIsmlhvzF63Xq9aFUcpDQ3VyiCtDrtVDBSEcv4r Uq2y2A/DQRHGrW5p+SvzfVqIRXiA8Z+Xz0own3OTkIenxndzXzvCQBabm4cP3QMfEzE1 rRjn1exekjlsee35es9UxrOHeXZHYrDGIGQX4hQTBr6mFjXqEZGs0WrHNNrdLGv+jWBU RPGrU+nJMBENHE9UekpuJEzBzk0a3uJx0uev8qjlXxM00wLX1NEYqzq+69lhfyZm6XlD oTAQ== 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=PzR0YkvWzGulCveSsWb01QYbwx3jF3+syszDfy3VDcM=; b=aGj2CpmEpi1ZCMbnh8SLcUs73eiC/tt4/MXnRizVVRBRvlgvDLiQ31MlVitcQ6kJZB iejVNCorNmIAVAOT0O01RNpLbrdlmGh5j4fZRexRNZVmgtTvmMBDQxiNGDGP8/J0u32X 8Bcp42bt5HbMr8kuLKBP94CYv9//JW4+unETqPin5YoGorw0kqJV3gX0tMfjf2Nx/xYo DHfXZDEq8A3M+5QewWFTt1JPQGrxn2UIIDM9jphvJ41DzlwcdFbbdoQOi6AqrI0WeKKZ kO8t4vU9VREdCvewe1d2jboH0v4qpQK55XeA0eJq47cuVvsU91auq4iyP4AJnc/i1WuA sl6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZQVxym/F; 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 a12si5485781pgd.252.2017.11.18.20.23.45; Sat, 18 Nov 2017 20:23:56 -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=ZQVxym/F; 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 S1751306AbdKSEPY (ORCPT + 75 others); Sat, 18 Nov 2017 23:15:24 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:34056 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751072AbdKSEPX (ORCPT ); Sat, 18 Nov 2017 23:15:23 -0500 Received: by mail-pg0-f68.google.com with SMTP id 4so4854946pge.1 for ; Sat, 18 Nov 2017 20:15:23 -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=PzR0YkvWzGulCveSsWb01QYbwx3jF3+syszDfy3VDcM=; b=ZQVxym/FYJf9nVeYcJiKdRT6J/7CZOhwuLSiiBmJrWGNzQEnW8FnikF6ixZfZthwd3 VsoihPDQ1Y6Su7dlJZ5UOkkdRZGlgBGkLVbun+VJrZHzleNQDYFwHZQswoIt1ya88GRn Kv1me5PPmDj5sw/sIWfYgDN3egM8yjKxMS0/g5J3CkIY30gPmReSY2PA9a7o8JdxHC+B lvG1ecF5bir9+UWnH8zDRCsEONcTUI6j354EWxMO2AVKWFut5TuvQV/KT9voS1SPEWhy 9RIMo9yB2rV2gHcpTAwD0APtWxRfvGx5tsIwPhZ+saAvkFiZrFuyJNN8DlC3ThgBci1d PTbQ== 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=PzR0YkvWzGulCveSsWb01QYbwx3jF3+syszDfy3VDcM=; b=jfmIUOXSQre7VGC4mhKSlfmEbPRw/dcqGyowGoLNVSx3mWZXF81KPfMDmjwYkQwo9V MMczF4CQYOA++n+wSyZoai1UstA23YDTsoHqMVZIfSyhFXv7PGfe9u9lP1at0Yn76QWe azjrXvOz1+x5snrMeEqEyQQFwxaLWk1t5EL/EJpyQLKFvFKUV8syYUKhqHnLS+d6TC4H CihafPypI+kYYna2QTNtiKhVSooOVB+S7CTSJiMDz4jPmqQ+KQhfXpYfen27y3WyvxPj ESWrJnN5tgpuTP3kE34HrhNv0lP/G3LCj8TPbpzy/a8gF0ZH5bqSjyP4reOQ7mca7V4p Kq/Q== X-Gm-Message-State: AJaThX5FUJVuealVjTfGxoQ8VEtX/JGSkQrJ4fPgooRoe9IWpiQy2hnM kDyJu2r/Mt0+Duq26YnR44E= X-Received: by 10.101.92.8 with SMTP id u8mr9542159pgr.93.1511064922801; Sat, 18 Nov 2017 20:15:22 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id l14sm12741475pgn.35.2017.11.18.20.15.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 20:15:21 -0800 (PST) From: Arvind Yadav To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux@armlinux.org.uk Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 1/5 v4] ASoC: ep93xx-ac97: Fix platform_get_irq's error checking Date: Sun, 19 Nov 2017 09:45:00 +0530 Message-Id: <082d4479211d425219f4ab275ecc12e1011eca2f.1511062844.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. sound/soc/cirrus/ep93xx-ac97.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c index bbf7a92..efeecee 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,7 +378,7 @@ static int ep93xx_ac97_probe(struct platform_device *pdev) return PTR_ERR(info->regs); irq = platform_get_irq(pdev, 0); - if (!irq) + if (irq <= 0) return -ENODEV; ret = devm_request_irq(&pdev->dev, irq, ep93xx_ac97_interrupt, -- 2.7.4 From 1585421585598258844@xxx Wed Nov 29 17:17:26 +0000 2017 X-GM-THRID: 1585421585598258844 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread