leds: mt6323: Fix an off by one bug in probe
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 23 Mar 2017 10:40:49 +0000 (13:40 +0300)
committerJacek Anaszewski <jacek.anaszewski@gmail.com>
Thu, 23 Mar 2017 19:23:57 +0000 (20:23 +0100)
commitac572452156963588b285049ba3895bef0f17642
treea0ab376253436ceb24dfd188a0c87c09303fbc54
parent6234004ce46a87d34106f9b738365f25dc224668
leds: mt6323: Fix an off by one bug in probe

It should be ">= MT6323_MAX_LEDS" instead of ">".  Also "reg" is a u32
so it can't be negative and we can remove the test for negative values.

Fixes: 216ec6cc4c19 ("leds: Add LED support for MT6323 PMIC")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
drivers/leds/leds-mt6323.c