Skip to content

Commit

Permalink
Kobject: change drivers/parisc/pdc_stable.c to use kobject_init_and_add
Browse files Browse the repository at this point in the history
Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Kyle McMartin <kyle@parisc-linux.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Jan 25, 2008
1 parent 8dde2a9 commit 73f368c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/parisc/pdc_stable.c
Original file line number Diff line number Diff line change
Expand Up @@ -991,13 +991,12 @@ pdcs_register_pathentries(void)
if (err < 0)
continue;

if ((err = kobject_set_name(&entry->kobj, "%s", entry->name)))
return err;
entry->kobj.kset = paths_kset;
entry->kobj.ktype = &ktype_pdcspath;
if ((err = kobject_register(&entry->kobj)))
err = kobject_init_and_add(&entry->kobj, &ktype_pdcspath, NULL,
"%s", entry->name);
if (err)
return err;

/* kobject is now registered */
write_lock(&entry->rw_lock);
entry->ready = 2;
Expand All @@ -1009,6 +1008,7 @@ pdcs_register_pathentries(void)
}

write_unlock(&entry->rw_lock);
kobject_uevent(&entry->kobj, KOBJ_ADD);
}

return 0;
Expand Down

0 comments on commit 73f368c

Please sign in to comment.