Skip to content

Commit

Permalink
regulator: core: remove machine init callback from config
Browse files Browse the repository at this point in the history
The machine specific regulator_init() appears to be unused.
It does not allow a lot of interaction with the regulator framework,
since nothing from the framework is passed along (desc, config,
etc ...)

Machine specific init may also be done with the added init_cb() in
the regulator description, so remove regulator_init().

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patch.msgid.link/20241008-regulator-ignored-data-v2-3-d1251e0ee507@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Jerome Brunet authored and Mark Brown committed Oct 22, 2024
1 parent cfcdf39 commit 602ff58
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
7 changes: 0 additions & 7 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -5775,13 +5775,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) {
Expand Down
3 changes: 1 addition & 2 deletions include/linux/regulator/machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,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);
/* optional regulator machine specific data */
void *driver_data; /* core does not touch this */
};

Expand Down

0 comments on commit 602ff58

Please sign in to comment.