From: linux@treblig.org
To: lgirdwood@gmail.com, broonie@kernel.org
Cc: linux-doc@vger.kernel.org, corbet@lwn.net,
linux-kernel@vger.kernel.org,
"Dr. David Alan Gilbert" <linux@treblig.org>
Subject: [PATCH 1/5] regulator: devres: Remove unused devm_regulator_bulk_register_supply_alias
Date: Sat, 26 Apr 2025 18:51:39 +0100 [thread overview]
Message-ID: <20250426175143.128086-2-linux@treblig.org> (raw)
In-Reply-To: <20250426175143.128086-1-linux@treblig.org>
From: "Dr. David Alan Gilbert" <linux@treblig.org>
devm_regulator_bulk_register_supply_alias() has been unused since 2014's
commit d137be00ee01 ("mfd: core: Don't use devres functions before device
is added")
Remove it, and the static helpers only it used.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
.../driver-api/driver-model/devres.rst | 1 -
drivers/regulator/devres.c | 74 -------------------
include/linux/regulator/consumer.h | 6 --
3 files changed, 81 deletions(-)
diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index d75728eb05f8..9a0122fceabd 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -424,7 +424,6 @@ PWM
devm_fwnode_pwm_get()
REGULATOR
- devm_regulator_bulk_register_supply_alias()
devm_regulator_bulk_get()
devm_regulator_bulk_get_const()
devm_regulator_bulk_get_enable()
diff --git a/drivers/regulator/devres.c b/drivers/regulator/devres.c
index 2cf03042fddf..3fb01417fa5a 100644
--- a/drivers/regulator/devres.c
+++ b/drivers/regulator/devres.c
@@ -490,15 +490,6 @@ struct regulator_supply_alias_match {
const char *id;
};
-static int devm_regulator_match_supply_alias(struct device *dev, void *res,
- void *data)
-{
- struct regulator_supply_alias_match *match = res;
- struct regulator_supply_alias_match *target = data;
-
- return match->dev == target->dev && strcmp(match->id, target->id) == 0;
-}
-
static void devm_regulator_destroy_supply_alias(struct device *dev, void *res)
{
struct regulator_supply_alias_match *match = res;
@@ -547,71 +538,6 @@ int devm_regulator_register_supply_alias(struct device *dev, const char *id,
}
EXPORT_SYMBOL_GPL(devm_regulator_register_supply_alias);
-static void devm_regulator_unregister_supply_alias(struct device *dev,
- const char *id)
-{
- struct regulator_supply_alias_match match;
- int rc;
-
- match.dev = dev;
- match.id = id;
-
- rc = devres_release(dev, devm_regulator_destroy_supply_alias,
- devm_regulator_match_supply_alias, &match);
- if (rc != 0)
- WARN_ON(rc);
-}
-
-/**
- * devm_regulator_bulk_register_supply_alias - Managed register
- * multiple aliases
- *
- * @dev: device to supply
- * @id: list of supply names or regulator IDs
- * @alias_dev: device that should be used to lookup the supply
- * @alias_id: list of supply names or regulator IDs that should be used to
- * lookup the supply
- * @num_id: number of aliases to register
- *
- * @return 0 on success, a negative error number on failure.
- *
- * This helper function allows drivers to register several supply
- * aliases in one operation, the aliases will be automatically
- * unregisters when the source device is unbound. If any of the
- * aliases cannot be registered any aliases that were registered
- * will be removed before returning to the caller.
- */
-int devm_regulator_bulk_register_supply_alias(struct device *dev,
- const char *const *id,
- struct device *alias_dev,
- const char *const *alias_id,
- int num_id)
-{
- int i;
- int ret;
-
- for (i = 0; i < num_id; ++i) {
- ret = devm_regulator_register_supply_alias(dev, id[i],
- alias_dev,
- alias_id[i]);
- if (ret < 0)
- goto err;
- }
-
- return 0;
-
-err:
- dev_err(dev,
- "Failed to create supply alias %s,%s -> %s,%s\n",
- id[i], dev_name(dev), alias_id[i], dev_name(alias_dev));
-
- while (--i >= 0)
- devm_regulator_unregister_supply_alias(dev, id[i]);
-
- return ret;
-}
-EXPORT_SYMBOL_GPL(devm_regulator_bulk_register_supply_alias);
-
struct regulator_notifier_match {
struct regulator *regulator;
struct notifier_block *nb;
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 56fe2693d9b2..1e20c7330cd4 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -185,12 +185,6 @@ int devm_regulator_register_supply_alias(struct device *dev, const char *id,
struct device *alias_dev,
const char *alias_id);
-int devm_regulator_bulk_register_supply_alias(struct device *dev,
- const char *const *id,
- struct device *alias_dev,
- const char *const *alias_id,
- int num_id);
-
/* regulator output control and status */
int __must_check regulator_enable(struct regulator *regulator);
int regulator_disable(struct regulator *regulator);
--
2.49.0
next prev parent reply other threads:[~2025-04-26 17:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-26 17:51 [PATCH 0/5] Regulator deadcode cleanups linux
2025-04-26 17:51 ` linux [this message]
2025-04-26 17:51 ` [PATCH 2/5] regulator: core: Remove unused regulator_bulk_force_disable linux
2025-04-26 17:51 ` [PATCH 3/5] regulator: core: Remove unused regulator_*drvdata functions linux
2025-04-26 17:51 ` [PATCH 4/5] regulator: core: Remove unused regulator_suspend_(disable|enable) linux
2025-04-26 17:51 ` [PATCH 5/5] regulator: core: Remove unused regulator_set_suspend_voltage linux
2025-04-27 14:34 ` [PATCH 0/5] Regulator deadcode cleanups Mark Brown
2025-04-27 14:58 ` Dr. David Alan Gilbert
2025-04-30 23:18 ` Mark Brown
2025-05-01 0:03 ` Dr. David Alan Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250426175143.128086-2-linux@treblig.org \
--to=linux@treblig.org \
--cc=broonie@kernel.org \
--cc=corbet@lwn.net \
--cc=lgirdwood@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.