aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/sys.c
diff options
context:
space:
mode:
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;