lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z0iWtV6XQKNHDqf-@gallifrey>
Date: Thu, 28 Nov 2024 16:13:41 +0000
From: "Dr. David Alan Gilbert" <linux@...blig.org>
To: lgirdwood@...il.com, broonie@...nel.org
Cc: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] regulator: devres: Remove unused
 devm_regulator_bulk_register_supply_alias

* linux@...blig.org (linux@...blig.org) wrote:
> From: "Dr. David Alan Gilbert" <linux@...blig.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@...blig.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   |_______/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ