]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/kobject.h
Driver Core: add kobj_attribute handling
[linux-2.6-omap-h63xx.git] / include / linux / kobject.h
index 0b97b3a53917d2905ff2d6836a79f2151df74d07..e694261de90f09a985c99f9d0c0db44b3eebde93 100644 (file)
@@ -91,6 +91,10 @@ extern int __must_check kobject_init_and_add(struct kobject *kobj,
 
 extern void kobject_del(struct kobject *);
 
+extern struct kobject * __must_check kobject_create(void);
+extern struct kobject * __must_check kobject_create_and_add(const char *name,
+                                               struct kobject *parent);
+
 extern int __must_check kobject_rename(struct kobject *, const char *new_name);
 extern int __must_check kobject_move(struct kobject *, struct kobject *);
 
@@ -100,10 +104,6 @@ extern void kobject_unregister(struct kobject *);
 extern struct kobject * kobject_get(struct kobject *);
 extern void kobject_put(struct kobject *);
 
-extern struct kobject *kobject_kset_add_dir(struct kset *kset,
-                                           struct kobject *, const char *);
-extern struct kobject *kobject_add_dir(struct kobject *, const char *);
-
 extern char * kobject_get_path(struct kobject *, gfp_t);
 
 struct kobj_type {
@@ -126,6 +126,16 @@ struct kset_uevent_ops {
                      struct kobj_uevent_env *env);
 };
 
+struct kobj_attribute {
+       struct attribute attr;
+       ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr,
+                       char *buf);
+       ssize_t (*store)(struct kobject *kobj, struct kobj_attribute *attr,
+                        const char *buf, size_t count);
+};
+
+extern struct sysfs_ops kobj_sysfs_ops;
+
 /**
  * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem.
  *
@@ -150,11 +160,13 @@ struct kset {
        struct kset_uevent_ops  *uevent_ops;
 };
 
-
 extern void kset_init(struct kset * k);
 extern int __must_check kset_add(struct kset * k);
 extern int __must_check kset_register(struct kset * k);
 extern void kset_unregister(struct kset * k);
+extern struct kset * __must_check kset_create_and_add(const char *name,
+                                               struct kset_uevent_ops *u,
+                                               struct kobject *parent_kobj);
 
 static inline struct kset * to_kset(struct kobject * kobj)
 {
@@ -191,16 +203,13 @@ struct kset _name##_subsys = { \
        .kobj = { .k_name = __stringify(_name) }, \
        .uevent_ops =_uevent_ops, \
 }
-#define decl_subsys_name(_varname,_name,_uevent_ops) \
-struct kset _varname##_subsys = { \
-       .kobj = { .k_name = __stringify(_name) }, \
-       .uevent_ops =_uevent_ops, \
-}
 
-/* The global /sys/kernel/ subsystem for people to chain off of */
-extern struct kset kernel_subsys;
-/* The global /sys/hypervisor/ subsystem  */
-extern struct kset hypervisor_subsys;
+/* The global /sys/kernel/ kset for people to chain off of */
+extern struct kset *kernel_kset;
+/* The global /sys/hypervisor/ kobject for people to chain off of */
+extern struct kobject *hypervisor_kobj;
+/* The global /sys/power/ kset for people to chain off of */
+extern struct kset *power_kset;
 
 extern int __must_check subsystem_register(struct kset *);
 extern void subsystem_unregister(struct kset *);