On Thu, 2007-09-20 at 23:03 +0900, Yoichi Yuasa wrote:
> Add Cobalt Raq series LEDs support.
>
> Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
>
[...]
> diff -pruN -X mips/Documentation/dontdiff
> mips-orig/drivers/leds/leds-cobalt-raq.c mips/drivers/leds/leds-cobalt-raq.c
> --- mips-orig/drivers/leds/leds-cobalt-raq.c 1970-01-01 09:00:00.000000000
> +0900
> +++ mips/drivers/leds/leds-cobalt-raq.c 2007-09-14 13:06:03.900173500
> +0900
> @@ -0,0 +1,135 @@
[...]
> +static void __iomem *led_port;
> +static u8 led_value;
> +static DEFINE_SPINLOCK(led_value_lock);
> +
> +static void raq_web_led_set(struct led_classdev *led_cdev,
> + enum led_brightness brightness)
> +{
> + spin_lock_irq(&led_value_lock);
> +
> + if (brightness)
> + led_value |= LED_WEB;
> + else
> + led_value &= ~LED_WEB;
> + writeb(led_value, led_port);
> +
> + spin_unlock_irq(&led_value_lock);
> +}
You can't use the spin lock like that since the set function can get
called in interrupt context, you need to use irqsave/irqrestore
versions. I've already said this once...
Richard
|