aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/led-triggers.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
index 129733f2379b..b2438a03082b 100644
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -183,13 +183,20 @@ int led_trigger_register(struct led_trigger *trigger)
183void led_trigger_register_simple(const char *name, struct led_trigger **tp) 183void led_trigger_register_simple(const char *name, struct led_trigger **tp)
184{ 184{
185 struct led_trigger *trigger; 185 struct led_trigger *trigger;
186 int err;
186 187
187 trigger = kzalloc(sizeof(struct led_trigger), GFP_KERNEL); 188 trigger = kzalloc(sizeof(struct led_trigger), GFP_KERNEL);
188 189
189 if (trigger) { 190 if (trigger) {
190 trigger->name = name; 191 trigger->name = name;
191 led_trigger_register(trigger); 192 err = led_trigger_register(trigger);
192 } 193 if (err < 0)
194 printk(KERN_WARNING "LED trigger %s failed to register"
195 " (%d)\n", name, err);
196 } else
197 printk(KERN_WARNING "LED trigger %s failed to register"
198 " (no memory)\n", name);
199
193 *tp = trigger; 200 *tp = trigger;
194} 201}
195 202