Received: by 10.223.164.202 with SMTP id h10csp3980590wrb; Mon, 20 Nov 2017 08:02:49 -0800 (PST) X-Google-Smtp-Source: AGs4zMa33qDQGgfyevKsPtL3eqdWni6k4l6cOdKJhBNe12tNUnP1IVqVjQ8/IlRSBZ0M4K9q8lU2 X-Received: by 10.101.85.3 with SMTP id f3mr13846748pgr.45.1511193769250; Mon, 20 Nov 2017 08:02:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511193769; cv=none; d=google.com; s=arc-20160816; b=tqGYUM9rVzySGdQdPCC3DjSS5Kn7GJCBFWB22tDa8myRLSvkZitT2t/F48dZ8lce/j dGajBRMSzerOi5G5zQcOq051Z4Fphl2ON+6LMX0fQxdHh6C0d6MCw/TD/YZvFchbZsgT uND56YhavgwbCzcdR1IIQ0QeQxjf5ZIeSloNKjdQVSaBWuQ+vaAXf8fMPKtYwvdCuS4c ahWfg5ENBWk+zBQwlSF1sRXsebrgFJhheOVjN+JL/UsKBhGDG8AUCWq44gIYUXViZVtM juDM/U20eX0+tI37poEf2FsArOmJZ44XhwEfckn78jCvjUQNbCNQxEeftV+GqqETjmsr Lw2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:arc-authentication-results; bh=HPROAuDula3WarmtxC6g0/Rtntj7KXyh8ixJj8yvg4k=; b=mjkk0/Qd/xDRuGdrNe6UuCnWUfm8d+SH424vFJE+SZ3Wav/04MbiD+ttUdTf7NtPxY hBp9hHe98RzHSd/QAEeV7quY6z/IsGb/K3MiadvvhrK50uAlTA4xLeG3Gq+QAHEf9hnj 6oLli2/X+cbiI8WKpVvkCBk1mdLu0QDiR5s+kNwMPB7uDZkdlhu0+tJB+YKIg1ySrx7f rmkDOahVR83/ZZK0RVgwbTlRFi1zkdPBSH/RitBSzKhNiHSStgOH6qGjeD9P5sHbO9DG EzzuQlNBPW2j4Hc/JspPJdPiF/nmxv3AMc/Oh2QOH4j0sD0Q05p2RitBWzKfV7CMh1// G9gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GAhaGfwE; 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 k185si8478082pge.131.2017.11.20.08.02.37; Mon, 20 Nov 2017 08:02:49 -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=GAhaGfwE; 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 S1751497AbdKTQBs (ORCPT + 66 others); Mon, 20 Nov 2017 11:01:48 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34697 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751350AbdKTQBq (ORCPT ); Mon, 20 Nov 2017 11:01:46 -0500 Received: by mail-pf0-f196.google.com with SMTP id x7so7602496pfa.1 for ; Mon, 20 Nov 2017 08:01:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=HPROAuDula3WarmtxC6g0/Rtntj7KXyh8ixJj8yvg4k=; b=GAhaGfwEQZ+njCGwAR6MTs61KnuS/MgTF4MKmek47dgzirWQnk9hJzxPwY9Kp/AwZ6 sLzLBqIHPanLzBGZPRWmkeLpTtbDFPpxv1pQILvipq9IfFntiE15ZLJo+G4SZlkUSVWu BCvGsLwogtVlAEwLXODgOpTl976+96HFOsX/eJmbD7cdaWNaiMobb6BFd1MhuJHsxYyk 7dji8osrkOCylKKEPu6GL6wfoqdRYBmrUzGw2aZPPDav+420ej9FkmbNOOBhKGhpq7J1 JdZa58QsqdbaVlWROazAi2LRUgRPjK1qtE3RmWul32Vo6qj6TXtlFILPLFDO75EI72ME gRWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=HPROAuDula3WarmtxC6g0/Rtntj7KXyh8ixJj8yvg4k=; b=PQiIhEtxIRYqP4vbl+cjMVtDcKmqQc8u2S0oQpudOr5fjUej2mvsRqRHHRL7humxt+ bcu0JXSaNyKlEEK5AvoK2sXKZP0Yp3WYa19TfAzYr32yz0/U82o7KhWkDmbVKv/906Jd Gl+zTyE+2RW8MYJyFrk6IufAtM9f+8UQtwQMmZp6nXyQ8uQ05xn/lgjfrOspPV+PpIhh 5jskw2eMsnq4vKWi25jitwI23t3kydbb9HRvZQ7v0+46SmGEW+X/rl2uHs1PKV5mzvbI CsAckQA7GzlDJkXJM2lOPdbMYsuA0o6xSSjX793oX3oEoatkwZ7aI8wwqbTgF2VUsxSr pWTA== X-Gm-Message-State: AJaThX5Z+/Vsfbq5djvCDSXeocLeInX2yNv0hqSJwSruNXtjTpF7w8EX AkUzS4koSC0A4kZVIOYRxpOEow== X-Received: by 10.101.101.211 with SMTP id y19mr450385pgv.138.1511193706235; Mon, 20 Nov 2017 08:01:46 -0800 (PST) Received: from [192.168.0.100] ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id t4sm18172232pfd.110.2017.11.20.08.01.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 08:01:45 -0800 (PST) Subject: Re: [alsa-devel] [PATCH 1/5 v4] ASoC: ep93xx-ac97: Fix platform_get_irq's error checking To: Alexandre Belloni References: <082d4479211d425219f4ab275ecc12e1011eca2f.1511062844.git.arvind.yadav.cs@gmail.com> <20171120133717.kscrjsb3y7gnvd2t@piout.net> Cc: 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, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org From: arvindY Message-ID: <5A12FC64.3020205@gmail.com> Date: Mon, 20 Nov 2017 21:31:40 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20171120133717.kscrjsb3y7gnvd2t@piout.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Monday 20 November 2017 07:07 PM, Alexandre Belloni wrote: > On 19/11/2017 at 09:45:00 +0530, Arvind Yadav wrote: >> 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. >> > To ensure this doesn't get applied: platform_get_irq can return > -EPROBE_DEFER and this must be handled properly. > > (Or maybe this has never caused anything and never failed at all and > nobody cares). Yes, you are right. We should retry to get an irq for device. But ASoC driver is not retrying. if platfore_get_irq() fail here, Driver is throwing an error. and this patch is only to fix error checking which is not correct in Driver. ~arvind > >> 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 >> >> _______________________________________________ >> Alsa-devel mailing list >> Alsa-devel@alsa-project.org >> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel From 1584592453860825680@xxx Mon Nov 20 13:38:45 +0000 2017 X-GM-THRID: 1584466951025449580 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread