Commit Graph

11 Commits

Author SHA1 Message Date
Uwe Kleine-König 6061302092 leds: Convert all platform drivers to return void
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-11-01 11:28:35 +00:00
Pavel Machek 51eb5a24de leds: rb532: cleanup whitespace
Trivial cleanup removing empty line at wrong place.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
2020-01-22 21:08:07 +01:00
Thomas Gleixner 09c434b8a0 treewide: Add SPDX license identifier for more missed files
Add SPDX license identifiers to all files which:

 - Have no license information of any form

 - Have MODULE_LICENCE("GPL*") inside which was used in the initial
   scan/conversion to ignore the file

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

  GPL-2.0-only

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21 10:50:45 +02:00
Wolfram Sang 81902d5f65 leds: drop owner assignment from platform_drivers
A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-10-20 16:20:43 +02:00
Linus Torvalds e81d372ff9 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds
Pull LED subsystem update from Bryan Wu.

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: (47 commits)
  leds: leds-lp5521: return an error code on error in probe()
  leds: leds-clevo-mail: Use pr_* instead of printks
  leds: leds-rb532: Fix checkpatch errors
  leds: led-triggers: Fix checkpatch warnings
  leds: ledtrig-backlight: Fix checkpatch error
  leds: leds-wrap: Use <linux/io.h> instead of <asm/io.h>
  leds: leds-wm8350: Use dev_err instead of printk
  leds: leds-pwm: Fix checkpatch warning
  leds: leds-pca955x: Use dev_info instead of printk
  leds: leds-net48xx: Use linux/io.h instead of asm/io.h
  leds: leds-lt3593: Fix checkpatch warnings
  leds: leds-gpio: Use dev_info instead of printk
  leds: leds-da903x: Fix checkpatch error and warnings
  leds: leds-bd2802: Fix checkpatch warnings
  leds: leds-adp5520: Fix checkpatch warnings
  leds: led-class: Fix checkpatch warning
  leds: leds-ns2: use devm_gpio_request_one
  leds: leds-lt3593: use devm_gpio_request_one
  leds: leds-gpio: use devm_gpio_request_one
  leds: lp3944: Fix return value
  ...
2012-12-15 12:52:42 -08:00
Sachin Kamat 7a0eff4d83 leds: leds-rb532: Fix checkpatch errors
Fixes the following issues:
ERROR: code indent should use tabs where possible
WARNING: please, no spaces at the start of a line

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
2012-11-28 15:12:53 -08:00
Bill Pemberton 678e8a6be9 leds: remove use of __devexit
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Jan-Simon Moeller <jansimon.moeller@gmx.de>
Acked-by: Bryan Wu <cooloney@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28 12:35:06 -08:00
Bill Pemberton 98ea1ea20c leds: remove use of __devinit
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Jan-Simon Moeller <jansimon.moeller@gmx.de>
Acked-by: Bryan Wu <cooloney@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28 12:34:57 -08:00
Bill Pemberton df07cf8126 leds: remove use of __devexit_p
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Jan-Simon Moeller <jansimon.moeller@gmx.de>
Acked-by: Bryan Wu <cooloney@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28 12:33:20 -08:00
Axel Lin 892a8843fb leds: convert led platform drivers to module_platform_driver
Factor out some boilerplate code for platform driver registration into
module_platform_driver.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Haojian Zhuang <hzhuang1@marvell.com>		[led-88pm860x.c]
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Michael Hennerich <hennerich@blackfin.uclinux.org>
Cc: Mike Rapoport <mike@compulab.co.il>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10 16:30:48 -08:00
Phil Sutter ac67e23bed leds: Add rb532 LED driver for the User LED
Mikrotik built six LEDs into the Routerboard 532, from which one is
destined for custom use, the so called "User LED". This patch adds a
driver for it, based on the LEDs class.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-04-06 16:06:26 +01:00