Skip to content

Commit

Permalink
Merge branch 'topic/sysfs-init' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/broonie/regulator into regulator-supply
  • Loading branch information
Mark Brown committed Apr 22, 2016
2 parents 8e5356a + 469b640 commit f89ba33
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3961,21 +3961,22 @@ regulator_register(const struct regulator_desc *regulator_desc,
rdev->dev.parent = dev;
dev_set_name(&rdev->dev, "regulator.%lu",
(unsigned long) atomic_inc_return(&regulator_no));
ret = device_register(&rdev->dev);
if (ret != 0) {
put_device(&rdev->dev);
goto wash;
}

dev_set_drvdata(&rdev->dev, rdev);

/* set regulator constraints */
if (init_data)
constraints = &init_data->constraints;

ret = set_machine_constraints(rdev, constraints);
if (ret < 0)
goto scrub;
goto wash;

ret = device_register(&rdev->dev);
if (ret != 0) {
put_device(&rdev->dev);
goto wash;
}

dev_set_drvdata(&rdev->dev, rdev);

if (init_data && init_data->supply_regulator)
rdev->supply_name = init_data->supply_regulator;
Expand Down Expand Up @@ -4007,14 +4008,13 @@ regulator_register(const struct regulator_desc *regulator_desc,

unset_supplies:
unset_regulator_supplies(rdev);

scrub:
regulator_ena_gpio_free(rdev);
device_unregister(&rdev->dev);
/* device core frees rdev */
goto out;

wash:
kfree(rdev->constraints);
regulator_ena_gpio_free(rdev);
clean:
kfree(rdev);
Expand Down

0 comments on commit f89ba33

Please sign in to comment.