Re: [PATCH v3 4/5] i2c: pca-platform: use device managed allocations

2017-06-28 Thread Chris Packham
On 28/06/17 22:54, Andy Shevchenko wrote: > On Wed, Jun 28, 2017 at 12:38 PM, Wolfram Sang wrote: >> if (i2c_pca_add_numbered_bus(&i2c->adap) < 0) { - ret = -ENODEV; - goto e_adapt; + return -ENODEV; >>> >>> This is still shado

Re: [PATCH v3 4/5] i2c: pca-platform: use device managed allocations

2017-06-28 Thread Andy Shevchenko
On Wed, Jun 28, 2017 at 12:38 PM, Wolfram Sang wrote: > >> > if (i2c_pca_add_numbered_bus(&i2c->adap) < 0) { >> > - ret = -ENODEV; >> > - goto e_adapt; >> > + return -ENODEV; >> >> This is still shadows the actual error code. > > Nice catch. But si

Re: [PATCH v3 4/5] i2c: pca-platform: use device managed allocations

2017-06-28 Thread Wolfram Sang
> > if (i2c_pca_add_numbered_bus(&i2c->adap) < 0) { > > - ret = -ENODEV; > > - goto e_adapt; > > + return -ENODEV; > > This is still shadows the actual error code. Nice catch. But since it fixes a seperate issue, I'd prefer an incremental change

Re: [PATCH v3 4/5] i2c: pca-platform: use device managed allocations

2017-06-28 Thread Andy Shevchenko
On Mon, Jun 26, 2017 at 3:44 AM, Chris Packham wrote: > Switch to using the devm_ APIs and remove the now unnecessary error > handling and most of the device removal code. > if (i2c_pca_add_numbered_bus(&i2c->adap) < 0) { > - ret = -ENODEV; > - goto e_adapt; >

Re: [PATCH v3 4/5] i2c: pca-platform: use device managed allocations

2017-06-27 Thread Wolfram Sang
On Mon, Jun 26, 2017 at 12:44:33PM +1200, Chris Packham wrote: > Switch to using the devm_ APIs and remove the now unnecessary error > handling and most of the device removal code. > > Signed-off-by: Chris Packham And "reverted" the previous fix here: - if (IS_ERR(i2c->gpio)) { -

[PATCH v3 4/5] i2c: pca-platform: use device managed allocations

2017-06-25 Thread Chris Packham
Switch to using the devm_ APIs and remove the now unnecessary error handling and most of the device removal code. Signed-off-by: Chris Packham --- drivers/i2c/busses/i2c-pca-platform.c | 53 +++ 1 file changed, 10 insertions(+), 43 deletions(-) diff --git a/drive