Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'led_fixes_for_4.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds

Pull LED fixes from Jacek Anaszewski:
"Two LED fixes:

- fix signal source assignment for leds-bcm6328

- revert patch that intended to fix LED behavior on suspend but it
had a side effect preventing suspend at all due to uevent being
sent on trigger removal"

* tag 'led_fixes_for_4.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
Revert "leds: handle suspend/resume in heartbeat trigger"
leds: bcm6328: fix signal source assignment for leds 4 to 7

+2 -33
+2 -2
drivers/leds/leds-bcm6328.c
··· 242 242 243 243 spin_lock_irqsave(lock, flags); 244 244 val = bcm6328_led_read(addr); 245 - val |= (BIT(reg) << (((sel % 4) * 4) + 16)); 245 + val |= (BIT(reg % 4) << (((sel % 4) * 4) + 16)); 246 246 bcm6328_led_write(addr, val); 247 247 spin_unlock_irqrestore(lock, flags); 248 248 } ··· 269 269 270 270 spin_lock_irqsave(lock, flags); 271 271 val = bcm6328_led_read(addr); 272 - val |= (BIT(reg) << ((sel % 4) * 4)); 272 + val |= (BIT(reg % 4) << ((sel % 4) * 4)); 273 273 bcm6328_led_write(addr, val); 274 274 spin_unlock_irqrestore(lock, flags); 275 275 }
-31
drivers/leds/trigger/ledtrig-heartbeat.c
··· 20 20 #include <linux/sched/loadavg.h> 21 21 #include <linux/leds.h> 22 22 #include <linux/reboot.h> 23 - #include <linux/suspend.h> 24 23 #include "../leds.h" 25 24 26 25 static int panic_heartbeats; ··· 162 163 .deactivate = heartbeat_trig_deactivate, 163 164 }; 164 165 165 - static int heartbeat_pm_notifier(struct notifier_block *nb, 166 - unsigned long pm_event, void *unused) 167 - { 168 - int rc; 169 - 170 - switch (pm_event) { 171 - case PM_SUSPEND_PREPARE: 172 - case PM_HIBERNATION_PREPARE: 173 - case PM_RESTORE_PREPARE: 174 - led_trigger_unregister(&heartbeat_led_trigger); 175 - break; 176 - case PM_POST_SUSPEND: 177 - case PM_POST_HIBERNATION: 178 - case PM_POST_RESTORE: 179 - rc = led_trigger_register(&heartbeat_led_trigger); 180 - if (rc) 181 - pr_err("could not re-register heartbeat trigger\n"); 182 - break; 183 - default: 184 - break; 185 - } 186 - return NOTIFY_DONE; 187 - } 188 - 189 166 static int heartbeat_reboot_notifier(struct notifier_block *nb, 190 167 unsigned long code, void *unused) 191 168 { ··· 175 200 panic_heartbeats = 1; 176 201 return NOTIFY_DONE; 177 202 } 178 - 179 - static struct notifier_block heartbeat_pm_nb = { 180 - .notifier_call = heartbeat_pm_notifier, 181 - }; 182 203 183 204 static struct notifier_block heartbeat_reboot_nb = { 184 205 .notifier_call = heartbeat_reboot_notifier, ··· 192 221 atomic_notifier_chain_register(&panic_notifier_list, 193 222 &heartbeat_panic_nb); 194 223 register_reboot_notifier(&heartbeat_reboot_nb); 195 - register_pm_notifier(&heartbeat_pm_nb); 196 224 } 197 225 return rc; 198 226 } 199 227 200 228 static void __exit heartbeat_trig_exit(void) 201 229 { 202 - unregister_pm_notifier(&heartbeat_pm_nb); 203 230 unregister_reboot_notifier(&heartbeat_reboot_nb); 204 231 atomic_notifier_chain_unregister(&panic_notifier_list, 205 232 &heartbeat_panic_nb);