Re: [PATCH v2 2/5] regulator: core: have regulator_dev_lookup() return ERR_PTR-encoded errors

2017-02-05 Thread Mark Brown
On Sat, Feb 04, 2017 at 10:19:21AM -0800, Dmitry Torokhov wrote: > Instead of returning both regulator_dev structure as return value and > auxiliary error code in 'ret' argument, let's switch to using ERR_PTR > encoded values. This makes it more obvious what is going on at call sites. I did apply

Re: [PATCH v2 2/5] regulator: core: have regulator_dev_lookup() return ERR_PTR-encoded errors

2017-02-05 Thread Mark Brown
On Sat, Feb 04, 2017 at 10:19:21AM -0800, Dmitry Torokhov wrote: > Instead of returning both regulator_dev structure as return value and > auxiliary error code in 'ret' argument, let's switch to using ERR_PTR > encoded values. This makes it more obvious what is going on at call sites. I did apply

Re: [PATCH v2 2/5] regulator: core: have regulator_dev_lookup() return ERR_PTR-encoded errors

2017-02-05 Thread Mark Brown
On Sat, Feb 04, 2017 at 10:19:21AM -0800, Dmitry Torokhov wrote: > V2: replaced "return r ? r : ERR_PTR(-ENODEV);" with expanded "if" > statement. Please don't send new versions of patches as replies into the middle of existing patch serieses, especially not by replying to individual patches and

Re: [PATCH v2 2/5] regulator: core: have regulator_dev_lookup() return ERR_PTR-encoded errors

2017-02-05 Thread Mark Brown
On Sat, Feb 04, 2017 at 10:19:21AM -0800, Dmitry Torokhov wrote: > V2: replaced "return r ? r : ERR_PTR(-ENODEV);" with expanded "if" > statement. Please don't send new versions of patches as replies into the middle of existing patch serieses, especially not by replying to individual patches and

[PATCH v2 2/5] regulator: core: have regulator_dev_lookup() return ERR_PTR-encoded errors

2017-02-04 Thread Dmitry Torokhov
Instead of returning both regulator_dev structure as return value and auxiliary error code in 'ret' argument, let's switch to using ERR_PTR encoded values. This makes it more obvious what is going on at call sites. Also, let's not unlock the mutex in the middle of a loop, but rather break out and

[PATCH v2 2/5] regulator: core: have regulator_dev_lookup() return ERR_PTR-encoded errors

2017-02-04 Thread Dmitry Torokhov
Instead of returning both regulator_dev structure as return value and auxiliary error code in 'ret' argument, let's switch to using ERR_PTR encoded values. This makes it more obvious what is going on at call sites. Also, let's not unlock the mutex in the middle of a loop, but rather break out and