summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-mlxreg.c
AgeCommit message (Collapse)AuthorFilesLines
2024-03-07leds: mlxreg: Drop an excess struct mlxreg_led_data memberRandy Dunlap1-1/+0
Drop one struct member description to fix a kernel-doc warning: drivers/leds/leds-mlxreg.c:42: warning: Excess struct member 'led_data' description in 'mlxreg_led_data' Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20240229071931.7870-4-rdunlap@infradead.org Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01leds: Convert all platform drivers to return voidUwe Kleine-König1-4/+2
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). All platform drivers below drivers/leds/ unconditionally return zero in their remove callback and so can be converted trivially to the variant returning void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230917130947.1122198-1-u.kleine-koenig@pengutronix.de Signed-off-by: Lee Jones <lee@kernel.org>
2023-07-28leds: Explicitly include correct DT includesRob Herring1-1/+0
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230714174651.4058753-1-robh@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
2021-05-28leds: leds-mlxreg: Fix incorrect documentation of struct member 'led_cdev' ↵Lee Jones1-1/+2
and 'led_cdev_name' Fixes the following W=1 kernel build warning(s): drivers/leds/leds-mlxreg.c:42: warning: Function parameter or member 'led_cdev' not described in 'mlxreg_led_data' drivers/leds/leds-mlxreg.c:42: warning: Function parameter or member 'led_cdev_name' not described in 'mlxreg_led_data' Cc: Vadim Pasternak <vadimp@nvidia.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: linux-leds@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
2019-11-03leds: mlxreg: Fix possible buffer overflowOleh Kravchenko1-2/+2
Error was detected by PVS-Studio: V512 A call of the 'sprintf' function will lead to overflow of the buffer 'led_data->led_cdev_name'. Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua> Signed-off-by: Pavel Machek <pavel@ucw.cz>
2019-02-23leds: mlxreg: Add support for capability registerVadim Pasternak1-0/+19
Add support for capability register in order to distinct between the systems with minor LED configuration differences. It reduces the amount of code describing systems' LED configuration. For example one system can be equipped with six LED, while the other with only four. Reading this information from the capability registers allows to use the same LED structure for such systems and set the relevant configuration dynamically based on capability register content. Signed-off-by: Vadim Pasternak <vadimp@mellanox.com> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2018-02-19leds: add driver for support Mellanox regmap LEDs for BMC and x86 platformVadim Pasternak1-0/+281
Driver obtains LED devices according to system configuration and creates devices in form: "devicename:color:function", like The full path is to be: /sys/class/leds/mlxreg\:status\:amber/brightness After timer trigger activation: echo timer > /sys/class/leds/mlxreg\:status\:amber/trigger Attributes for LED blinking will appaer in sysfs infrastructure: /sys/class/leds/mlxreg\:status\:amber/delay_off /sys/class/leds/mlxreg\:status\:amber/delay_on LED setting is controlled through the on-board programmable devices, which exports its register map. This device could be attached to any bus type, for which register mapping is supported. Signed-off-by: Vadim Pasternak <vadimp@mellanox.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>