aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/sys.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-07-25 22:45:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 15:00:07 -0400
commitf810a5cf28a818db96333cd23646f0227ec015b4 (patch)
tree671eb15b7557d7cc68ebfb30df73ef666638bdcf /drivers/base/sys.c
parent12e0036818eed243c8ed6583ebf98261a2554e12 (diff)
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)
168 int err = 0; 168 int err = 0;
169 169
170 if (!cls) { 170 if (!cls) {
171 printk(KERN_WARNING "sysdev: invalid class passed to " 171 WARN(1, KERN_WARNING "sysdev: invalid class passed to "
172 "sysdev_driver_register!\n"); 172 "sysdev_driver_register!\n");
173 WARN_ON(1);
174 return -EINVAL; 173 return -EINVAL;
175 } 174 }
176 175
177 /* Check whether this driver has already been added to a class. */ 176 /* Check whether this driver has already been added to a class. */
178 if (drv->entry.next && !list_empty(&drv->entry)) { 177 if (drv->entry.next && !list_empty(&drv->entry))
179 printk(KERN_WARNING "sysdev: class %s: driver (%p) has already" 178 WARN(1, KERN_WARNING "sysdev: class %s: driver (%p) has already"
180 " been registered to a class, something is wrong, but " 179 " been registered to a class, something is wrong, but "
181 "will forge on!\n", cls->name, drv); 180 "will forge on!\n", cls->name, drv);
182 WARN_ON(1);
183 }
184 181
185 mutex_lock(&sysdev_drivers_lock); 182 mutex_lock(&sysdev_drivers_lock);
186 if (cls && kset_get(&cls->kset)) { 183 if (cls && kset_get(&cls->kset)) {
@@ -194,8 +191,7 @@ int sysdev_driver_register(struct sysdev_class *cls, struct sysdev_driver *drv)
194 } 191 }
195 } else { 192 } else {
196 err = -EINVAL; 193 err = -EINVAL;
197 printk(KERN_ERR "%s: invalid device class\n", __func__); 194 WARN(1, KERN_ERR "%s: invalid device class\n", __func__);
198 WARN_ON(1);
199 } 195 }
200 mutex_unlock(&sysdev_drivers_lock); 196 mutex_unlock(&sysdev_drivers_lock);
201 return err; 197 return err;