From: Chris Packham Date: Fri, 30 Jun 2017 00:54:05 +0000 (+1200) Subject: i2c: pca-platform: propagate error from i2c_pca_add_numbered_bus X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=78e6c5abeb4ad895867fc0ff7f61c858d4deb7c0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Chris Packham Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang --- 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);