Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 59093
b: refs/heads/master
c: 80f03e3
h: refs/heads/master
i:
  59091: e665a44
v: v3
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Jul 11, 2007
1 parent ddfeb5b commit f1dff71
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 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: 4f5c791a850e5305a5b1b48d0e4b4de248dc96f9
refs/heads/master: 80f03e349f06a261a8e980bf6005c61811a0d66a
16 changes: 14 additions & 2 deletions trunk/drivers/base/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,24 @@ void bus_remove_file(struct bus_type * bus, struct bus_attribute * attr)
}
}

static struct kobj_type ktype_bus = {
static struct kobj_type bus_ktype = {
.sysfs_ops = &bus_sysfs_ops,
};

static int bus_uevent_filter(struct kset *kset, struct kobject *kobj)
{
struct kobj_type *ktype = get_ktype(kobj);

if (ktype == &bus_ktype)
return 1;
return 0;
}

static struct kset_uevent_ops bus_uevent_ops = {
.filter = bus_uevent_filter,
};

static decl_subsys(bus, &ktype_bus, NULL);
static decl_subsys(bus, &bus_ktype, &bus_uevent_ops);


#ifdef CONFIG_HOTPLUG
Expand Down
9 changes: 8 additions & 1 deletion trunk/lib/kobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,17 @@ int kset_add(struct kset * k)

int kset_register(struct kset * k)
{
int err;

if (!k)
return -EINVAL;

kset_init(k);
return kset_add(k);
err = kset_add(k);
if (err)
return err;
kobject_uevent(&k->kobj, KOBJ_ADD);
return 0;
}


Expand Down

0 comments on commit f1dff71

Please sign in to comment.