lkml.org 
[lkml]   [2008]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] led: simplify led_trigger_register_simple
From
Date
On Thu, 2008-11-13 at 05:09 +0200, Felipe Balbi wrote:
> From: Felipe Balbi <felipe.balbi@nokia.com>
>
> We can make led_trigger_register_simple by returning a
> struct led_trigger *, instead of passing a struct led_trigger **
> as a parameter and changing it inside the function.

This misses the whole point that it was intentionally written that way.

> Note that I could only test ide, power_supply and mmc changes with my laptop.
> The other changes weren't tested.
>
> drivers/leds/led-triggers.c | 25 ++++++++++++++---------
> drivers/leds/ledtrig-ide-disk.c | 6 ++++-
> drivers/mmc/core/host.c | 4 ++-
> drivers/mtd/nand/nand_base.c | 5 +++-
> drivers/power/power_supply_leds.c | 36 ++++++++++++++++++++++++++++------
> drivers/staging/at76_usb/at76_usb.c | 6 ++++-
> include/linux/leds.h | 5 +--
> 7 files changed, 63 insertions(+), 24 deletions(-)

The simple triggers were designed to cause minimum interference to the
usually external subsystem code they were added into. As an example this
meant things like errors were just handled gracefully with a printk
warning and did not take down the whole subsystem. I therefore don't
regard this patch as a simplification, more a complication.

Regards,

Richard






\
 
 \ /
  Last update: 2008-11-13 13:41    [W:0.118 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site