lkml.org 
[lkml]   [2013]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 7/7] regulator: ti-abb: Use devm_regulator_register
On 09/04/2013 11:26 AM, Sachin Kamat wrote:
> Hi Nishanth,
>
> On 4 September 2013 18:57, Nishanth Menon <nm@ti.com> wrote:
>> On 09/04/2013 01:31 AM, Sachin Kamat wrote:
>>> -err:
>>> - dev_err(dev, "%s: Failed to initialize(%d)\n", __func__, ret);
>>> - return ret;
>> here -> with this, the lazy non detailed prints end with a generic
>> fail case.
>
> Generally when a driver is converted to use devm_* APIs, the error
> handling code gets
> refactored and simplified as several unwinding calls get removed. The
> above print was similarly removed as part
> of the cleanup and refactoring as it did not add any extra value.
> Probe failure is reported even without this error
> message.
>

the cleanups here do not have anything to do with devm optimization.
in fact, if we stick with what we have stated to do in this patch,
- rdev = regulator_register(desc, &config);
+ rdev = devm_regulator_register(dev, desc, &config);
if (IS_ERR(rdev)) {
ret = PTR_ERR(rdev);
dev_err(dev, "%s: failed to register regulator(%d)\n",
__func__, ret);
- goto err;
+ return ret;
}

is all we got to do in the probe path.

I accept that probe failure gives me the required info for fail, and
the cleanup of log prints also make sense, just that the log refactor
seems out of context to the specific change.

--
Regards,
Nishanth Menon


\
 
 \ /
  Last update: 2013-09-04 19:21    [W:0.757 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site