mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sven Schuchmann <schuchmann@schleissheimer.de>
To: schuchmann@schleissheimer.de
Cc: Pavel Machek <pavel@ucw.cz>, Dan Murphy <dmurphy@ti.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] leds: lp50xx: remove unused regulator
Date: Wed,  3 Feb 2021 08:34:08 +0000	[thread overview]
Message-ID: <20210203083408.2534-1-schuchmann@schleissheimer.de> (raw)

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.

Part 1 updates the documentation
Part 2 removes the code

Signed-off-by: Sven Schuchmann <schuchmann@schleissheimer.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;
-- 
2.17.1


             reply	other threads:[~2021-02-03  8:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03  8:34 Sven Schuchmann [this message]
2021-02-03  9:02 ` Pavel Machek
2021-02-03 13:49   ` Dan Murphy
2021-02-03 14:23     ` Pavel Machek
2021-02-03 16:02       ` Dan Murphy
2021-02-03 16:26         ` AW: " Sven Schuchmann
2021-02-04 14:47         ` Pavel Machek

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=20210203083408.2534-1-schuchmann@schleissheimer.de \
    --to=schuchmann@schleissheimer.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dmurphy@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@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

all inboxes | Powered by JetHome®