summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorChris Packham <chris.packham@alliedtelesis.co.nz>2017-06-30 02:54:05 +0200
committerWolfram Sang <wsa@the-dreams.de>2017-07-04 16:03:42 +0200
commit78e6c5abeb4ad895867fc0ff7f61c858d4deb7c0 (patch)
tree3821a55a9a7487d6d391842020d2a48b4848aea3 /drivers/i2c
parenti2c: pca-platform: correctly set algo_data.reset_chip (diff)
downloadlinux-78e6c5abeb4ad895867fc0ff7f61c858d4deb7c0.tar.xz
linux-78e6c5abeb4ad895867fc0ff7f61c858d4deb7c0.zip
i2c: pca-platform: propagate error from i2c_pca_add_numbered_bus
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>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-pca-platform.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c
index daccef6865e8..853a2abedb05 100644
--- a/drivers/i2c/busses/i2c-pca-platform.c
+++ b/drivers/i2c/busses/i2c-pca-platform.c
@@ -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);