[PATCH v2 1/1] regmap: Drop unused devm_regmap_*_free() APIs

Andy Shevchenko
2025-01-16T12:43:45Z

Besides the fact that currently defined devm_*_free() APIs
are being unused, it's usually a sign of bad design to call
such explicitly. Drop them and make people pay more attention
on the misuse of devm_regmap_*() APIs,

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: rebased on the top of latest vanilla
drivers/base/regmap/regmap.c | 36 ------------------------------------
include/linux/regmap.h | 3 ---
2 files changed, 39 deletions(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 197c79b66828..2314744201b4 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1330,42 +1330,6 @@ void regmap_field_bulk_free(struct regmap_field *field)
}
EXPORT_SYMBOL_GPL(regmap_field_bulk_free);

-/**
- * devm_regmap_field_bulk_free() - Free a bulk register field allocated using
- * devm_regmap_field_bulk_alloc.
- *
- * @dev: Device that will be interacted with
- * @field: regmap field which should be freed.
- *
- * Free register field allocated using devm_regmap_field_bulk_alloc(). Usually
- * drivers need not call this function, as the memory allocated via devm
- * will be freed as per device-driver life-cycle.
- */
-void devm_regmap_field_bulk_free(struct device *dev,
- struct regmap_field *field)
-{
- devm_kfree(dev, field);
-}
-EXPORT_SYMBOL_GPL(devm_regmap_field_bulk_free);
-
-/**
- * devm_regmap_field_free() - Free a register field allocated using
- * devm_regmap_field_alloc.
- *
- * @dev: Device that will be interacted with
- * @field: regmap field which should be freed.
- *
- * Free register field allocated using devm_regmap_field_alloc(). Usually
- * drivers need not call this function, as the memory allocated via devm
- * will be freed as per device-driver life-cyle.
- */
-void devm_regmap_field_free(struct device *dev,
- struct regmap_field *field)
-{
- devm_kfree(dev, field);
-}
-EXPORT_SYMBOL_GPL(devm_regmap_field_free);
-
/**
* regmap_field_alloc() - Allocate and initialise a register field.
*
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 3a96d068915f..c7f51f0b13af 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -1441,7 +1441,6 @@ void regmap_field_free(struct regmap_field *field);

struct regmap_field *devm_regmap_field_alloc(struct device *dev,
struct regmap *regmap, struct reg_field reg_field);
-void devm_regmap_field_free(struct device *dev, struct regmap_field *field);

int regmap_field_bulk_alloc(struct regmap *regmap,
struct regmap_field **rm_field,
@@ -1452,8 +1451,6 @@ int devm_regmap_field_bulk_alloc(struct device *dev, struct regmap *regmap,
struct regmap_field **field,
const struct reg_field *reg_field,
int num_fields);
-void devm_regmap_field_bulk_free(struct device *dev,
- struct regmap_field *field);

int regmap_field_read(struct regmap_field *field, unsigned int *val);
int regmap_field_update_bits_base(struct regmap_field *field,
--
2.43.0.rc1.1336.g36b5255a03ac