Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: devres: unexport devm_regulator_unregister_supply_alias()

This API hook isn't used anywhere outside of the regulator devres code.
This function is needed for the devm_regulator_bulk_register_supply_alias()
function on the error path, to cleanup any previously registered supply
aliases.

This change makes the devm_regulator_unregister_supply_alias() local to the
regulator core framework, to avoid it being used in any weird logic.
It's also removing the doc-string for
devm_regulator_unregister_supply_alias(), since it doesn't need to be
documented anymore, as no other external consumer should use it.

Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210625122324.327585-5-aardelean@deviqon.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Alexandru Ardelean and committed by
Mark Brown
4d9f4d1d eed43b96

+2 -21
+2 -14
drivers/regulator/devres.c
··· 267 267 } 268 268 EXPORT_SYMBOL_GPL(devm_regulator_register_supply_alias); 269 269 270 - /** 271 - * devm_regulator_unregister_supply_alias - Resource managed 272 - * regulator_unregister_supply_alias() 273 - * 274 - * @dev: device to supply 275 - * @id: supply name or regulator ID 276 - * 277 - * Unregister an alias registered with 278 - * devm_regulator_register_supply_alias(). Normally this function 279 - * will not need to be called and the resource management code 280 - * will ensure that the resource is freed. 281 - */ 282 - void devm_regulator_unregister_supply_alias(struct device *dev, const char *id) 270 + static void devm_regulator_unregister_supply_alias(struct device *dev, 271 + const char *id) 283 272 { 284 273 struct regulator_supply_alias_match match; 285 274 int rc; ··· 281 292 if (rc != 0) 282 293 WARN_ON(rc); 283 294 } 284 - EXPORT_SYMBOL_GPL(devm_regulator_unregister_supply_alias); 285 295 286 296 /** 287 297 * devm_regulator_bulk_register_supply_alias - Managed register
-7
include/linux/regulator/consumer.h
··· 222 222 int devm_regulator_register_supply_alias(struct device *dev, const char *id, 223 223 struct device *alias_dev, 224 224 const char *alias_id); 225 - void devm_regulator_unregister_supply_alias(struct device *dev, 226 - const char *id); 227 225 228 226 int devm_regulator_bulk_register_supply_alias(struct device *dev, 229 227 const char *const *id, ··· 401 403 const char *alias_id) 402 404 { 403 405 return 0; 404 - } 405 - 406 - static inline void devm_regulator_unregister_supply_alias(struct device *dev, 407 - const char *id) 408 - { 409 406 } 410 407 411 408 static inline int devm_regulator_bulk_register_supply_alias(struct device *dev,