Message ID | 20170630005408.23968-4-chris.packham@alliedtelesis.co.nz (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Jun 30, 2017 at 3:54 AM, Chris Packham <chris.packham@alliedtelesis.co.nz> wrote: > Rather than returning -ENODEV if i2c_pca_add_numbered_bus() fails, > propagate the error to aid debugging. > + Suggested-by ? You or Wolfram can use below if you agree on it (I'm fine either way): Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> > --- > 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 >
On Fri, Jun 30, 2017 at 11:40:51AM +0300, Andy Shevchenko wrote: > On Fri, Jun 30, 2017 at 3:54 AM, Chris Packham > <chris.packham@alliedtelesis.co.nz> wrote: > > Rather than returning -ENODEV if i2c_pca_add_numbered_bus() fails, > > propagate the error to aid debugging. > > > > + Suggested-by ? > > You or Wolfram can use below if you agree on it (I'm fine either way): > > Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> I'll pick it.
On 30/06/17 20:40, Andy Shevchenko wrote: > On Fri, Jun 30, 2017 at 3:54 AM, Chris Packham > <chris.packham@alliedtelesis.co.nz> wrote: >> Rather than returning -ENODEV if i2c_pca_add_numbered_bus() fails, >> propagate the error to aid debugging. >> > > + Suggested-by ? > > You or Wolfram can use below if you agree on it (I'm fine either way): > > Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> > I'll include it (and the Reviewed-by) in v2 if there is one. >> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> > >> --- >> 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 >> > > > -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Jun 30, 2017 at 12:54:05PM +1200, Chris Packham wrote: > Rather than returning -ENODEV if i2c_pca_add_numbered_bus() fails, > propagate the error to aid debugging. > > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Easy one and nice to have. Will be in this merge window. Applied to for-next, thanks!
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);
Rather than returning -ENODEV if i2c_pca_add_numbered_bus() fails, propagate the error to aid debugging. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> --- drivers/i2c/busses/i2c-pca-platform.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)