Hi Oleh,
Thank you for the patch. I am addressing that already in the
patch 17/26 [0] of my LED naming v5 series, so I will hold on
this for a while - maybe the series will be accepted in greater part
this time, so the improvement will go alongside.
On 6/10/19 4:36 PM, 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.
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++;
}
[0] https://lkml.org/lkml/2019/6/9/709
--
Best regards,
Jacek Anaszewski