led: enable led in 88pm860x
PATCH v2 7/9 led: enable led in 88pm860x
PATCH v2 7/9 led: enable led in 88pm860x
Review
Quoted 5 lines · Haojian Zhuang
(quoted diff) +5
-0+ period = on + *delay_off; + if (period < LED_BLINK_PERIOD_MIN) + period = LED_BLINK_PERIOD_MIN; + if (period > LED_BLINK_PERIOD_MAX) + period = LED_BLINK_PERIOD_MAX;
If the hardware can't support the blink settings requested the driver ought to return an error - there's a software fallback which will blink the LED using a timer instead.
PATCH v2 7/9 led: enable led in 88pm860x
Quoted 8 lines · Mark Brown
Quoted 5 lines · Haojian Zhuang
+ ? ? period = on +
*delay_off;
+ ? ? if (period <LED_BLINK_PERIOD_MIN)
+ ? ? ? ? ? ? period =LED_BLINK_PERIOD_MIN;
+ ? ? if (period >LED_BLINK_PERIOD_MAX)
+ ? ? ? ? ? ? period =LED_BLINK_PERIOD_MAX;
Quoted 4 lines
If the hardware can't support the blink settings requested the driver ought to return an error - there's a software fallback which will blink the LED using a timer instead.
Now return an error directly.
Thanks
Haojian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-led-enable-led-in-88pm860x.patch
Type: text/x-patch
Size: 10021 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091209/a660e74a/attachment.bin>
PATCH v2 7/9 led: enable led in 88pm860x
Review
Quoted 3 lines · Haojian Zhuang
(quoted diff) +3
-0+ on = *delay_on; + if ((on < LED_BLINK_ON_MIN) || (on > LED_BLINK_ON_MAX)) + return -EINVAL;
You're returning -EINVAL here but...
Review
Quoted 5 lines
(quoted diff) +5
-0+ period = on + *delay_off; + if (period < LED_BLINK_PERIOD_MIN) + period = LED_BLINK_PERIOD_MIN; + if (period > LED_BLINK_PERIOD_MAX) + period = LED_BLINK_PERIOD_MAX;
...I'd expect it also here?