Skip to contentSkip to conversation

i2c: altera: Remove superfluous error message in altr_i2c_probe()

PATCH In review Aishwarya Ramakrishnan 2 participants 2 messages May 3, 2020 – May 4, 2020 I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: altera: Remove superfluous error message in altr_i2c_probe()

The function platform_get_irq can log an error by itself. This omit a redundant message for exception handling in the calling function.

Suggested by Coccinelle.

---
 drivers/i2c/busses/i2c-altera.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/i2c/busses/i2c-altera.c +1 -3
index f5c00f903df3..af6985f0ae63 100644
@@ -395,10 +395,8 @@ static int altr_i2c_probe(struct platform_device *pdev)
 		return PTR_ERR(idev->base);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "missing interrupt resource\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	idev->i2c_clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(idev->i2c_clk)) {
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Aishwarya Ramakrishnan

The function platform_get_irq can log an error by itself. This omit a redundant message for exception handling in the calling function.

Suggested by Coccinelle.

---
  drivers/i2c/busses/i2c-altera.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/i2c/busses/i2c-altera.c +0 -0
index f5c00f903df3..af6985f0ae63 100644
@@ -395,10 +395,8 @@ static int altr_i2c_probe(struct platform_device *pdev)
  		return PTR_ERR(idev->base);

drivers/i2c/busses/i2c-altera.c static int altr_i2c_probe(struct platform_device *pdev) · line 402

Quoted 10 lines
drivers/i2c/busses/i2c-altera.c +1 -3
 
  	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "missing interrupt resource\n");
+	if (irq < 0)
  		return irq;
-	}
 
  	idev->i2c_clk = devm_clk_get(&pdev->dev, NULL);
  	if (IS_ERR(idev->i2c_clk)) {