Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 9334129e authored by NeilBrown's avatar NeilBrown Committed by Bryan Wu
Browse files

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: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarBryan Wu <cooloney@gmail.com>
parent 802eee95
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment