Skip to contentSkip to conversation

bcm590xx: correctly handle return value of i2c_new_dummy()

PATCH New Insu Yun 1 participant 1 message Feb 16, 2016 Multifunction devices (MFD)

lore
Share & tools
lore

Insu Yun

author
#0 lore raw

PATCH 1/1 bcm590xx: correctly handle return value of i2c_new_dummy()

i2c_new_dummy() returns NULL when failed, not an error code.

---
 drivers/mfd/bcm590xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/bcm590xx.c +1 -1
index 320aaef..7aaf622 100644
@@ -67,7 +67,7 @@ static int bcm590xx_i2c_probe(struct i2c_client *i2c_pri,
 	/* Secondary I2C slave address is the base address with A(2) asserted */
 	bcm590xx->i2c_sec = i2c_new_dummy(i2c_pri->adapter,
 					  i2c_pri->addr | BIT(2));
-	if (IS_ERR_OR_NULL(bcm590xx->i2c_sec)) {
+	if (!bcm590xx->i2c_sec) {
 		dev_err(&i2c_pri->dev, "failed to add secondary I2C device\n");
 		return -ENODEV;
 	}
Signature · 1 line
1.9.1