Skip to content

Commit

Permalink
i2c: pca-platform: propagate error from i2c_pca_add_numbered_bus
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Packham authored and Wolfram Sang committed Jul 4, 2017
1 parent 2ec4d88 commit 78e6c5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/i2c/busses/i2c-pca-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 78e6c5a

Please sign in to comment.