diff options
author | Marek BehĂșn <marek.behun@nic.cz> | 2020-09-18 00:32:56 +0200 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2020-09-26 21:56:39 +0200 |
commit | 99a013c840a05083fd82d220685af7579238bfa8 (patch) | |
tree | 4ea2e6253551a67f580d81a3436eda04332dc385 /drivers/leds/leds-ns2.c | |
parent | leds: lt3593: do not rewrite .of_node of new LED device to wrong value (diff) | |
download | linux-99a013c840a05083fd82d220685af7579238bfa8.tar.xz linux-99a013c840a05083fd82d220685af7579238bfa8.zip |
leds: various: use only available OF children
Various drivers count and iterate over OF children nodes via
of_get_child_count and for_each_child_of_node. Instead they should use
of_get_available_child_count and for_each_available_child_of_node, so
that if a given node has the `status` property set to `disabled`, the
child will be ignored.
Signed-off-by: Marek BehĂșn <marek.behun@nic.cz>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Andrey Utkin <andrey_utkin@fastmail.com>
Cc: Baolin Wang <baolin.wang7@gmail.com>
Cc: Baolin Wang <baolin.wang@linaro.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Christian Mauderer <oss@c-mauderer.de>
Cc: Chunyan Zhang <zhang.lyra@gmail.com>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: David Rivshin <drivshin@allworx.com>
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: H. Nikolaus Schaller <hns@goldelico.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Milo Kim <milo.kim@ti.com>
Cc: NeilBrown <neilb@suse.de>
Cc: Nikita Travkin <nikitos.tr@gmail.com>
Cc: Orson Zhai <orsonzhai@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Philippe Retornaz <philippe.retornaz@epfl.ch>
Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Simon Guinot <sguinot@lacie.com>
Cc: Simon Shields <simon@lineageos.org>
Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Cc: Xiaotong Lu <xiaotong.lu@spreadtrum.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds/leds-ns2.c')
-rw-r--r-- | drivers/leds/leds-ns2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c index 9cbd2d7251af..22d38c83b6dc 100644 --- a/drivers/leds/leds-ns2.c +++ b/drivers/leds/leds-ns2.c @@ -251,7 +251,7 @@ ns2_leds_get_of_pdata(struct device *dev, struct ns2_led_platform_data *pdata) struct ns2_led *led, *leds; int ret, num_leds = 0; - num_leds = of_get_child_count(np); + num_leds = of_get_available_child_count(np); if (!num_leds) return -ENODEV; @@ -261,7 +261,7 @@ ns2_leds_get_of_pdata(struct device *dev, struct ns2_led_platform_data *pdata) return -ENOMEM; led = leds; - for_each_child_of_node(np, child) { + for_each_available_child_of_node(np, child) { const char *string; int i, num_modes; struct ns2_led_modval *modval; |