[1/2] i2c-bfin-twi: Delete an error message for a failed memory allocation in i2c_bfin_twi_probe()

Message ID cfd1ee7e-6f4d-7d05-b857-a509887a6bc4@users.sourceforge.net
State Not Applicable
Headers show
Series
  • I2C-Blackfin TWI: Adjustments for i2c_bfin_twi_probe()
Related show

Commit Message

SF Markus Elfring Feb. 2, 2018, 6:12 p.m.
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 2 Feb 2018 18:55:04 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/i2c/busses/i2c-bfin-twi.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Patch

diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c
index ff3343186a82..ed596fd56b8b 100644
--- a/drivers/i2c/busses/i2c-bfin-twi.c
+++ b/drivers/i2c/busses/i2c-bfin-twi.c
@@ -621,10 +621,8 @@  static int i2c_bfin_twi_probe(struct platform_device *pdev)
 
 	iface = devm_kzalloc(&pdev->dev, sizeof(struct bfin_twi_iface),
 			GFP_KERNEL);
-	if (!iface) {
-		dev_err(&pdev->dev, "Cannot allocate memory\n");
+	if (!iface)
 		return -ENOMEM;
-	}
 
 	spin_lock_init(&(iface->lock));