diff mbox series

[-next] regulator: drivers: Remove unnecessary print function dev_err()

Message ID 20220825070438.128093-1-yang.lee@linux.alibaba.com
State New
Headers show
Series [-next] regulator: drivers: Remove unnecessary print function dev_err() | expand

Commit Message

Yang Li Aug. 25, 2022, 7:04 a.m. UTC
The print function dev_err() is redundant because
platform_get_irq_byname() already prints an error.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1986
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/regulator/tps65219-regulator.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Christophe JAILLET Aug. 26, 2022, 6:10 a.m. UTC | #1
Le 25/08/2022 à 09:04, Yang Li a écrit :
> The print function dev_err() is redundant because
> platform_get_irq_byname() already prints an error.
> 
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1986
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>   drivers/regulator/tps65219-regulator.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/regulator/tps65219-regulator.c b/drivers/regulator/tps65219-regulator.c
> index 7ba2594e437c..ab16e6665625 100644
> --- a/drivers/regulator/tps65219-regulator.c
> +++ b/drivers/regulator/tps65219-regulator.c
> @@ -363,11 +363,9 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
>   		irq_type = &tps65219_regulator_irq_types[i];
>   
>   		irq = platform_get_irq_byname(pdev, irq_type->irq_name);
> -		if (irq < 0) {
> -			dev_err(tps->dev, "Failed to get IRQ %s: %d\n",
> -				irq_type->irq_name, irq);
> +		if (irq < 0)
>   			return -EINVAL;
> -		}
> +
>   		irq_data[i].dev = tps->dev;
>   		irq_data[i].type = irq_type;
>   

Hi,

just in case it has an importance, this is not exactly the same.
Previously, the error was related to 'pdev', now it is related to 'tps' 
and we have:
	'struct tps65219 *tps = dev_get_drvdata(pdev->dev.parent);'

I don't think it really matters, but just in case...

CJ
diff mbox series

Patch

diff --git a/drivers/regulator/tps65219-regulator.c b/drivers/regulator/tps65219-regulator.c
index 7ba2594e437c..ab16e6665625 100644
--- a/drivers/regulator/tps65219-regulator.c
+++ b/drivers/regulator/tps65219-regulator.c
@@ -363,11 +363,9 @@  static int tps65219_regulator_probe(struct platform_device *pdev)
 		irq_type = &tps65219_regulator_irq_types[i];
 
 		irq = platform_get_irq_byname(pdev, irq_type->irq_name);
-		if (irq < 0) {
-			dev_err(tps->dev, "Failed to get IRQ %s: %d\n",
-				irq_type->irq_name, irq);
+		if (irq < 0)
 			return -EINVAL;
-		}
+
 		irq_data[i].dev = tps->dev;
 		irq_data[i].type = irq_type;