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'