Re: [PATCH v10 3/5] leds: class: store the color index in struct led_classdev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 13/07/2023 11:53, Lee Jones wrote:
On Sat, 24 Jun 2023, Jean-Jacques Hiblot wrote:
+static ssize_t color_show(struct device *dev,
+		struct device_attribute *attr, char *buf)
+{
+	const char *color_text = "invalid";
+	struct led_classdev *led_cdev = dev_get_drvdata(dev);

Can this be NULL?
Thanks for your feedback.

No it can't be NULL.


+	if (led_cdev->color < LED_COLOR_ID_MAX)
+		color_text = led_colors[led_cdev->color];

'\n'



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux