leds-is31fl32xx.c (8853c95e997e0a3621bd8718bdaded81ed37bc9a) | leds-is31fl32xx.c (99a013c840a05083fd82d220685af7579238bfa8) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Driver for ISSI IS31FL32xx family of I2C LED controllers 4 * 5 * Copyright 2015 Allworx Corp. 6 * 7 * Datasheets: 8 * http://www.issi.com/US/product-analog-fxled-driver.shtml --- 358 unchanged lines hidden (view full) --- 367} 368 369static int is31fl32xx_parse_dt(struct device *dev, 370 struct is31fl32xx_priv *priv) 371{ 372 struct device_node *child; 373 int ret = 0; 374 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Driver for ISSI IS31FL32xx family of I2C LED controllers 4 * 5 * Copyright 2015 Allworx Corp. 6 * 7 * Datasheets: 8 * http://www.issi.com/US/product-analog-fxled-driver.shtml --- 358 unchanged lines hidden (view full) --- 367} 368 369static int is31fl32xx_parse_dt(struct device *dev, 370 struct is31fl32xx_priv *priv) 371{ 372 struct device_node *child; 373 int ret = 0; 374 |
375 for_each_child_of_node(dev_of_node(dev), child) { | 375 for_each_available_child_of_node(dev_of_node(dev), child) { |
376 struct is31fl32xx_led_data *led_data = 377 &priv->leds[priv->num_leds]; 378 const struct is31fl32xx_led_data *other_led_data; 379 380 led_data->priv = priv; 381 382 ret = is31fl32xx_parse_child_dt(dev, child, led_data); 383 if (ret) --- 46 unchanged lines hidden (view full) --- 430 const struct is31fl32xx_chipdef *cdef; 431 struct device *dev = &client->dev; 432 struct is31fl32xx_priv *priv; 433 int count; 434 int ret = 0; 435 436 cdef = device_get_match_data(dev); 437 | 376 struct is31fl32xx_led_data *led_data = 377 &priv->leds[priv->num_leds]; 378 const struct is31fl32xx_led_data *other_led_data; 379 380 led_data->priv = priv; 381 382 ret = is31fl32xx_parse_child_dt(dev, child, led_data); 383 if (ret) --- 46 unchanged lines hidden (view full) --- 430 const struct is31fl32xx_chipdef *cdef; 431 struct device *dev = &client->dev; 432 struct is31fl32xx_priv *priv; 433 int count; 434 int ret = 0; 435 436 cdef = device_get_match_data(dev); 437 |
438 count = of_get_child_count(dev_of_node(dev)); | 438 count = of_get_available_child_count(dev_of_node(dev)); |
439 if (!count) 440 return -EINVAL; 441 442 priv = devm_kzalloc(dev, struct_size(priv, leds, count), 443 GFP_KERNEL); 444 if (!priv) 445 return -ENOMEM; 446 --- 53 unchanged lines hidden --- | 439 if (!count) 440 return -EINVAL; 441 442 priv = devm_kzalloc(dev, struct_size(priv, leds, count), 443 GFP_KERNEL); 444 if (!priv) 445 return -ENOMEM; 446 --- 53 unchanged lines hidden --- |