2022-09-23 09:41:32

by shangxiaojing

[permalink] [raw]
Subject: [PATCH -next] crypto: aspeed - Remove redundant dev_err call

devm_ioremap_resource() prints error message in itself. Remove the
dev_err call to avoid redundant error message.

Signed-off-by: Shang XiaoJing <[email protected]>
---
drivers/crypto/aspeed/aspeed-hace.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/crypto/aspeed/aspeed-hace.c b/drivers/crypto/aspeed/aspeed-hace.c
index 3f880aafb6a2..e05c32c31842 100644
--- a/drivers/crypto/aspeed/aspeed-hace.c
+++ b/drivers/crypto/aspeed/aspeed-hace.c
@@ -123,10 +123,8 @@ static int aspeed_hace_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, hace_dev);

hace_dev->regs = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(hace_dev->regs)) {
- dev_err(&pdev->dev, "Failed to map resources\n");
+ if (IS_ERR(hace_dev->regs))
return PTR_ERR(hace_dev->regs);
- }

/* Get irq number and register it */
hace_dev->irq = platform_get_irq(pdev, 0);
--
2.17.1


2022-09-23 10:25:49

by Neal Liu

[permalink] [raw]
Subject: RE: [PATCH -next] crypto: aspeed - Remove redundant dev_err call

> devm_ioremap_resource() prints error message in itself. Remove the dev_err
> call to avoid redundant error message.
>
> Signed-off-by: Shang XiaoJing <[email protected]>
> ---
> drivers/crypto/aspeed/aspeed-hace.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/crypto/aspeed/aspeed-hace.c
> b/drivers/crypto/aspeed/aspeed-hace.c
> index 3f880aafb6a2..e05c32c31842 100644
> --- a/drivers/crypto/aspeed/aspeed-hace.c
> +++ b/drivers/crypto/aspeed/aspeed-hace.c
> @@ -123,10 +123,8 @@ static int aspeed_hace_probe(struct platform_device
> *pdev)
> platform_set_drvdata(pdev, hace_dev);
>
> hace_dev->regs = devm_ioremap_resource(&pdev->dev, res);
> - if (IS_ERR(hace_dev->regs)) {
> - dev_err(&pdev->dev, "Failed to map resources\n");
> + if (IS_ERR(hace_dev->regs))
> return PTR_ERR(hace_dev->regs);
> - }
>
> /* Get irq number and register it */
> hace_dev->irq = platform_get_irq(pdev, 0);
> --
> 2.17.1

Similar patch just be proposed few days ago.
https://patchwork.kernel.org/project/linux-crypto/patch/[email protected]/

2022-09-23 12:40:20

by shangxiaojing

[permalink] [raw]
Subject: Re: [PATCH -next] crypto: aspeed - Remove redundant dev_err call


On 2022/9/23 18:15, Neal Liu wrote:
>> devm_ioremap_resource() prints error message in itself. Remove the dev_err
>> call to avoid redundant error message.
>>
>> Signed-off-by: Shang XiaoJing <[email protected]>
>> ---
>> drivers/crypto/aspeed/aspeed-hace.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/crypto/aspeed/aspeed-hace.c
>> b/drivers/crypto/aspeed/aspeed-hace.c
>> index 3f880aafb6a2..e05c32c31842 100644
>> --- a/drivers/crypto/aspeed/aspeed-hace.c
>> +++ b/drivers/crypto/aspeed/aspeed-hace.c
>> @@ -123,10 +123,8 @@ static int aspeed_hace_probe(struct platform_device
>> *pdev)
>> platform_set_drvdata(pdev, hace_dev);
>>
>> hace_dev->regs = devm_ioremap_resource(&pdev->dev, res);
>> - if (IS_ERR(hace_dev->regs)) {
>> - dev_err(&pdev->dev, "Failed to map resources\n");
>> + if (IS_ERR(hace_dev->regs))
>> return PTR_ERR(hace_dev->regs);
>> - }
>>
>> /* Get irq number and register it */
>> hace_dev->irq = platform_get_irq(pdev, 0);
>> --
>> 2.17.1
> Similar patch just be proposed few days ago.
> https://patchwork.kernel.org/project/linux-crypto/patch/[email protected]/

sorry, pls ignore mine.


Thanks,

Shang XiaoJing