mfd: bcm590xx: Simplify a test
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 1 Nov 2016 06:49:05 +0000 (07:49 +0100)
committerLee Jones <lee.jones@linaro.org>
Tue, 29 Nov 2016 08:21:33 +0000 (08:21 +0000)
'i2c_new_dummy()' does not return an error pointer, so the test can be
simplified to be more consistent.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/bcm590xx.c

index 0d76d690176b4efd46c04246a5ccfff0a223b0c0..c572a35a934136f1c23190a2f58f5fc1bb9a8192 100644 (file)
@@ -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;
        }