]> git.baikalelectronics.ru Git - kernel.git/commit
LEDS: tca6507 - fix bugs in parsing of device-tree configuration.
authorNeilBrown <neilb@suse.de>
Fri, 1 Nov 2013 02:33:45 +0000 (19:33 -0700)
committerBryan Wu <cooloney@gmail.com>
Tue, 28 Jan 2014 01:28:42 +0000 (17:28 -0800)
commit117bb6a6149e4349dd998e0368fa3199f297a455
tree2fb3451c09c97fde621ab6af0b7654502edfc973
parent286f523a1c3bbae0cc5a74f5dafa0481dc0f414a
LEDS: tca6507 - fix bugs in parsing of device-tree configuration.

1/ The led_info array must be allocated to allow the full number
  of LEDs even if not all are present.  The array maybe be sparsely
  filled but it is indexed by device address so we must at least
  allocate as many slots as the highest address used.  It is easiest
  just to allocate all 7.

2/ range check the 'reg' value properly.

3/ led.flags must be initialised to zero, else all leds could
   be treated as GPIOs (depending on what happens to be on the stack).

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
drivers/leds/leds-tca6507.c