From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolin Chen Subject: Re: [PATCH] ASoC: imx-ssi: add check on platform_get_irq return value Date: Fri, 30 Jun 2017 21:51:41 -0700 Message-ID: <20170701045140.GA9664@Asurada> References: <20170630221735.GA17951@embeddedgus> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by alsa0.perex.cz (Postfix) with ESMTP id B5A4B266847 for ; Sat, 1 Jul 2017 06:51:50 +0200 (CEST) Received: by mail-pf0-f194.google.com with SMTP id z6so19191722pfk.3 for ; Fri, 30 Jun 2017 21:51:50 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20170630221735.GA17951@embeddedgus> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: "Gustavo A. R. Silva" Cc: alsa-devel@alsa-project.org, Timur Tabi , Xiubo Li , linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Mark Brown , Fabio Estevam , linuxppc-dev@lists.ozlabs.org List-Id: alsa-devel@alsa-project.org On Fri, Jun 30, 2017 at 05:17:35PM -0500, Gustavo A. R. Silva wrote: > Check return value from call to platform_get_irq(), > so in case of failure print error message and propagate > the return value. > > Signed-off-by: Gustavo A. R. Silva Acked-by: Nicolin Chen Thanks > --- > sound/soc/fsl/imx-ssi.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c > index b95132e..0679061 100644 > --- a/sound/soc/fsl/imx-ssi.c > +++ b/sound/soc/fsl/imx-ssi.c > @@ -527,6 +527,10 @@ static int imx_ssi_probe(struct platform_device *pdev) > } > > ssi->irq = platform_get_irq(pdev, 0); > + if (ssi->irq < 0) { > + dev_err(&pdev->dev, "Failed to get IRQ: %d\n", ssi->irq); > + return ssi->irq; > + } > > ssi->clk = devm_clk_get(&pdev->dev, NULL); > if (IS_ERR(ssi->clk)) { > -- > 2.5.0 >