lkml.org 
[lkml]   [2013]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] regulator: ab3100: Fix regulator register error handling
From
On Fri, Apr 26, 2013 at 3:57 PM, Axel Lin <axel.lin@ingics.com> wrote:

> Ensure to unregister all regulators before return error in probe().
>
> The regulator register order depends on the regulator ID pass to
> ab3100_regulator_register() function. Thus we need to scan ab3100_regulator_desc
> and find the index of successfully registered regulators, or alternatively just
> call ab3100_regulators_remove() to unregister all registered regulators.
>
> Since current code uses a static ab3100_regulators table, explicitly set
> reg->rdev = NULL after regulator_unregister() call to ensure calling
> ab3100_regulators_remove() in the unwind path always work.
>
> Also move ab3100_regulators_remove() to avoid forward declaration.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Excellent patch Axel, thanks!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij


\
 
 \ /
  Last update: 2013-04-29 15:01    [W:0.044 / U:0.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site