i2c: pca-platform: propagate error from i2c_pca_add_numbered_bus
authorChris Packham <chris.packham@alliedtelesis.co.nz>
Fri, 30 Jun 2017 00:54:05 +0000 (12:54 +1200)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 4 Jul 2017 14:03:42 +0000 (16:03 +0200)
Rather than returning -ENODEV if i2c_pca_add_numbered_bus() fails,
propagate the error to aid debugging.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-pca-platform.c

index daccef6865e8a9f57c5beb02407a7ad06bd56f32..853a2abedb05e8a07af93274679ed443a085702b 100644 (file)
@@ -232,9 +232,9 @@ static int i2c_pca_pf_probe(struct platform_device *pdev)
                        return ret;
        }
 
-       if (i2c_pca_add_numbered_bus(&i2c->adap) < 0) {
-               return -ENODEV;
-       }
+       ret = i2c_pca_add_numbered_bus(&i2c->adap);
+       if (ret)
+               return ret;
 
        platform_set_drvdata(pdev, i2c);