On Wed, 19 Dec 2007 16:31:35 -0800,
Greg KH <[EMAIL PROTECTED]> wrote:
> /*
>* Initialize and add the kobject to the kernel. All the default files
>* will be created here. As we have already specified a kset for this
>* kobject, we don't have to set a parent for the
/*
* Sample kset and ktype implementation
*
* Copyright (C) 2004-2007 Greg Kroah-Hartman <[EMAIL PROTECTED]>
* Copyright (C) 2007 Novell Inc.
*
* Released under the GPL version 2 only.
*
*/
#include
#include
#include
#include
#include
/*
* This module shows how to create a kset in sy
On Fri, 30 Nov 2007, Dave Young wrote:
> > The rule is simple enough. After calling kobject_register() you should
> > always use kobject_put() -- even if kobject_register() failed.
> >
> > In fact, after calling kobject_init() you should use kobject_put().
> > The first rule follows from this one
On Thu, Nov 29, 2007 at 05:11:35PM -0500, Alan Stern wrote:
> On Thu, 29 Nov 2007, Greg KH wrote:
>
> > > > > kobject_put(foo) is needed since it gets you through kobject_cleanup()
> > > > > where the name can be freed.
> > > >
> > > > No, kobject_register() should have handled that for us, right
On Fri, Nov 30, 2007 at 01:07:37PM +0800, Dave Young wrote:
> On Nov 30, 2007 6:11 AM, Alan Stern <[EMAIL PROTECTED]> wrote:
> > On Thu, 29 Nov 2007, Greg KH wrote:
> >
> > > > > > kobject_put(foo) is needed since it gets you through
> > > > > > kobject_cleanup()
> > > > > > where the name can be
On Nov 30, 2007 6:11 AM, Alan Stern <[EMAIL PROTECTED]> wrote:
> On Thu, 29 Nov 2007, Greg KH wrote:
>
> > > > > kobject_put(foo) is needed since it gets you through kobject_cleanup()
> > > > > where the name can be freed.
> > > >
> > > > No, kobject_register() should have handled that for us, righ
On Thu, 29 Nov 2007, Greg KH wrote:
> > > > kobject_put(foo) is needed since it gets you through kobject_cleanup()
> > > > where the name can be freed.
> > >
> > > No, kobject_register() should have handled that for us, right?
> >
> > kobject_register() doesn't do a kobject_put() if kobject_add(
On Thu, Nov 29, 2007 at 10:39:07AM +0100, Cornelia Huck wrote:
> On Wed, 28 Nov 2007 22:11:39 -0800,
> Greg KH <[EMAIL PROTECTED]> wrote:
>
> > > > foo->kobj.kset = example_kset;
> > > > foo->kobj.ktype = &foo_ktype;
> > > >
> > > > /*
> > > > * Register the kobje
On Wed, 28 Nov 2007 22:11:39 -0800,
Greg KH <[EMAIL PROTECTED]> wrote:
> > > foo->kobj.kset = example_kset;
> > > foo->kobj.ktype = &foo_ktype;
> > >
> > > /*
> > >* Register the kobject with the kernel, all the default files will
> > >* be created here and the uevent will be sent o
On Wed, Nov 28, 2007 at 05:35:32PM +0100, Cornelia Huck wrote:
> On Tue, 27 Nov 2007 15:04:06 -0800,
> Greg KH <[EMAIL PROTECTED]> wrote:
>
> > static struct foo_obj *create_foo_obj(const char *name)
> > {
> > struct foo_obj *foo;
> > int retval;
> >
> > /* allocate the memory for the
On Tue, 27 Nov 2007 15:04:06 -0800,
Greg KH <[EMAIL PROTECTED]> wrote:
> static struct foo_obj *create_foo_obj(const char *name)
> {
> struct foo_obj *foo;
> int retval;
>
> /* allocate the memory for the whole object */
> foo = kzalloc(sizeof(*foo), GFP_KERNEL);
> i
/*
* Sample kset and ktype implementation
*
* Copyright (C) 2004-2007 Greg Kroah-Hartman <[EMAIL PROTECTED]>
* Copyright (C) 2007 Novell Inc.
*
* Released under the GPL version 2 only.
*
*/
#include
#include
#include
#include
#include
/*
* This module shows how to create a kset in sy
12 matches
Mail list logo