From: Axel Lin Date: Fri, 26 Apr 2013 13:57:09 +0000 (+0800) Subject: regulator: ab3100: Fix regulator register error handling X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~131^2~26^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=018fd856cee9ebe794da1382ff7fafae64781dc5;p=pandora-kernel.git regulator: ab3100: Fix regulator register error handling 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 Signed-off-by: Mark Brown --- Reading git-diff-tree failed