Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187051
b: refs/heads/master
c: 38457ab
h: refs/heads/master
i:
  187049: 4d92c56
  187047: 492a6a1
v: v3
  • Loading branch information
Andi Kleen authored and Greg Kroah-Hartman committed Mar 8, 2010
1 parent 5540eff commit 1167a86
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1c205ae18db53ff72985dd79f3baaf2dbaba6db7
refs/heads/master: 38457ab3a0d36320370c715145ba6da514127194
9 changes: 8 additions & 1 deletion trunk/drivers/base/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,20 @@ int sysdev_class_register(struct sysdev_class *cls)
if (retval)
return retval;

return kset_register(&cls->kset);
retval = kset_register(&cls->kset);
if (!retval && cls->attrs)
retval = sysfs_create_files(&cls->kset.kobj,
(const struct attribute **)cls->attrs);
return retval;
}

void sysdev_class_unregister(struct sysdev_class *cls)
{
pr_debug("Unregistering sysdev class '%s'\n",
kobject_name(&cls->kset.kobj));
if (cls->attrs)
sysfs_remove_files(&cls->kset.kobj,
(const struct attribute **)cls->attrs);
kset_unregister(&cls->kset);
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/sysdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@


struct sys_device;
struct sysdev_class_attribute;

struct sysdev_class {
const char *name;
struct list_head drivers;
struct sysdev_class_attribute **attrs;

/* Default operations for these types of devices */
int (*shutdown)(struct sys_device *);
Expand Down

0 comments on commit 1167a86

Please sign in to comment.