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>
This commit is contained in:
Chris Packham 2017-06-30 12:54:05 +12:00 committed by Wolfram Sang
parent 2ec4d8831b
commit 78e6c5abeb

View 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);