summaryrefslogtreecommitdiffstats
path: root/drivers/base/sys.c
diff options
context:
space:
mode:
authorArjan van de Ven2008-07-26 04:45:39 +0200
committerLinus Torvalds2008-07-26 21:00:07 +0200
commitf810a5cf28a818db96333cd23646f0227ec015b4 (patch)
tree671eb15b7557d7cc68ebfb30df73ef666638bdcf /drivers/base/sys.c
parentUse WARN() in block/ (diff)
downloadkernel-qcow2-linux-f810a5cf28a818db96333cd23646f0227ec015b4.tar.gz
kernel-qcow2-linux-f810a5cf28a818db96333cd23646f0227ec015b4.tar.xz
kernel-qcow2-linux-f810a5cf28a818db96333cd23646f0227ec015b4.zip
Use WARN() in drivers/base/
Use WARN() instead of a printk+WARN_ON() pair; this way the message becomes part of the warning section for better reporting/collection. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Cc: Greg KH <greg@kroah.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/base/sys.c')
-rw-r--r--drivers/base/sys.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 40fc14f03540..75dd6e22faff 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -168,19 +168,16 @@ int sysdev_driver_register(struct sysdev_class *cls, struct sysdev_driver *drv)
int err = 0;
if (!cls) {
- printk(KERN_WARNING "sysdev: invalid class passed to "
+ WARN(1, KERN_WARNING "sysdev: invalid class passed to "
"sysdev_driver_register!\n");
- WARN_ON(1);
return -EINVAL;
}
/* Check whether this driver has already been added to a class. */
- if (drv->entry.next && !list_empty(&drv->entry)) {
- printk(KERN_WARNING "sysdev: class %s: driver (%p) has already"
+ if (drv->entry.next && !list_empty(&drv->entry))
+ WARN(1, KERN_WARNING "sysdev: class %s: driver (%p) has already"
" been registered to a class, something is wrong, but "
"will forge on!\n", cls->name, drv);
- WARN_ON(1);
- }
mutex_lock(&sysdev_drivers_lock);
if (cls && kset_get(&cls->kset)) {
@@ -194,8 +191,7 @@ int sysdev_driver_register(struct sysdev_class *cls, struct sysdev_driver *drv)
}
} else {
err = -EINVAL;
- printk(KERN_ERR "%s: invalid device class\n", __func__);
- WARN_ON(1);
+ WARN(1, KERN_ERR "%s: invalid device class\n", __func__);
}
mutex_unlock(&sysdev_drivers_lock);
return err;