Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333073
b: refs/heads/master
c: 52c4774
h: refs/heads/master
i:
  333071: 8de708c
v: v3
  • Loading branch information
Colin Cross authored and Bryan Wu committed Sep 11, 2012
1 parent e7e0fd9 commit 22efa2e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 469eba023087d8fa3974827e6bedf874a620d0e7
refs/heads/master: 52c47742f79d9240f90af9a6722fe8bb3fa8c0f9
13 changes: 13 additions & 0 deletions trunk/drivers/leds/led-triggers.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ EXPORT_SYMBOL_GPL(led_trigger_show);
void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trig)
{
unsigned long flags;
char *event = NULL;
char *envp[2];
const char *name;

name = trig ? trig->name : "none";
event = kasprintf(GFP_KERNEL, "TRIGGER=%s", name);

/* Remove any existing trigger */
if (led_cdev->trigger) {
Expand All @@ -124,6 +130,13 @@ void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trig)
if (trig->activate)
trig->activate(led_cdev);
}

if (event) {
envp[0] = event;
envp[1] = NULL;
kobject_uevent_env(&led_cdev->dev->kobj, KOBJ_CHANGE, envp);
kfree(event);
}
}
EXPORT_SYMBOL_GPL(led_trigger_set);

Expand Down

0 comments on commit 22efa2e

Please sign in to comment.