Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752099Ab3G2X7Q (ORCPT ); Mon, 29 Jul 2013 19:59:16 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:47408 "EHLO relmlor3.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751011Ab3G2X7P (ORCPT ); Mon, 29 Jul 2013 19:59:15 -0400 Date: Tue, 30 Jul 2013 08:59:13 +0900 X-IronPort-AV: E=Sophos;i="4.89,773,1367938800"; d="scan'208";a="135434770" Message-id: From: Kuninori Morimoto To: Wei Yongjun Cc: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.de, yongjun_wei@trendmicro.com.cn, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] ASoC: rcar: fix return value check in rsnd_gen1_probe() In-reply-to: References: User-Agent: Wanderlust/2.15.7 Emacs/22.3 Mule/5.0 MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2119 Lines: 60 Hi Wei Thank you for your patch > From: Wei Yongjun > > In case of error, the function devm_ioremap_resource() returns ERR_PTR() > and never returns NULL. The NULL test in the return value check should be > replaced with IS_ERR(), and also remove the dev_err call to avoid redundants > error message. > > Signed-off-by: Wei Yongjun > --- Acked-by: Kuninori Morimoto > sound/soc/sh/rcar/gen.c | 17 ++++------------- > 1 file changed, 4 insertions(+), 13 deletions(-) > > diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c > index 5e4ae0d..61232cd 100644 > --- a/sound/soc/sh/rcar/gen.c > +++ b/sound/soc/sh/rcar/gen.c > @@ -150,25 +150,16 @@ static int rsnd_gen1_probe(struct platform_device *pdev, > sru_res = platform_get_resource(pdev, IORESOURCE_MEM, RSND_GEN1_SRU); > adg_res = platform_get_resource(pdev, IORESOURCE_MEM, RSND_GEN1_ADG); > ssi_res = platform_get_resource(pdev, IORESOURCE_MEM, RSND_GEN1_SSI); > - if (!sru_res || > - !adg_res || > - !ssi_res) { > - dev_err(dev, "Not enough SRU/SSI/ADG platform resources.\n"); > - return -ENODEV; > - } > - > - gen->ops = &rsnd_gen1_ops; > > gen->base[RSND_GEN1_SRU] = devm_ioremap_resource(dev, sru_res); > gen->base[RSND_GEN1_ADG] = devm_ioremap_resource(dev, adg_res); > gen->base[RSND_GEN1_SSI] = devm_ioremap_resource(dev, ssi_res); > - if (!gen->base[RSND_GEN1_SRU] || > - !gen->base[RSND_GEN1_ADG] || > - !gen->base[RSND_GEN1_SSI]) { > - dev_err(dev, "SRU/SSI/ADG ioremap failed\n"); > + if (IS_ERR(gen->base[RSND_GEN1_SRU]) || > + IS_ERR(gen->base[RSND_GEN1_ADG]) || > + IS_ERR(gen->base[RSND_GEN1_SSI])) > return -ENODEV; > - } > > + gen->ops = &rsnd_gen1_ops; > rsnd_gen1_reg_map_init(gen); > > dev_dbg(dev, "Gen1 device probed\n"); > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/