From: "Dr. David Alan Gilbert" <linux@treblig.org>
To: lgirdwood@gmail.com, broonie@kernel.org
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: devres: Remove unused devm_regulator_bulk_register_supply_alias
Date: Thu, 28 Nov 2024 16:13:41 +0000 [thread overview]
Message-ID: <Z0iWtV6XQKNHDqf-@gallifrey> (raw)
In-Reply-To: <20241028021500.478043-1-linux@treblig.org>
* linux@treblig.org (linux@treblig.org) wrote:
> 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>
Ping.
Thanks,
Dave
> ---
> .../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 5f2ee8d717b1..a1995a16febf 100644
> --- a/Documentation/driver-api/driver-model/devres.rst
> +++ b/Documentation/driver-api/driver-model/devres.rst
> @@ -426,7 +426,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 1b893cdd1aad..6d6ddeb62f57 100644
> --- a/drivers/regulator/devres.c
> +++ b/drivers/regulator/devres.c
> @@ -491,15 +491,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;
> @@ -548,71 +539,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 b9ce521910a0..adaacd7676b6 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.47.0
>
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
next prev parent reply other threads:[~2024-11-28 16:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 2:15 [PATCH] regulator: devres: Remove unused devm_regulator_bulk_register_supply_alias linux
2024-11-28 16:13 ` Dr. David Alan Gilbert [this message]
2024-11-28 16:17 ` Mark Brown
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=Z0iWtV6XQKNHDqf-@gallifrey \
--to=linux@treblig.org \
--cc=broonie@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox