Commmit af40a94aba "regulator: palmas: Use devm_regulator_register" missed
removing a regulator_unregister() call if palmas_extreg_init falis. Fix it.

Signed-off-by: Axel Lin <axel....@ingics.com>
---
 drivers/regulator/palmas-regulator.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/palmas-regulator.c 
b/drivers/regulator/palmas-regulator.c
index 37b1068..825f798 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -1019,10 +1019,8 @@ static int palmas_regulators_probe(struct 
platform_device *pdev)
                                else
                                        ret = palmas_extreg_init(palmas,
                                                        id, reg_init);
-                               if (ret) {
-                                       regulator_unregister(pmic->rdev[id]);
+                               if (ret)
                                        return ret;
-                               }
                        }
                }
        }
-- 
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to