[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190730181557.90391-36-swboyd@chromium.org>
Date: Tue, 30 Jul 2019 11:15:35 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: linux-kernel@...r.kernel.org
Cc: Sebastian Reichel <sebastian.reichel@...labora.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Baolin Wang <baolin.wang@...aro.org>,
Allison Randal <allison@...utok.net>,
Claudiu Beznea <claudiu.beznea@...rochip.com>,
Lubomir Rintel <lkundrak@...sk>
Subject: [PATCH v6 35/57] power: supply: Remove dev_err() usage after platform_get_irq()
We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.
// <smpl>
@@
expression ret;
struct platform_device *E;
@@
ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);
if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>
While we're here, remove braces on if statements that only have one
statement (manually).
Cc: Sebastian Reichel <sebastian.reichel@...labora.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Baolin Wang <baolin.wang@...aro.org>
Cc: Allison Randal <allison@...utok.net>
Cc: Claudiu Beznea <claudiu.beznea@...rochip.com>
Cc: Lubomir Rintel <lkundrak@...sk>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Stephen Boyd <swboyd@...omium.org>
---
Please apply directly to subsystem trees
drivers/power/supply/88pm860x_battery.c | 8 ++------
drivers/power/supply/axp288_charger.c | 4 +---
drivers/power/supply/bd70528-charger.c | 5 +----
drivers/power/supply/da9150-charger.c | 8 ++------
drivers/power/supply/da9150-fg.c | 1 -
drivers/power/supply/goldfish_battery.c | 4 +---
drivers/power/supply/jz4740-battery.c | 4 +---
drivers/power/supply/qcom_smbb.c | 5 +----
drivers/power/supply/sc27xx_fuel_gauge.c | 4 +---
9 files changed, 10 insertions(+), 33 deletions(-)
diff --git a/drivers/power/supply/88pm860x_battery.c b/drivers/power/supply/88pm860x_battery.c
index 5ca047b3f58f..1308f3a185f3 100644
--- a/drivers/power/supply/88pm860x_battery.c
+++ b/drivers/power/supply/88pm860x_battery.c
@@ -919,16 +919,12 @@ static int pm860x_battery_probe(struct platform_device *pdev)
return -ENOMEM;
info->irq_cc = platform_get_irq(pdev, 0);
- if (info->irq_cc <= 0) {
- dev_err(&pdev->dev, "No IRQ resource!\n");
+ if (info->irq_cc <= 0)
return -EINVAL;
- }
info->irq_batt = platform_get_irq(pdev, 1);
- if (info->irq_batt <= 0) {
- dev_err(&pdev->dev, "No IRQ resource!\n");
+ if (info->irq_batt <= 0)
return -EINVAL;
- }
info->chip = chip;
info->i2c =
diff --git a/drivers/power/supply/axp288_charger.c b/drivers/power/supply/axp288_charger.c
index 1bbba6bba673..cb14d41b53e9 100644
--- a/drivers/power/supply/axp288_charger.c
+++ b/drivers/power/supply/axp288_charger.c
@@ -825,10 +825,8 @@ static int axp288_charger_probe(struct platform_device *pdev)
/* Register charger interrupts */
for (i = 0; i < CHRG_INTR_END; i++) {
pirq = platform_get_irq(info->pdev, i);
- if (pirq < 0) {
- dev_err(&pdev->dev, "Failed to get IRQ: %d\n", pirq);
+ if (pirq < 0)
return pirq;
- }
info->irq[i] = regmap_irq_get_virq(info->regmap_irqc, pirq);
if (info->irq[i] < 0) {
dev_warn(&info->pdev->dev,
diff --git a/drivers/power/supply/bd70528-charger.c b/drivers/power/supply/bd70528-charger.c
index 1bb32b7226d7..0d456fd28b21 100644
--- a/drivers/power/supply/bd70528-charger.c
+++ b/drivers/power/supply/bd70528-charger.c
@@ -168,11 +168,8 @@ static int bd70528_get_irqs(struct platform_device *pdev,
for (i = 0; i < ARRAY_SIZE(bd70528_chg_irqs); i++) {
irq = platform_get_irq_byname(pdev, bd70528_chg_irqs[i].n);
- if (irq < 0) {
- dev_err(&pdev->dev, "Bad IRQ information for %s (%d)\n",
- bd70528_chg_irqs[i].n, irq);
+ if (irq < 0)
return irq;
- }
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
bd70528_chg_irqs[i].h,
IRQF_ONESHOT,
diff --git a/drivers/power/supply/da9150-charger.c b/drivers/power/supply/da9150-charger.c
index f9314cc0cd75..a9c1af2706ab 100644
--- a/drivers/power/supply/da9150-charger.c
+++ b/drivers/power/supply/da9150-charger.c
@@ -466,10 +466,8 @@ static int da9150_charger_register_irq(struct platform_device *pdev,
int irq, ret;
irq = platform_get_irq_byname(pdev, irq_name);
- if (irq < 0) {
- dev_err(dev, "Failed to get IRQ CHG_STATUS: %d\n", irq);
+ if (irq < 0)
return irq;
- }
ret = request_threaded_irq(irq, NULL, handler, IRQF_ONESHOT, irq_name,
charger);
@@ -487,10 +485,8 @@ static void da9150_charger_unregister_irq(struct platform_device *pdev,
int irq;
irq = platform_get_irq_byname(pdev, irq_name);
- if (irq < 0) {
- dev_err(dev, "Failed to get IRQ CHG_STATUS: %d\n", irq);
+ if (irq < 0)
return;
- }
free_irq(irq, charger);
}
diff --git a/drivers/power/supply/da9150-fg.c b/drivers/power/supply/da9150-fg.c
index 6e367826aae9..026a98741c12 100644
--- a/drivers/power/supply/da9150-fg.c
+++ b/drivers/power/supply/da9150-fg.c
@@ -514,7 +514,6 @@ static int da9150_fg_probe(struct platform_device *pdev)
/* Register IRQ */
irq = platform_get_irq_byname(pdev, "FG");
if (irq < 0) {
- dev_err(dev, "Failed to get IRQ FG: %d\n", irq);
ret = irq;
goto irq_fail;
}
diff --git a/drivers/power/supply/goldfish_battery.c b/drivers/power/supply/goldfish_battery.c
index c2644a9fe80f..427347ce3841 100644
--- a/drivers/power/supply/goldfish_battery.c
+++ b/drivers/power/supply/goldfish_battery.c
@@ -221,10 +221,8 @@ static int goldfish_battery_probe(struct platform_device *pdev)
}
data->irq = platform_get_irq(pdev, 0);
- if (data->irq < 0) {
- dev_err(&pdev->dev, "platform_get_irq failed\n");
+ if (data->irq < 0)
return -ENODEV;
- }
ret = devm_request_irq(&pdev->dev, data->irq,
goldfish_battery_interrupt,
diff --git a/drivers/power/supply/jz4740-battery.c b/drivers/power/supply/jz4740-battery.c
index 6366bd61ea9f..517265ad3d70 100644
--- a/drivers/power/supply/jz4740-battery.c
+++ b/drivers/power/supply/jz4740-battery.c
@@ -258,10 +258,8 @@ static int jz_battery_probe(struct platform_device *pdev)
jz_battery->cell = mfd_get_cell(pdev);
jz_battery->irq = platform_get_irq(pdev, 0);
- if (jz_battery->irq < 0) {
- dev_err(&pdev->dev, "Failed to get platform irq: %d\n", ret);
+ if (jz_battery->irq < 0)
return jz_battery->irq;
- }
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
diff --git a/drivers/power/supply/qcom_smbb.c b/drivers/power/supply/qcom_smbb.c
index c890e1cec720..84cc9fba029d 100644
--- a/drivers/power/supply/qcom_smbb.c
+++ b/drivers/power/supply/qcom_smbb.c
@@ -929,11 +929,8 @@ static int smbb_charger_probe(struct platform_device *pdev)
int irq;
irq = platform_get_irq_byname(pdev, smbb_charger_irqs[i].name);
- if (irq < 0) {
- dev_err(&pdev->dev, "failed to get irq '%s'\n",
- smbb_charger_irqs[i].name);
+ if (irq < 0)
return irq;
- }
smbb_charger_irqs[i].handler(irq, chg);
diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c
index 24895cc3b41e..04b9e8bb981f 100644
--- a/drivers/power/supply/sc27xx_fuel_gauge.c
+++ b/drivers/power/supply/sc27xx_fuel_gauge.c
@@ -1030,10 +1030,8 @@ static int sc27xx_fgu_probe(struct platform_device *pdev)
}
irq = platform_get_irq(pdev, 0);
- if (irq < 0) {
- dev_err(&pdev->dev, "no irq resource specified\n");
+ if (irq < 0)
return irq;
- }
ret = devm_request_threaded_irq(data->dev, irq, NULL,
sc27xx_fgu_interrupt,
--
Sent by a computer through tubes
Powered by blists - more mailing lists