[PATCH v32 2/6] leds: lp50xx: Add the LP50XX family of the RGB LED driver

Pavel Machek pavel at ucw.cz
Tue Aug 11 06:31:03 EDT 2020


Hi!

> Introduce the LP5036/30/24/18/12/9 RGB LED driver.
> The difference in these parts are the number of
> LED outputs where the:
> 
> LP5036 can control 36 LEDs
> LP5030 can control 30 LEDs
> LP5024 can control 24 LEDs
> LP5018 can control 18 LEDs
> LP5012 can control 12 LEDs
> LP5009 can control 9 LEDs
> 

> +		fwnode_for_each_child_node(child, led_node) {
> +			ret = fwnode_property_read_u32(led_node, "color",
> +						       &color_id);
> +			if (ret) {
> +				dev_err(priv->dev, "Cannot read color\n");
> +				goto child_out;
> +			}
> +
> +			mc_led_info[num_colors].color_index = color_id;
> +			num_colors++;
> +		}
> +
> +		led->priv = priv;
> +		led->mc_cdev.num_colors = num_colors;
> +		led->mc_cdev.subled_info = mc_led_info;
> +		led_cdev = &led->mc_cdev.led_cdev;
> +		led_cdev->brightness_set_blocking = lp50xx_brightness_set;
> +
> +		fwnode_property_read_string(child, "linux,default-trigger",
> +					    &led_cdev->default_trigger);
> +
> +		ret = devm_led_classdev_multicolor_register_ext(&priv->client->dev,
> +						       &led->mc_cdev,
> +						       &init_data);
> +		if (ret) {
> +			dev_err(&priv->client->dev, "led register err: %d\n",
> +				ret);
> +			goto child_out;
> +		}
> +		i++;
> +	}
> +
> +	return 0;
> +
> +child_out:
> +	fwnode_handle_put(child);
> +	return ret;
> +}

Are you really sure fwnode_handle_put() handling is okay here? In
particular, where does that happen in non-error path?

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20200811/36292397/attachment-0001.sig>


More information about the linux-arm-kernel mailing list