login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
November
»
28
Re: [RFC] Sample kset/ktype/kobject implementation
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Cornelia Huck <cornelia.huck@...>
To: Greg KH <greg@...>
Cc: <linux-kernel@...>, Kay Sievers <kay.sievers@...>, Alan Stern <stern@...>, Jonathan Corbet <corbet@...>, Randy Dunlap <randy.dunlap@...>
Subject:
Re: [RFC] Sample kset/ktype/kobject implementation
Date: Wednesday, November 28, 2007 - 12:35 pm
On Tue, 27 Nov 2007 15:04:06 -0800, Greg KH <greg@kroah.com> wrote:
quoted text
> 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); > if (!foo) > return NULL; > > /* initialize the kobject portion of the object properly */ > kobject_set_name(&foo->kobj, "%s", name);
Returncode not checked :)
quoted text
> 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 out. If we were to > * call kobject_init() and then kobject_add() we would be > * responsible for sending out the initial KOBJ_ADD uevent. > */ > retval = kobject_register(&foo->kobj); > if (retval) { > kfree(foo);
kobject_put(foo) is needed since it gets you through kobject_cleanup() where the name can be freed.
quoted text
> return NULL; > } > > return foo; > }
-
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[RFC] New kobject/kset/ktype documentation and example code
, Greg KH
, (Tue Nov 27, 7:02 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Alan Stern
, (Wed Nov 28, 3:03 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Greg KH
, (Thu Nov 29, 2:18 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Alan Stern
, (Thu Nov 29, 11:42 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Kay Sievers
, (Wed Nov 28, 3:28 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Alan Stern
, (Wed Nov 28, 3:36 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Kay Sievers
, (Wed Nov 28, 3:46 pm)
[PATCH] kobject: make sure kobj->ktype is set before kobj...
, Alan Stern
, (Wed Nov 28, 4:42 pm)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Greg KH
, (Wed Nov 28, 5:45 pm)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Alan Stern
, (Wed Nov 28, 6:00 pm)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Cornelia Huck
, (Thu Nov 29, 6:05 am)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Kay Sievers
, (Thu Nov 29, 6:59 am)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Alan Stern
, (Thu Nov 29, 11:54 am)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Kay Sievers
, (Thu Nov 29, 12:04 pm)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Alan Stern
, (Thu Nov 29, 1:06 pm)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Kay Sievers
, (Thu Nov 29, 1:17 pm)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Alan Stern
, (Thu Nov 29, 2:04 pm)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Kay Sievers
, (Thu Nov 29, 2:33 pm)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Alan Stern
, (Thu Nov 29, 3:05 pm)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Kay Sievers
, (Thu Nov 29, 3:51 pm)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Alan Stern
, (Thu Nov 29, 4:09 pm)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Kay Sievers
, (Thu Nov 29, 4:19 pm)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Kay Sievers
, (Thu Nov 29, 4:26 pm)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Cornelia Huck
, (Fri Nov 30, 5:30 am)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Cornelia Huck
, (Thu Nov 29, 12:21 pm)
kobject_init rewrite
, Greg KH
, (Thu Nov 29, 5:53 pm)
Re: kobject_init rewrite
, Alan Stern
, (Thu Nov 29, 6:16 pm)
Re: kobject_init rewrite
, Greg KH
, (Thu Nov 29, 6:24 pm)
Re: kobject_init rewrite
, Greg KH
, (Thu Nov 29, 5:54 pm)
Re: kobject_init rewrite
, Cornelia Huck
, (Fri Nov 30, 5:31 am)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Cornelia Huck
, (Thu Nov 29, 7:48 am)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Greg KH
, (Wed Nov 28, 6:38 pm)
Re: [PATCH] kobject: make sure kobj->ktype is set before ...
, Kay Sievers
, (Wed Nov 28, 4:52 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Cornelia Huck
, (Wed Nov 28, 7:45 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Greg KH
, (Thu Nov 29, 2:04 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Cornelia Huck
, (Thu Nov 29, 5:41 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Kay Sievers
, (Wed Nov 28, 8:23 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Greg KH
, (Thu Nov 29, 2:02 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Cornelia Huck
, (Wed Nov 28, 11:48 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Kay Sievers
, (Wed Nov 28, 11:57 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Cornelia Huck
, (Wed Nov 28, 12:12 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Kay Sievers
, (Wed Nov 28, 12:36 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Cornelia Huck
, (Wed Nov 28, 12:51 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Kay Sievers
, (Wed Nov 28, 1:00 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Greg KH
, (Thu Nov 29, 2:08 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Kay Sievers
, (Thu Nov 29, 3:50 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Cornelia Huck
, (Thu Nov 29, 5:35 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Kay Sievers
, (Thu Nov 29, 6:53 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Cornelia Huck
, (Wed Nov 28, 5:01 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Greg KH
, (Thu Nov 29, 1:59 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Alan Stern
, (Wed Nov 28, 3:18 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Cornelia Huck
, (Thu Nov 29, 6:12 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Alan Stern
, (Thu Nov 29, 11:47 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Cornelia Huck
, (Thu Nov 29, 12:28 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Alan Stern
, (Thu Nov 29, 12:55 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Cornelia Huck
, (Thu Nov 29, 1:52 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Kay Sievers
, (Wed Nov 28, 8:35 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Cornelia Huck
, (Wed Nov 28, 11:52 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Kay Sievers
, (Wed Nov 28, 12:03 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Cornelia Huck
, (Wed Nov 28, 12:09 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Greg KH
, (Wed Nov 28, 1:06 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Jonathan Corbet
, (Tue Nov 27, 11:50 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Greg KH
, (Thu Nov 29, 1:46 am)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Frans Pop
, (Tue Nov 27, 7:21 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Kyle McMartin
, (Tue Nov 27, 7:10 pm)
Re: [RFC] New kobject/kset/ktype documentation and example c...
, Greg KH
, (Tue Nov 27, 7:29 pm)
[RFC] Sample kset/ktype/kobject implementation
, Greg KH
, (Tue Nov 27, 7:04 pm)
Re: [RFC] Sample kset/ktype/kobject implementation
, Cornelia Huck
, (Wed Nov 28, 12:35 pm)
Re: [RFC] Sample kset/ktype/kobject implementation
, Greg KH
, (Thu Nov 29, 2:11 am)
Re: [RFC] Sample kset/ktype/kobject implementation
, Cornelia Huck
, (Thu Nov 29, 5:39 am)
Re: [RFC] Sample kset/ktype/kobject implementation
, Greg KH
, (Thu Nov 29, 4:39 pm)
Re: [RFC] Sample kset/ktype/kobject implementation
, Alan Stern
, (Thu Nov 29, 6:11 pm)
Re: [RFC] Sample kset/ktype/kobject implementation
, Greg KH
, (Fri Nov 30, 2:41 am)
Re: [RFC] Sample kset/ktype/kobject implementation
, Dave Young
, (Fri Nov 30, 1:07 am)
Re: [RFC] Sample kset/ktype/kobject implementation
, Alan Stern
, (Fri Nov 30, 10:51 am)
Re: [RFC] Sample kset/ktype/kobject implementation
, Dave Young
, (Fri Nov 30, 1:57 am)
[RFC] sample kobject implementation
, Greg KH
, (Tue Nov 27, 7:03 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
david
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Greg Kroah-Hartman
[PATCH 005/196] Chinese: add translation of SubmittingDrivers
Vladislav Bolkhovitin
Re: Integration of SCST in the mainstream Linux kernel
Jan Engelhardt
intel iommu (Re: -mm merge plans for 2.6.23)
git
:
openbsd-misc
:
linux-netdev
:
David Miller
[GIT]: Networking
David Miller
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
Natalie Protasevich
[BUG] New Kernel Bugs
Colocation donated by:
Who's online
There are currently
3 users
and
539 guests
online.
Online users
dogbehavior
drewsbonanza
paipailee32s
Syndicate