leds-is31fl319x.c (8853c95e997e0a3621bd8718bdaded81ed37bc9a) | leds-is31fl319x.c (99a013c840a05083fd82d220685af7579238bfa8) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright 2015-16 Golden Delicious Computers 4 * 5 * Author: Nikolaus Schaller <hns@goldelico.com> 6 * 7 * LED driver for the IS31FL319{0,1,3,6,9} to drive 1, 3, 6 or 9 light 8 * effect LEDs. --- 206 unchanged lines hidden (view full) --- 215 if (IS_ERR(is31->shutdown_gpio)) { 216 ret = PTR_ERR(is31->shutdown_gpio); 217 dev_err(dev, "Failed to get shutdown gpio: %d\n", ret); 218 return ret; 219 } 220 221 is31->cdef = device_get_match_data(dev); 222 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright 2015-16 Golden Delicious Computers 4 * 5 * Author: Nikolaus Schaller <hns@goldelico.com> 6 * 7 * LED driver for the IS31FL319{0,1,3,6,9} to drive 1, 3, 6 or 9 light 8 * effect LEDs. --- 206 unchanged lines hidden (view full) --- 215 if (IS_ERR(is31->shutdown_gpio)) { 216 ret = PTR_ERR(is31->shutdown_gpio); 217 dev_err(dev, "Failed to get shutdown gpio: %d\n", ret); 218 return ret; 219 } 220 221 is31->cdef = device_get_match_data(dev); 222 |
223 count = of_get_child_count(np); | 223 count = of_get_available_child_count(np); |
224 225 dev_dbg(dev, "probing with %d leds defined in DT\n", count); 226 227 if (!count || count > is31->cdef->num_leds) { 228 dev_err(dev, "Number of leds defined must be between 1 and %u\n", 229 is31->cdef->num_leds); 230 return -ENODEV; 231 } 232 | 224 225 dev_dbg(dev, "probing with %d leds defined in DT\n", count); 226 227 if (!count || count > is31->cdef->num_leds) { 228 dev_err(dev, "Number of leds defined must be between 1 and %u\n", 229 is31->cdef->num_leds); 230 return -ENODEV; 231 } 232 |
233 for_each_child_of_node(np, child) { | 233 for_each_available_child_of_node(np, child) { |
234 struct is31fl319x_led *led; 235 u32 reg; 236 237 ret = of_property_read_u32(child, "reg", ®); 238 if (ret) { 239 dev_err(dev, "Failed to read led 'reg' property\n"); 240 goto put_child_node; 241 } --- 214 unchanged lines hidden --- | 234 struct is31fl319x_led *led; 235 u32 reg; 236 237 ret = of_property_read_u32(child, "reg", ®); 238 if (ret) { 239 dev_err(dev, "Failed to read led 'reg' property\n"); 240 goto put_child_node; 241 } --- 214 unchanged lines hidden --- |