From 99a013c840a05083fd82d220685af7579238bfa8 Mon Sep 17 00:00:00 2001 From: Marek BehĂșn Date: Fri, 18 Sep 2020 00:32:56 +0200 Subject: leds: various: use only available OF children MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Cc: Andrew Lunn Cc: Andrey Utkin Cc: Baolin Wang Cc: Baolin Wang Cc: Benjamin Herrenschmidt Cc: Christian Mauderer Cc: Chunyan Zhang Cc: Dan Murphy Cc: David Rivshin Cc: Haojian Zhuang Cc: H. Nikolaus Schaller Cc: Michael Ellerman Cc: Milo Kim Cc: NeilBrown Cc: Nikita Travkin Cc: Orson Zhai Cc: Paul Mackerras Cc: Philippe Retornaz Cc: Riku Voipio Cc: Simon Guinot Cc: Simon Shields Cc: Vasant Hegde Cc: Xiaotong Lu Signed-off-by: Pavel Machek --- drivers/leds/leds-is31fl319x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/leds/leds-is31fl319x.c') diff --git a/drivers/leds/leds-is31fl319x.c b/drivers/leds/leds-is31fl319x.c index e6d185ad0b7e..4161b9dd7e48 100644 --- a/drivers/leds/leds-is31fl319x.c +++ b/drivers/leds/leds-is31fl319x.c @@ -220,7 +220,7 @@ static int is31fl319x_parse_dt(struct device *dev, is31->cdef = device_get_match_data(dev); - count = of_get_child_count(np); + count = of_get_available_child_count(np); dev_dbg(dev, "probing with %d leds defined in DT\n", count); @@ -230,7 +230,7 @@ static int is31fl319x_parse_dt(struct device *dev, return -ENODEV; } - for_each_child_of_node(np, child) { + for_each_available_child_of_node(np, child) { struct is31fl319x_led *led; u32 reg; -- cgit v1.2.3