Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91395
b: refs/heads/master
c: da009f3
h: refs/heads/master
i:
  91393: 68aa866
  91391: 168191d
v: v3
  • Loading branch information
Ben Dooks authored and Greg Kroah-Hartman committed Apr 20, 2008
1 parent 103c9a6 commit b311ffa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6c847402e1c69c1cfe2bddeadc8391bacbb3d0a5
refs/heads/master: da009f39f85a3ee9deeb10f0f05ddd4efdd67020
16 changes: 16 additions & 0 deletions trunk/drivers/base/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,22 @@ 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 "
"sysdev_driver_register!\n");
WARN_ON(1);
return -EINVAL;
}

/* Check whether this driver has already been added to a class. */
if ((drv->entry.next != drv->entry.prev) ||
(drv->entry.next != NULL)) {
printk(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)) {
list_add_tail(&drv->entry, &cls->drivers);
Expand Down

0 comments on commit b311ffa

Please sign in to comment.