[PATCH v2 11/12] regulator/core: remove regulator_get/set_drvdata

From: Michał Mirosław
Date: Mon Apr 29 2024 - 10:46:54 EST


There are no users of accessing regulator driver data via `struct
regulator` and there shouldn't be any as the struct is representing
a power consumer not the regulator itself.

Signed-off-by: Michał Mirosław <mirq-linux@xxxxxxxxxxxx>
---
drivers/regulator/core.c | 24 ------------------------
include/linux/regulator/consumer.h | 14 --------------
2 files changed, 38 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index d7192530d3e0..010f4db2ce60 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -5908,30 +5908,6 @@ void *rdev_get_drvdata(struct regulator_dev *rdev)
}
EXPORT_SYMBOL_GPL(rdev_get_drvdata);

-/**
- * regulator_get_drvdata - get regulator driver data
- * @regulator: regulator
- *
- * Get regulator driver private data. This call can be used in the consumer
- * driver context when non API regulator specific functions need to be called.
- */
-void *regulator_get_drvdata(struct regulator *regulator)
-{
- return regulator->rdev->reg_data;
-}
-EXPORT_SYMBOL_GPL(regulator_get_drvdata);
-
-/**
- * regulator_set_drvdata - set regulator driver data
- * @regulator: regulator
- * @data: data
- */
-void regulator_set_drvdata(struct regulator *regulator, void *data)
-{
- regulator->rdev->reg_data = data;
-}
-EXPORT_SYMBOL_GPL(regulator_set_drvdata);
-
/**
* rdev_get_id - get regulator ID
* @rdev: regulator
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 4660582a3302..ee84adba390a 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -268,10 +268,6 @@ int regulator_suspend_disable(struct regulator_dev *rdev,
int regulator_set_suspend_voltage(struct regulator *regulator, int min_uV,
int max_uV, suspend_state_t state);

-/* driver data - core doesn't touch */
-void *regulator_get_drvdata(struct regulator *regulator);
-void regulator_set_drvdata(struct regulator *regulator, void *data);
-
/* misc helpers */

void regulator_bulk_set_supply_names(struct regulator_bulk_data *consumers,
@@ -607,16 +603,6 @@ static inline int regulator_set_suspend_voltage(struct regulator *regulator,
return -EINVAL;
}

-static inline void *regulator_get_drvdata(struct regulator *regulator)
-{
- return NULL;
-}
-
-static inline void regulator_set_drvdata(struct regulator *regulator,
- void *data)
-{
-}
-
static inline int regulator_count_voltages(struct regulator *regulator)
{
return 0;
--
2.39.2