diff options
| author | Mark Brown <broonie@kernel.org> | 2023-10-30 13:14:27 +0000 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2023-10-30 13:14:27 +0000 |
| commit | 3e0569ff812675e896cbdcbbaec10c99b544b947 (patch) | |
| tree | 29237cc7907492f521292b1d8f06e321ce5ec077 /drivers/regulator/core.c | |
| parent | 804bf07a1f726d4fe391d21b24a68ffc2381ba89 (diff) | |
| parent | bc00d9f3813a40bc2d854ae0edab14c6b43a3219 (diff) | |
regulator: Merge up pending fix
One small fix didn't get sent before the merge window.
Diffstat (limited to 'drivers/regulator/core.c')
| -rw-r--r-- | drivers/regulator/core.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index d8e1caaf207e..3137e40fcd3e 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -5542,6 +5542,8 @@ regulator_register(struct device *dev, goto rinse; } device_initialize(&rdev->dev); + dev_set_drvdata(&rdev->dev, rdev); + rdev->dev.class = ®ulator_class; spin_lock_init(&rdev->err_lock); /* @@ -5603,11 +5605,9 @@ regulator_register(struct device *dev, rdev->supply_name = regulator_desc->supply_name; /* register with sysfs */ - rdev->dev.class = ®ulator_class; rdev->dev.parent = config->dev; dev_set_name(&rdev->dev, "regulator.%lu", (unsigned long) atomic_inc_return(®ulator_no)); - dev_set_drvdata(&rdev->dev, rdev); /* set regulator constraints */ if (init_data) @@ -5724,15 +5724,11 @@ wash: mutex_lock(®ulator_list_mutex); regulator_ena_gpio_free(rdev); mutex_unlock(®ulator_list_mutex); - put_device(&rdev->dev); - rdev = NULL; clean: if (dangling_of_gpiod) gpiod_put(config->ena_gpiod); - if (rdev && rdev->dev.of_node) - of_node_put(rdev->dev.of_node); - kfree(rdev); kfree(config); + put_device(&rdev->dev); rinse: if (dangling_cfg_gpiod) gpiod_put(cfg->ena_gpiod); |