Skip to contentSkip to conversation

i2c: qup: Remove dev_err() log after platform_get_irq*() failure

PATCH In review Saiyam Doshi 2 participants 2 messages Sep 17, 2019 – Sep 18, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 2/3 i2c: qup: Remove dev_err() log after platform_get_irq*() failure

The debug message after platform_get_irq() failure is redundant because platform_get_irq() already prints an error. Thus remove it.

Generated by: scripts/coccinelle/api/platform_get_irq.cocci

---
Changes in v2:
Updated changelog and removed unnecessary braces after if condition.

 drivers/i2c/busses/i2c-qup.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/i2c/busses/i2c-qup.c +1 -3
index 5519c19bfd9c..ed09a59066b2 100644
@@ -1766,10 +1766,8 @@ static int qup_i2c_probe(struct platform_device *pdev)
 		return PTR_ERR(qup->base);
 
 	qup->irq = platform_get_irq(pdev, 0);
-	if (qup->irq < 0) {
-		dev_err(qup->dev, "No IRQ defined\n");
+	if (qup->irq < 0)
 		return qup->irq;
-	}
 
 	if (has_acpi_companion(qup->dev)) {
 		ret = device_property_read_u32(qup->dev,

--
2.20.1

#1 lore raw
Quoted 18 lines · Saiyam Doshi

The debug message after platform_get_irq() failure is redundant because platform_get_irq() already prints an error. Thus remove it.

Generated by: scripts/coccinelle/api/platform_get_irq.cocci

---
Changes in v2:
Updated changelog and removed unnecessary braces after if condition.

 drivers/i2c/busses/i2c-qup.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/i2c/busses/i2c-qup.c +0 -0
index 5519c19bfd9c..ed09a59066b2 100644

drivers/i2c/busses/i2c-qup.c static int qup_i2c_probe(struct platform_device *pdev) · line 1772

Quoted 8 lines
drivers/i2c/busses/i2c-qup.c +1 -3
@@ -1766,10 +1766,8 @@ static int qup_i2c_probe(struct platform_device *pdev)
 		return PTR_ERR(qup->base);
 
 	qup->irq = platform_get_irq(pdev, 0);
-	if (qup->irq < 0) {
-		dev_err(qup->dev, "No IRQ defined\n");
+	if (qup->irq < 0)
 		return qup->irq;
-	}

As far as I understand, platform_get_irq() == 0 is also an error condition.

I think the typical way to handle this peculiarity is:
(Maybe the IRQ maintainers will correct me)

	qup->irq = platform_get_irq(pdev, 0);
	if (qup->irq <= 0)
		return qup->irq ? : -ENXIO;

Regards.