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: <20210203090249.GA14154@amd>
Date:   Wed, 3 Feb 2021 10:02:50 +0100
From:   Pavel Machek <pavel@....cz>
To:     Sven Schuchmann <schuchmann@...leissheimer.de>
Cc:     Dan Murphy <dmurphy@...com>, Rob Herring <robh+dt@...nel.org>,
        linux-leds@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] leds: lp50xx: remove unused regulator

On Wed 2021-02-03 08:34:08, Sven Schuchmann wrote:
> The regulator for vled-supply is unused in the driver.
> It is just assigned from DT and disabled in lp50xx_remove.
> So the code can be removed from the driver.

Dan, what is going on here? Do we need to also enable the regulator,
or is the removal correct thing to do?

Best regards,
							Pavel


> Part 1 updates the documentation
> Part 2 removes the code
> 
> Signed-off-by: Sven Schuchmann <schuchmann@...leissheimer.de>
> 
> ---
>  drivers/leds/leds-lp50xx.c | 14 --------------
>  1 file changed, 14 deletions(-)
> 
> diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c
> index f13117eed976..b0871495bae3 100644
> --- a/drivers/leds/leds-lp50xx.c
> +++ b/drivers/leds/leds-lp50xx.c
> @@ -11,7 +11,6 @@
>  #include <linux/of.h>
>  #include <linux/of_gpio.h>
>  #include <linux/regmap.h>
> -#include <linux/regulator/consumer.h>
>  #include <linux/slab.h>
>  #include <uapi/linux/uleds.h>
>  
> @@ -275,7 +274,6 @@ struct lp50xx_led {
>  /**
>   * struct lp50xx -
>   * @enable_gpio: hardware enable gpio
> - * @regulator: LED supply regulator pointer
>   * @client: pointer to the I2C client
>   * @regmap: device register map
>   * @dev: pointer to the devices device struct
> @@ -286,7 +284,6 @@ struct lp50xx_led {
>   */
>  struct lp50xx {
>  	struct gpio_desc *enable_gpio;
> -	struct regulator *regulator;
>  	struct i2c_client *client;
>  	struct regmap *regmap;
>  	struct device *dev;
> @@ -462,10 +459,6 @@ static int lp50xx_probe_dt(struct lp50xx *priv)
>  		return ret;
>  	}
>  
> -	priv->regulator = devm_regulator_get(priv->dev, "vled");
> -	if (IS_ERR(priv->regulator))
> -		priv->regulator = NULL;
> -
>  	device_for_each_child_node(priv->dev, child) {
>  		led = &priv->leds[i];
>  		ret = fwnode_property_count_u32(child, "reg");
> @@ -583,13 +576,6 @@ static int lp50xx_remove(struct i2c_client *client)
>  		return ret;
>  	}
>  
> -	if (led->regulator) {
> -		ret = regulator_disable(led->regulator);
> -		if (ret)
> -			dev_err(&led->client->dev,
> -				"Failed to disable regulator\n");
> -	}
> -
>  	mutex_destroy(&led->lock);
>  
>  	return 0;

-- 
http://www.livejournal.com/~pavelmachek

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ