diff mbox series

ASoC: codec: Omit superfluous error message in jz4760_codec_probe()

Message ID 20210302121148.28328-1-tangbin@cmss.chinamobile.com (mailing list archive)
State Superseded
Headers show
Series ASoC: codec: Omit superfluous error message in jz4760_codec_probe() | expand

Commit Message

Tang Bin March 2, 2021, 12:11 p.m. UTC
The function devm_platform_ioremap_resource has already contained error
message, so remove the redundant dev_err here.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
 sound/soc/codecs/jz4760.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Paul Cercueil March 2, 2021, 12:23 p.m. UTC | #1
Hi Tang,

Le mar. 2 mars 2021 à 20:11, Tang Bin <tangbin@cmss.chinamobile.com> a 
écrit :
> The function devm_platform_ioremap_resource has already contained 
> error
> message, so remove the redundant dev_err here.
> 
> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
> ---
>  sound/soc/codecs/jz4760.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/jz4760.c b/sound/soc/codecs/jz4760.c
> index e8f28ccc145a..c2d8a107f159 100644
> --- a/sound/soc/codecs/jz4760.c
> +++ b/sound/soc/codecs/jz4760.c
> @@ -843,7 +843,6 @@ static int jz4760_codec_probe(struct 
> platform_device *pdev)
>  	codec->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(codec->base)) {
>  		ret = PTR_ERR(codec->base);
> -		dev_err(dev, "Failed to ioremap mmio memory: %d\n", ret);
>  		return ret;
>  	}

Indeed, you are right.

I guess you do this instead:

if (IS_ERR(codec->base))
    return PTR_ERR(codec->base);

Cheers,
-Paul
Tang Bin March 2, 2021, 12:55 p.m. UTC | #2
Hi Paul:

On 2021/3/2 20:23, Paul Cercueil wrote:
> Hi Tang,
>
> Le mar. 2 mars 2021 à 20:11, Tang Bin <tangbin@cmss.chinamobile.com> a 
> écrit :
>> The function devm_platform_ioremap_resource has already contained error
>> message, so remove the redundant dev_err here.
>>
>> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
>> ---
>>  sound/soc/codecs/jz4760.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/sound/soc/codecs/jz4760.c b/sound/soc/codecs/jz4760.c
>> index e8f28ccc145a..c2d8a107f159 100644
>> --- a/sound/soc/codecs/jz4760.c
>> +++ b/sound/soc/codecs/jz4760.c
>> @@ -843,7 +843,6 @@ static int jz4760_codec_probe(struct 
>> platform_device *pdev)
>>      codec->base = devm_platform_ioremap_resource(pdev, 0);
>>      if (IS_ERR(codec->base)) {
>>          ret = PTR_ERR(codec->base);
>> -        dev_err(dev, "Failed to ioremap mmio memory: %d\n", ret);
>>          return ret;
>>      }
>
> Indeed, you are right.
>
> I guess you do this instead:
>
> if (IS_ERR(codec->base))
>    return PTR_ERR(codec->base);

Yes, I would have written it in your ways, but considered the variable 
"ret", I gave up, and just deleted dev_err().


Thanks

Tang Bin
Mark Brown March 2, 2021, 1:20 p.m. UTC | #3
On Tue, Mar 02, 2021 at 08:55:25PM +0800, tangbin wrote:

> Yes, I would have written it in your ways, but considered the variable
> "ret", I gave up, and just deleted dev_err().

If it's not used any more it can just be removed.
diff mbox series

Patch

diff --git a/sound/soc/codecs/jz4760.c b/sound/soc/codecs/jz4760.c
index e8f28ccc145a..c2d8a107f159 100644
--- a/sound/soc/codecs/jz4760.c
+++ b/sound/soc/codecs/jz4760.c
@@ -843,7 +843,6 @@  static int jz4760_codec_probe(struct platform_device *pdev)
 	codec->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(codec->base)) {
 		ret = PTR_ERR(codec->base);
-		dev_err(dev, "Failed to ioremap mmio memory: %d\n", ret);
 		return ret;
 	}