Re: [PATCH v2 2/2] Simplify LED registeration by devm_led_classdev_register()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pavel

On 6/10/19 9:36 AM, Pavel Machek wrote:
On Mon 2019-06-10 09:26:14, Dan Murphy wrote:
Oleh

On 6/8/19 9:30 AM, Oleh Kravchenko wrote:
Then there is no need to set np or store it.
Huh?  This does not really explain much about what this patch is
doing.

ledm_ variant does not need np, so it can be deleted. Sounds like a
good cleanup to me.

I agree with the patch and the clean up just wanted a better commit log.

Dan


Acked-by: Pavel Machek <pavel@xxxxxx>


diff --git a/drivers/leds/leds-cr0014114.c b/drivers/leds/leds-cr0014114.c
index 91deb40db307..880089ef9a9b 100644
--- a/drivers/leds/leds-cr0014114.c
+++ b/drivers/leds/leds-cr0014114.c
@@ -183,12 +183,10 @@ static int cr0014114_probe_dt(struct cr0014114 *priv)
  	size_t			i = 0;
  	struct cr0014114_led	*led;
  	struct fwnode_handle	*child;
-	struct device_node	*np;
  	int			ret;
  	const char		*str;
  	device_for_each_child_node(priv->dev, child) {
-		np = to_of_node(child);
  		led = &priv->leds[i];
  		ret = fwnode_property_read_string(child, "label", &str);
@@ -207,8 +205,7 @@ static int cr0014114_probe_dt(struct cr0014114 *priv)
  		led->ldev.max_brightness	  = CR_MAX_BRIGHTNESS;
  		led->ldev.brightness_set_blocking = cr0014114_set_sync;
-		ret = devm_of_led_classdev_register(priv->dev, np,
-						    &led->ldev);
+		ret = devm_led_classdev_register(priv->dev, &led->ldev);
  		if (ret) {
  			dev_err(priv->dev,
  				"failed to register LED device %s, err %d",
@@ -217,8 +214,6 @@ static int cr0014114_probe_dt(struct cr0014114 *priv)
  			return ret;
  		}
-		led->ldev.dev->of_node = np;
-
  		i++;
  	}



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux