• NeilBrown's avatar
    LEDS: tca6507 - fix bugs in parsing of device-tree configuration. · 9334129e
    NeilBrown authored
    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>
    9334129e
leds-tca6507.c 21.2 KB