diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-09-10 03:09:51 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-10 03:09:51 -0400 |
commit | 6003ab0bad4cc56f3c4fadf62a0d23a967b9c53b (patch) | |
tree | 2087ca69776116b70a6af0daae9c10bfac1aa347 /drivers/base/class.c | |
parent | ab7476cf76e560f0efda2a631a70aabe93009025 (diff) | |
parent | adee14b2e1557d0a8559f29681732d05a89dfc35 (diff) |
Merge branch 'linus' into core/debug
Conflicts:
lib/vsprintf.c
Manual merge:
include/linux/kernel.h
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/base/class.c')
-rw-r--r-- | drivers/base/class.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c index 5667c2f02c51..cc5e28c8885c 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -295,6 +295,12 @@ int class_for_each_device(struct class *class, struct device *start, | |||
295 | 295 | ||
296 | if (!class) | 296 | if (!class) |
297 | return -EINVAL; | 297 | return -EINVAL; |
298 | if (!class->p) { | ||
299 | WARN(1, "%s called for class '%s' before it was initialized", | ||
300 | __func__, class->name); | ||
301 | return -EINVAL; | ||
302 | } | ||
303 | |||
298 | mutex_lock(&class->p->class_mutex); | 304 | mutex_lock(&class->p->class_mutex); |
299 | list_for_each_entry(dev, &class->p->class_devices, node) { | 305 | list_for_each_entry(dev, &class->p->class_devices, node) { |
300 | if (start) { | 306 | if (start) { |
@@ -344,6 +350,11 @@ struct device *class_find_device(struct class *class, struct device *start, | |||
344 | 350 | ||
345 | if (!class) | 351 | if (!class) |
346 | return NULL; | 352 | return NULL; |
353 | if (!class->p) { | ||
354 | WARN(1, "%s called for class '%s' before it was initialized", | ||
355 | __func__, class->name); | ||
356 | return NULL; | ||
357 | } | ||
347 | 358 | ||
348 | mutex_lock(&class->p->class_mutex); | 359 | mutex_lock(&class->p->class_mutex); |
349 | list_for_each_entry(dev, &class->p->class_devices, node) { | 360 | list_for_each_entry(dev, &class->p->class_devices, node) { |