summaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-mc13783.c
diff options
context:
space:
mode:
authorAlexander Kurz <akurz@blala.de>2016-10-09 15:37:47 +0200
committerJacek Anaszewski <j.anaszewski@samsung.com>2016-11-22 12:07:03 +0100
commitcce35f357fb4d3269dc401ee8af257d63faea8c4 (patch)
tree8801ceb80919d69cff861f1b085b5078102375a9 /drivers/leds/leds-mc13783.c
parentledtrig-cpu.c: fix english (diff)
downloadlinux-cce35f357fb4d3269dc401ee8af257d63faea8c4.tar.xz
linux-cce35f357fb4d3269dc401ee8af257d63faea8c4.zip
leds: mc13783: Fix MC13892 keypad led access
Fix the register access shift argument calculation introduced with commit a59ce6584d56 ("leds: leds-mc13783: Add MC34708 LED support") and re-enable access to the "keypad" led for MC13892 MFC devices. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Diffstat (limited to 'drivers/leds/leds-mc13783.c')
-rw-r--r--drivers/leds/leds-mc13783.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c
index a2e4c1792e17..2421cf104991 100644
--- a/drivers/leds/leds-mc13783.c
+++ b/drivers/leds/leds-mc13783.c
@@ -84,8 +84,9 @@ static int mc13xxx_led_set(struct led_classdev *led_cdev,
case MC13892_LED_MD:
case MC13892_LED_AD:
case MC13892_LED_KP:
- reg = (led->id - MC13892_LED_MD) / 2;
- shift = 3 + (led->id - MC13892_LED_MD) * 12;
+ off = led->id - MC13892_LED_MD;
+ reg = off / 2;
+ shift = 3 + (off - reg * 2) * 12;
break;
case MC13892_LED_R:
case MC13892_LED_G: