]> 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)
commit1f6f1c4e31e7b11e3fc7a1874a3096be2ca03e53
tree2fb3451c09c97fde621ab6af0b7654502edfc973
parent82efeea4b22a7d1b1846300f056938d7e42bdcd2
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