hwmon: Remove dev_err() usage after platform_get_irq()
Quoted 32 lines · Stephen Boyd
We don't need
dev_err()messages whenplatform_get_irq()fails now thatplatform_get_irq()prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch.// <smpl>
@@
expression ret;
structplatform_device*E;
@@ret =
(platform_get_irq(E, ...)
|platform_get_irq_byname(E, ...)
);if ( \( ret < 0 \| ret <= 0 \) )
{
((quoted diff) +0
-4-if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... }|
...
-dev_err(...);
)
...
}
// </smpl>
Quoted 8 lines
While we're here, remove braces on if statements that only have one statement (manually).
Cc Jean Delvare <[email protected]>Cc Guenter Roeck <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
Applied to hwmon-next.
Guenter
Quoted 44 lines
---
Please apply directly to subsystem trees
drivers/hwmon/jz4740-hwmon.c | 5 +---- drivers/hwmon/npcm750-pwm-fan.c | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-)drivers/hwmon/jz4740-hwmon.c +1
-4@@ -93,11 +93,8 @@ static int jz4740_hwmon_probe(struct platform_device *pdev) hwmon->cell =mfd_get_cell (pdev); hwmon->irq =platform_get_irq (pdev,0 ); -if (hwmon->irq <0 ) { -dev_err (&pdev->dev,"Failed to get platform irq: %d\n" , - hwmon->irq); +if (hwmon->irq <0 )return hwmon->irq; - } hwmon->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (hwmon->base))drivers/hwmon/npcm750-pwm-fan.c +1
-3@@ -967,10 +967,8 @@ static int npcm7xx_pwm_fan_probe(struct platform_device *pdev)spin_lock_init (&data->fan_lock[i]); data->fan_irq[i] =platform_get_irq (pdev, i); -if (data->fan_irq[i] <0 ) { -dev_err (dev,"get IRQ fan%d failed\n" , i); +if (data->fan_irq[i] <0 )return data->fan_irq[i]; - }sprintf (name,"NPCM7XX-FAN-MD%d" , i); ret = devm_request_irq(dev, data->fan_irq[i], npcm7xx_fan_isr,Signature · 1 line
Sent by a computer through tubes