2024-04-29 14:46:11

by Michał Mirosław

[permalink] [raw]
Subject: [PATCH v2 06/12] regulator/core: remove regulator_init callback

There are no in-tree users. The only usage went away in 2019 in
8c44e448583c ("regulator: stpmic1: Simplify regulators registration").

Signed-off-by: Michał Mirosław <[email protected]>
---
drivers/regulator/core.c | 7 -------
include/linux/regulator/machine.h | 7 ++-----
2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 4cb30e49c03d..be45983e1d23 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -5679,13 +5679,6 @@ regulator_register(struct device *dev,
resolved_early = true;
}

- /* perform any regulator specific init */
- if (init_data && init_data->regulator_init) {
- ret = init_data->regulator_init(rdev->reg_data);
- if (ret < 0)
- goto wash;
- }
-
if (config->ena_gpiod) {
ret = regulator_ena_gpio_request(rdev, config);
if (ret != 0) {
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 0cd76d264727..7c39dbc33290 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -274,8 +274,7 @@ struct regulator_consumer_supply {
* @num_consumer_supplies: Number of consumer device supplies.
* @consumer_supplies: Consumer device supply configuration.
*
- * @regulator_init: Callback invoked when the regulator has been registered.
- * @driver_data: Data passed to regulator_init.
+ * @driver_data: Pointer copied to regulator_dev.reg_data.
*/
struct regulator_init_data {
const char *supply_regulator; /* or NULL for system supply */
@@ -285,9 +284,7 @@ struct regulator_init_data {
int num_consumer_supplies;
struct regulator_consumer_supply *consumer_supplies;

- /* optional regulator machine specific init */
- int (*regulator_init)(void *driver_data);
- void *driver_data; /* core does not touch this */
+ void *driver_data;
};

#ifdef CONFIG_REGULATOR
--
2.39.2