Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751892AbdGAEvv (ORCPT ); Sat, 1 Jul 2017 00:51:51 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35245 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751828AbdGAEvt (ORCPT ); Sat, 1 Jul 2017 00:51:49 -0400 Date: Fri, 30 Jun 2017 21:51:41 -0700 From: Nicolin Chen To: "Gustavo A. R. Silva" Cc: Timur Tabi , Xiubo Li , Fabio Estevam , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ASoC: imx-ssi: add check on platform_get_irq return value Message-ID: <20170701045140.GA9664@Asurada> References: <20170630221735.GA17951@embeddedgus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170630221735.GA17951@embeddedgus> User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 907 Lines: 33 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 >