[PATCH 3/6] i2c: pca-platform: propagate error from i2c_pca_add_numbered_bus

From: Chris Packham
Date: Thu Jun 29 2017 - 20:54:49 EST


Rather than returning -ENODEV if i2c_pca_add_numbered_bus() fails,
propagate the error to aid debugging.

Signed-off-by: Chris Packham <chris.packham@xxxxxxxxxxxxxxxxxxx>
---
drivers/i2c/busses/i2c-pca-platform.c | 6 +++---
1 file 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);

--
2.13.0