diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-powerpc/of_device.h | 2 | ||||
-rw-r--r-- | include/linux/debugfs.h | 27 | ||||
-rw-r--r-- | include/linux/device.h | 17 | ||||
-rw-r--r-- | include/linux/kobject.h | 125 | ||||
-rw-r--r-- | include/linux/platform_device.h | 7 | ||||
-rw-r--r-- | include/linux/sysfs.h | 147 | ||||
-rw-r--r-- | include/linux/tty.h | 1 | ||||
-rw-r--r-- | include/linux/video_output.h | 4 |
8 files changed, 139 insertions, 191 deletions
diff --git a/include/asm-powerpc/of_device.h b/include/asm-powerpc/of_device.h index ec2a8a2c737c..93262f2546ad 100644 --- a/include/asm-powerpc/of_device.h +++ b/include/asm-powerpc/of_device.h | |||
@@ -20,7 +20,7 @@ struct of_device | |||
20 | extern ssize_t of_device_get_modalias(struct of_device *ofdev, | 20 | extern ssize_t of_device_get_modalias(struct of_device *ofdev, |
21 | char *str, ssize_t len); | 21 | char *str, ssize_t len); |
22 | extern int of_device_uevent(struct device *dev, | 22 | extern int of_device_uevent(struct device *dev, |
23 | char **envp, int num_envp, char *buffer, int buffer_size); | 23 | struct kobj_uevent_env *env); |
24 | 24 | ||
25 | /* This is just here during the transition */ | 25 | /* This is just here during the transition */ |
26 | #include <linux/of_device.h> | 26 | #include <linux/of_device.h> |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 104e51e20e14..f592d6de3b97 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -49,6 +49,12 @@ struct dentry *debugfs_create_u32(const char *name, mode_t mode, | |||
49 | struct dentry *parent, u32 *value); | 49 | struct dentry *parent, u32 *value); |
50 | struct dentry *debugfs_create_u64(const char *name, mode_t mode, | 50 | struct dentry *debugfs_create_u64(const char *name, mode_t mode, |
51 | struct dentry *parent, u64 *value); | 51 | struct dentry *parent, u64 *value); |
52 | struct dentry *debugfs_create_x8(const char *name, mode_t mode, | ||
53 | struct dentry *parent, u8 *value); | ||
54 | struct dentry *debugfs_create_x16(const char *name, mode_t mode, | ||
55 | struct dentry *parent, u16 *value); | ||
56 | struct dentry *debugfs_create_x32(const char *name, mode_t mode, | ||
57 | struct dentry *parent, u32 *value); | ||
52 | struct dentry *debugfs_create_bool(const char *name, mode_t mode, | 58 | struct dentry *debugfs_create_bool(const char *name, mode_t mode, |
53 | struct dentry *parent, u32 *value); | 59 | struct dentry *parent, u32 *value); |
54 | 60 | ||
@@ -122,6 +128,27 @@ static inline struct dentry *debugfs_create_u64(const char *name, mode_t mode, | |||
122 | return ERR_PTR(-ENODEV); | 128 | return ERR_PTR(-ENODEV); |
123 | } | 129 | } |
124 | 130 | ||
131 | static inline struct dentry *debugfs_create_x8(const char *name, mode_t mode, | ||
132 | struct dentry *parent, | ||
133 | u8 *value) | ||
134 | { | ||
135 | return ERR_PTR(-ENODEV); | ||
136 | } | ||
137 | |||
138 | static inline struct dentry *debugfs_create_x16(const char *name, mode_t mode, | ||
139 | struct dentry *parent, | ||
140 | u16 *value) | ||
141 | { | ||
142 | return ERR_PTR(-ENODEV); | ||
143 | } | ||
144 | |||
145 | static inline struct dentry *debugfs_create_x32(const char *name, mode_t mode, | ||
146 | struct dentry *parent, | ||
147 | u32 *value) | ||
148 | { | ||
149 | return ERR_PTR(-ENODEV); | ||
150 | } | ||
151 | |||
125 | static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, | 152 | static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, |
126 | struct dentry *parent, | 153 | struct dentry *parent, |
127 | u32 *value) | 154 | u32 *value) |
diff --git a/include/linux/device.h b/include/linux/device.h index 3a38d1f70cb7..2e15822fe409 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -64,12 +64,9 @@ struct bus_type { | |||
64 | struct bus_attribute * bus_attrs; | 64 | struct bus_attribute * bus_attrs; |
65 | struct device_attribute * dev_attrs; | 65 | struct device_attribute * dev_attrs; |
66 | struct driver_attribute * drv_attrs; | 66 | struct driver_attribute * drv_attrs; |
67 | struct bus_attribute drivers_autoprobe_attr; | ||
68 | struct bus_attribute drivers_probe_attr; | ||
69 | 67 | ||
70 | int (*match)(struct device * dev, struct device_driver * drv); | 68 | int (*match)(struct device * dev, struct device_driver * drv); |
71 | int (*uevent)(struct device *dev, char **envp, | 69 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); |
72 | int num_envp, char *buffer, int buffer_size); | ||
73 | int (*probe)(struct device * dev); | 70 | int (*probe)(struct device * dev); |
74 | int (*remove)(struct device * dev); | 71 | int (*remove)(struct device * dev); |
75 | void (*shutdown)(struct device * dev); | 72 | void (*shutdown)(struct device * dev); |
@@ -189,10 +186,8 @@ struct class { | |||
189 | struct class_device_attribute * class_dev_attrs; | 186 | struct class_device_attribute * class_dev_attrs; |
190 | struct device_attribute * dev_attrs; | 187 | struct device_attribute * dev_attrs; |
191 | 188 | ||
192 | int (*uevent)(struct class_device *dev, char **envp, | 189 | int (*uevent)(struct class_device *dev, struct kobj_uevent_env *env); |
193 | int num_envp, char *buffer, int buffer_size); | 190 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); |
194 | int (*dev_uevent)(struct device *dev, char **envp, int num_envp, | ||
195 | char *buffer, int buffer_size); | ||
196 | 191 | ||
197 | void (*release)(struct class_device *dev); | 192 | void (*release)(struct class_device *dev); |
198 | void (*class_release)(struct class *class); | 193 | void (*class_release)(struct class *class); |
@@ -268,8 +263,7 @@ struct class_device { | |||
268 | struct attribute_group ** groups; /* optional groups */ | 263 | struct attribute_group ** groups; /* optional groups */ |
269 | 264 | ||
270 | void (*release)(struct class_device *dev); | 265 | void (*release)(struct class_device *dev); |
271 | int (*uevent)(struct class_device *dev, char **envp, | 266 | int (*uevent)(struct class_device *dev, struct kobj_uevent_env *env); |
272 | int num_envp, char *buffer, int buffer_size); | ||
273 | char class_id[BUS_ID_SIZE]; /* unique to this class */ | 267 | char class_id[BUS_ID_SIZE]; /* unique to this class */ |
274 | }; | 268 | }; |
275 | 269 | ||
@@ -337,8 +331,7 @@ extern void class_device_destroy(struct class *cls, dev_t devt); | |||
337 | struct device_type { | 331 | struct device_type { |
338 | const char *name; | 332 | const char *name; |
339 | struct attribute_group **groups; | 333 | struct attribute_group **groups; |
340 | int (*uevent)(struct device *dev, char **envp, int num_envp, | 334 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); |
341 | char *buffer, int buffer_size); | ||
342 | void (*release)(struct device *dev); | 335 | void (*release)(struct device *dev); |
343 | int (*suspend)(struct device * dev, pm_message_t state); | 336 | int (*suspend)(struct device * dev, pm_message_t state); |
344 | int (*resume)(struct device * dev); | 337 | int (*resume)(struct device * dev); |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 949706c33622..4a0d27f475d7 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -1,8 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * kobject.h - generic kernel object infrastructure. | 2 | * kobject.h - generic kernel object infrastructure. |
3 | * | 3 | * |
4 | * Copyright (c) 2002-2003 Patrick Mochel | 4 | * Copyright (c) 2002-2003 Patrick Mochel |
5 | * Copyright (c) 2002-2003 Open Source Development Labs | 5 | * Copyright (c) 2002-2003 Open Source Development Labs |
6 | * Copyright (c) 2006-2007 Greg Kroah-Hartman <greg@kroah.com> | ||
7 | * Copyright (c) 2006-2007 Novell Inc. | ||
6 | * | 8 | * |
7 | * This file is released under the GPLv2. | 9 | * This file is released under the GPLv2. |
8 | * | 10 | * |
@@ -29,6 +31,8 @@ | |||
29 | 31 | ||
30 | #define KOBJ_NAME_LEN 20 | 32 | #define KOBJ_NAME_LEN 20 |
31 | #define UEVENT_HELPER_PATH_LEN 256 | 33 | #define UEVENT_HELPER_PATH_LEN 256 |
34 | #define UEVENT_NUM_ENVP 32 /* number of env pointers */ | ||
35 | #define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */ | ||
32 | 36 | ||
33 | /* path to the userspace helper executed on an event */ | 37 | /* path to the userspace helper executed on an event */ |
34 | extern char uevent_helper[]; | 38 | extern char uevent_helper[]; |
@@ -56,19 +60,14 @@ enum kobject_action { | |||
56 | KOBJ_MAX | 60 | KOBJ_MAX |
57 | }; | 61 | }; |
58 | 62 | ||
59 | /* The list of strings defining the valid kobject actions as specified above */ | ||
60 | extern const char *kobject_actions[]; | ||
61 | |||
62 | struct kobject { | 63 | struct kobject { |
63 | const char * k_name; | 64 | const char * k_name; |
64 | char name[KOBJ_NAME_LEN]; | ||
65 | struct kref kref; | 65 | struct kref kref; |
66 | struct list_head entry; | 66 | struct list_head entry; |
67 | struct kobject * parent; | 67 | struct kobject * parent; |
68 | struct kset * kset; | 68 | struct kset * kset; |
69 | struct kobj_type * ktype; | 69 | struct kobj_type * ktype; |
70 | struct sysfs_dirent * sd; | 70 | struct sysfs_dirent * sd; |
71 | wait_queue_head_t poll; | ||
72 | }; | 71 | }; |
73 | 72 | ||
74 | extern int kobject_set_name(struct kobject *, const char *, ...) | 73 | extern int kobject_set_name(struct kobject *, const char *, ...) |
@@ -83,14 +82,9 @@ extern void kobject_init(struct kobject *); | |||
83 | extern void kobject_cleanup(struct kobject *); | 82 | extern void kobject_cleanup(struct kobject *); |
84 | 83 | ||
85 | extern int __must_check kobject_add(struct kobject *); | 84 | extern int __must_check kobject_add(struct kobject *); |
86 | extern int __must_check kobject_shadow_add(struct kobject *kobj, | ||
87 | struct sysfs_dirent *shadow_parent); | ||
88 | extern void kobject_del(struct kobject *); | 85 | extern void kobject_del(struct kobject *); |
89 | 86 | ||
90 | extern int __must_check kobject_rename(struct kobject *, const char *new_name); | 87 | extern int __must_check kobject_rename(struct kobject *, const char *new_name); |
91 | extern int __must_check kobject_shadow_rename(struct kobject *kobj, | ||
92 | struct sysfs_dirent *new_parent, | ||
93 | const char *new_name); | ||
94 | extern int __must_check kobject_move(struct kobject *, struct kobject *); | 88 | extern int __must_check kobject_move(struct kobject *, struct kobject *); |
95 | 89 | ||
96 | extern int __must_check kobject_register(struct kobject *); | 90 | extern int __must_check kobject_register(struct kobject *); |
@@ -111,36 +105,44 @@ struct kobj_type { | |||
111 | struct attribute ** default_attrs; | 105 | struct attribute ** default_attrs; |
112 | }; | 106 | }; |
113 | 107 | ||
108 | struct kobj_uevent_env { | ||
109 | char *envp[UEVENT_NUM_ENVP]; | ||
110 | int envp_idx; | ||
111 | char buf[UEVENT_BUFFER_SIZE]; | ||
112 | int buflen; | ||
113 | }; | ||
114 | |||
114 | struct kset_uevent_ops { | 115 | struct kset_uevent_ops { |
115 | int (*filter)(struct kset *kset, struct kobject *kobj); | 116 | int (*filter)(struct kset *kset, struct kobject *kobj); |
116 | const char *(*name)(struct kset *kset, struct kobject *kobj); | 117 | const char *(*name)(struct kset *kset, struct kobject *kobj); |
117 | int (*uevent)(struct kset *kset, struct kobject *kobj, char **envp, | 118 | int (*uevent)(struct kset *kset, struct kobject *kobj, |
118 | int num_envp, char *buffer, int buffer_size); | 119 | struct kobj_uevent_env *env); |
119 | }; | 120 | }; |
120 | 121 | ||
121 | /* | 122 | /** |
122 | * struct kset - a set of kobjects of a specific type, belonging | 123 | * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem. |
123 | * to a specific subsystem. | ||
124 | * | ||
125 | * All kobjects of a kset should be embedded in an identical | ||
126 | * type. This type may have a descriptor, which the kset points | ||
127 | * to. This allows there to exist sets of objects of the same | ||
128 | * type in different subsystems. | ||
129 | * | 124 | * |
130 | * A subsystem does not have to be a list of only one type | 125 | * A kset defines a group of kobjects. They can be individually |
131 | * of object; multiple ksets can belong to one subsystem. All | 126 | * different "types" but overall these kobjects all want to be grouped |
132 | * ksets of a subsystem share the subsystem's lock. | 127 | * together and operated on in the same manner. ksets are used to |
128 | * define the attribute callbacks and other common events that happen to | ||
129 | * a kobject. | ||
133 | * | 130 | * |
134 | * Each kset can support specific event variables; it can | 131 | * @ktype: the struct kobj_type for this specific kset |
135 | * supress the event generation or add subsystem specific | 132 | * @list: the list of all kobjects for this kset |
136 | * variables carried with the event. | 133 | * @list_lock: a lock for iterating over the kobjects |
134 | * @kobj: the embedded kobject for this kset (recursion, isn't it fun...) | ||
135 | * @uevent_ops: the set of uevent operations for this kset. These are | ||
136 | * called whenever a kobject has something happen to it so that the kset | ||
137 | * can add new environment variables, or filter out the uevents if so | ||
138 | * desired. | ||
137 | */ | 139 | */ |
138 | struct kset { | 140 | struct kset { |
139 | struct kobj_type * ktype; | 141 | struct kobj_type *ktype; |
140 | struct list_head list; | 142 | struct list_head list; |
141 | spinlock_t list_lock; | 143 | spinlock_t list_lock; |
142 | struct kobject kobj; | 144 | struct kobject kobj; |
143 | struct kset_uevent_ops * uevent_ops; | 145 | struct kset_uevent_ops *uevent_ops; |
144 | }; | 146 | }; |
145 | 147 | ||
146 | 148 | ||
@@ -179,18 +181,18 @@ extern struct kobject * kset_find_obj(struct kset *, const char *); | |||
179 | * Use this when initializing an embedded kset with no other | 181 | * Use this when initializing an embedded kset with no other |
180 | * fields to initialize. | 182 | * fields to initialize. |
181 | */ | 183 | */ |
182 | #define set_kset_name(str) .kset = { .kobj = { .name = str } } | 184 | #define set_kset_name(str) .kset = { .kobj = { .k_name = str } } |
183 | 185 | ||
184 | 186 | ||
185 | #define decl_subsys(_name,_type,_uevent_ops) \ | 187 | #define decl_subsys(_name,_type,_uevent_ops) \ |
186 | struct kset _name##_subsys = { \ | 188 | struct kset _name##_subsys = { \ |
187 | .kobj = { .name = __stringify(_name) }, \ | 189 | .kobj = { .k_name = __stringify(_name) }, \ |
188 | .ktype = _type, \ | 190 | .ktype = _type, \ |
189 | .uevent_ops =_uevent_ops, \ | 191 | .uevent_ops =_uevent_ops, \ |
190 | } | 192 | } |
191 | #define decl_subsys_name(_varname,_name,_type,_uevent_ops) \ | 193 | #define decl_subsys_name(_varname,_name,_type,_uevent_ops) \ |
192 | struct kset _varname##_subsys = { \ | 194 | struct kset _varname##_subsys = { \ |
193 | .kobj = { .name = __stringify(_name) }, \ | 195 | .kobj = { .k_name = __stringify(_name) }, \ |
194 | .ktype = _type, \ | 196 | .ktype = _type, \ |
195 | .uevent_ops =_uevent_ops, \ | 197 | .uevent_ops =_uevent_ops, \ |
196 | } | 198 | } |
@@ -218,49 +220,9 @@ extern struct kset hypervisor_subsys; | |||
218 | #define kobj_set_kset_s(obj,subsys) \ | 220 | #define kobj_set_kset_s(obj,subsys) \ |
219 | (obj)->kobj.kset = &(subsys) | 221 | (obj)->kobj.kset = &(subsys) |
220 | 222 | ||
221 | /** | ||
222 | * kset_set_kset_s(obj,subsys) - set kset for embedded kset. | ||
223 | * @obj: ptr to some object type. | ||
224 | * @subsys: a subsystem object (not a ptr). | ||
225 | * | ||
226 | * Can be used for any object type with an embedded ->kset. | ||
227 | * Sets the kset of @obj's embedded kobject (via its embedded | ||
228 | * kset) to @subsys.kset. This makes @obj a member of that | ||
229 | * kset. | ||
230 | */ | ||
231 | |||
232 | #define kset_set_kset_s(obj,subsys) \ | ||
233 | (obj)->kset.kobj.kset = &(subsys) | ||
234 | |||
235 | /** | ||
236 | * subsys_set_kset(obj,subsys) - set kset for subsystem | ||
237 | * @obj: ptr to some object type. | ||
238 | * @_subsys: a subsystem object (not a ptr). | ||
239 | * | ||
240 | * Can be used for any object type with an embedded ->subsys. | ||
241 | * Sets the kset of @obj's kobject to @subsys.kset. This makes | ||
242 | * the object a member of that kset. | ||
243 | */ | ||
244 | |||
245 | #define subsys_set_kset(obj,_subsys) \ | ||
246 | (obj)->subsys.kobj.kset = &(_subsys) | ||
247 | |||
248 | extern void subsystem_init(struct kset *); | ||
249 | extern int __must_check subsystem_register(struct kset *); | 223 | extern int __must_check subsystem_register(struct kset *); |
250 | extern void subsystem_unregister(struct kset *); | 224 | extern void subsystem_unregister(struct kset *); |
251 | 225 | ||
252 | static inline struct kset *subsys_get(struct kset *s) | ||
253 | { | ||
254 | if (s) | ||
255 | return kset_get(s); | ||
256 | return NULL; | ||
257 | } | ||
258 | |||
259 | static inline void subsys_put(struct kset *s) | ||
260 | { | ||
261 | kset_put(s); | ||
262 | } | ||
263 | |||
264 | struct subsys_attribute { | 226 | struct subsys_attribute { |
265 | struct attribute attr; | 227 | struct attribute attr; |
266 | ssize_t (*show)(struct kset *, char *); | 228 | ssize_t (*show)(struct kset *, char *); |
@@ -275,10 +237,11 @@ int kobject_uevent(struct kobject *kobj, enum kobject_action action); | |||
275 | int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, | 237 | int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, |
276 | char *envp[]); | 238 | char *envp[]); |
277 | 239 | ||
278 | int add_uevent_var(char **envp, int num_envp, int *cur_index, | 240 | int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) |
279 | char *buffer, int buffer_size, int *cur_len, | 241 | __attribute__((format (printf, 2, 3))); |
280 | const char *format, ...) | 242 | |
281 | __attribute__((format (printf, 7, 8))); | 243 | int kobject_action_type(const char *buf, size_t count, |
244 | enum kobject_action *type); | ||
282 | #else | 245 | #else |
283 | static inline int kobject_uevent(struct kobject *kobj, enum kobject_action action) | 246 | static inline int kobject_uevent(struct kobject *kobj, enum kobject_action action) |
284 | { return 0; } | 247 | { return 0; } |
@@ -287,10 +250,12 @@ static inline int kobject_uevent_env(struct kobject *kobj, | |||
287 | char *envp[]) | 250 | char *envp[]) |
288 | { return 0; } | 251 | { return 0; } |
289 | 252 | ||
290 | static inline int add_uevent_var(char **envp, int num_envp, int *cur_index, | 253 | static inline int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) |
291 | char *buffer, int buffer_size, int *cur_len, | ||
292 | const char *format, ...) | ||
293 | { return 0; } | 254 | { return 0; } |
255 | |||
256 | static inline int kobject_action_type(const char *buf, size_t count, | ||
257 | enum kobject_action *type) | ||
258 | { return -EINVAL; } | ||
294 | #endif | 259 | #endif |
295 | 260 | ||
296 | #endif /* __KERNEL__ */ | 261 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 8bbd459eafdc..e80804316cdb 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | struct platform_device { | 16 | struct platform_device { |
17 | const char * name; | 17 | const char * name; |
18 | u32 id; | 18 | int id; |
19 | struct device dev; | 19 | struct device dev; |
20 | u32 num_resources; | 20 | u32 num_resources; |
21 | struct resource * resource; | 21 | struct resource * resource; |
@@ -35,9 +35,10 @@ extern struct resource *platform_get_resource_byname(struct platform_device *, u | |||
35 | extern int platform_get_irq_byname(struct platform_device *, char *); | 35 | extern int platform_get_irq_byname(struct platform_device *, char *); |
36 | extern int platform_add_devices(struct platform_device **, int); | 36 | extern int platform_add_devices(struct platform_device **, int); |
37 | 37 | ||
38 | extern struct platform_device *platform_device_register_simple(char *, unsigned int, struct resource *, unsigned int); | 38 | extern struct platform_device *platform_device_register_simple(char *, int id, |
39 | struct resource *, unsigned int); | ||
39 | 40 | ||
40 | extern struct platform_device *platform_device_alloc(const char *name, unsigned int id); | 41 | extern struct platform_device *platform_device_alloc(const char *name, int id); |
41 | extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); | 42 | extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); |
42 | extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); | 43 | extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); |
43 | extern int platform_device_add(struct platform_device *pdev); | 44 | extern int platform_device_add(struct platform_device *pdev); |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index be8228e50a27..149ab62329e2 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -3,6 +3,8 @@ | |||
3 | * | 3 | * |
4 | * Copyright (c) 2001,2002 Patrick Mochel | 4 | * Copyright (c) 2001,2002 Patrick Mochel |
5 | * Copyright (c) 2004 Silicon Graphics, Inc. | 5 | * Copyright (c) 2004 Silicon Graphics, Inc. |
6 | * Copyright (c) 2007 SUSE Linux Products GmbH | ||
7 | * Copyright (c) 2007 Tejun Heo <teheo@suse.de> | ||
6 | * | 8 | * |
7 | * Please see Documentation/filesystems/sysfs.txt for more information. | 9 | * Please see Documentation/filesystems/sysfs.txt for more information. |
8 | */ | 10 | */ |
@@ -17,23 +19,20 @@ | |||
17 | 19 | ||
18 | struct kobject; | 20 | struct kobject; |
19 | struct module; | 21 | struct module; |
20 | struct nameidata; | ||
21 | struct dentry; | ||
22 | struct sysfs_dirent; | ||
23 | 22 | ||
24 | /* FIXME | 23 | /* FIXME |
25 | * The *owner field is no longer used, but leave around | 24 | * The *owner field is no longer used, but leave around |
26 | * until the tree gets cleaned up fully. | 25 | * until the tree gets cleaned up fully. |
27 | */ | 26 | */ |
28 | struct attribute { | 27 | struct attribute { |
29 | const char * name; | 28 | const char *name; |
30 | struct module * owner; | 29 | struct module *owner; |
31 | mode_t mode; | 30 | mode_t mode; |
32 | }; | 31 | }; |
33 | 32 | ||
34 | struct attribute_group { | 33 | struct attribute_group { |
35 | const char * name; | 34 | const char *name; |
36 | struct attribute ** attrs; | 35 | struct attribute **attrs; |
37 | }; | 36 | }; |
38 | 37 | ||
39 | 38 | ||
@@ -77,72 +76,41 @@ struct sysfs_ops { | |||
77 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); | 76 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); |
78 | }; | 77 | }; |
79 | 78 | ||
80 | #define SYSFS_TYPE_MASK 0x00ff | ||
81 | #define SYSFS_ROOT 0x0001 | ||
82 | #define SYSFS_DIR 0x0002 | ||
83 | #define SYSFS_KOBJ_ATTR 0x0004 | ||
84 | #define SYSFS_KOBJ_BIN_ATTR 0x0008 | ||
85 | #define SYSFS_KOBJ_LINK 0x0020 | ||
86 | #define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK) | ||
87 | |||
88 | #define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK | ||
89 | #define SYSFS_FLAG_REMOVED 0x0100 | ||
90 | |||
91 | #ifdef CONFIG_SYSFS | 79 | #ifdef CONFIG_SYSFS |
92 | 80 | ||
93 | extern int sysfs_schedule_callback(struct kobject *kobj, | 81 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), |
94 | void (*func)(void *), void *data, struct module *owner); | 82 | void *data, struct module *owner); |
95 | |||
96 | extern int __must_check | ||
97 | sysfs_create_dir(struct kobject *kobj, struct sysfs_dirent *shadow_parent_sd); | ||
98 | |||
99 | extern void | ||
100 | sysfs_remove_dir(struct kobject *); | ||
101 | |||
102 | extern int __must_check | ||
103 | sysfs_rename_dir(struct kobject *kobj, struct sysfs_dirent *new_parent_sd, | ||
104 | const char *new_name); | ||
105 | |||
106 | extern int __must_check | ||
107 | sysfs_move_dir(struct kobject *, struct kobject *); | ||
108 | |||
109 | extern int __must_check | ||
110 | sysfs_create_file(struct kobject *, const struct attribute *); | ||
111 | 83 | ||
112 | extern int __must_check | 84 | int __must_check sysfs_create_dir(struct kobject *kobj); |
113 | sysfs_update_file(struct kobject *, const struct attribute *); | 85 | void sysfs_remove_dir(struct kobject *kobj); |
86 | int __must_check sysfs_rename_dir(struct kobject *kobj, const char *new_name); | ||
87 | int __must_check sysfs_move_dir(struct kobject *kobj, | ||
88 | struct kobject *new_parent_kobj); | ||
114 | 89 | ||
115 | extern int __must_check | 90 | int __must_check sysfs_create_file(struct kobject *kobj, |
116 | sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode); | 91 | const struct attribute *attr); |
117 | 92 | int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, | |
118 | extern void | 93 | mode_t mode); |
119 | sysfs_remove_file(struct kobject *, const struct attribute *); | 94 | void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); |
120 | |||
121 | extern int __must_check | ||
122 | sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name); | ||
123 | |||
124 | extern void | ||
125 | sysfs_remove_link(struct kobject *, const char * name); | ||
126 | 95 | ||
127 | int __must_check sysfs_create_bin_file(struct kobject *kobj, | 96 | int __must_check sysfs_create_bin_file(struct kobject *kobj, |
128 | struct bin_attribute *attr); | 97 | struct bin_attribute *attr); |
129 | void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); | 98 | void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); |
130 | 99 | ||
131 | int __must_check sysfs_create_group(struct kobject *, | 100 | int __must_check sysfs_create_link(struct kobject *kobj, struct kobject *target, |
132 | const struct attribute_group *); | 101 | const char *name); |
133 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); | 102 | void sysfs_remove_link(struct kobject *kobj, const char *name); |
103 | |||
104 | int __must_check sysfs_create_group(struct kobject *kobj, | ||
105 | const struct attribute_group *grp); | ||
106 | void sysfs_remove_group(struct kobject *kobj, | ||
107 | const struct attribute_group *grp); | ||
134 | int sysfs_add_file_to_group(struct kobject *kobj, | 108 | int sysfs_add_file_to_group(struct kobject *kobj, |
135 | const struct attribute *attr, const char *group); | 109 | const struct attribute *attr, const char *group); |
136 | void sysfs_remove_file_from_group(struct kobject *kobj, | 110 | void sysfs_remove_file_from_group(struct kobject *kobj, |
137 | const struct attribute *attr, const char *group); | 111 | const struct attribute *attr, const char *group); |
138 | |||
139 | void sysfs_notify(struct kobject * k, char *dir, char *attr); | ||
140 | |||
141 | 112 | ||
142 | extern int sysfs_make_shadowed_dir(struct kobject *kobj, | 113 | void sysfs_notify(struct kobject *kobj, char *dir, char *attr); |
143 | void * (*follow_link)(struct dentry *, struct nameidata *)); | ||
144 | extern struct sysfs_dirent *sysfs_create_shadow_dir(struct kobject *kobj); | ||
145 | extern void sysfs_remove_shadow_dir(struct sysfs_dirent *shadow_sd); | ||
146 | 114 | ||
147 | extern int __must_check sysfs_init(void); | 115 | extern int __must_check sysfs_init(void); |
148 | 116 | ||
@@ -154,75 +122,76 @@ static inline int sysfs_schedule_callback(struct kobject *kobj, | |||
154 | return -ENOSYS; | 122 | return -ENOSYS; |
155 | } | 123 | } |
156 | 124 | ||
157 | static inline int sysfs_create_dir(struct kobject *kobj, | 125 | static inline int sysfs_create_dir(struct kobject *kobj) |
158 | struct sysfs_dirent *shadow_parent_sd) | ||
159 | { | 126 | { |
160 | return 0; | 127 | return 0; |
161 | } | 128 | } |
162 | 129 | ||
163 | static inline void sysfs_remove_dir(struct kobject * k) | 130 | static inline void sysfs_remove_dir(struct kobject *kobj) |
164 | { | 131 | { |
165 | ; | 132 | ; |
166 | } | 133 | } |
167 | 134 | ||
168 | static inline int sysfs_rename_dir(struct kobject *kobj, | 135 | static inline int sysfs_rename_dir(struct kobject *kobj, const char *new_name) |
169 | struct sysfs_dirent *new_parent_sd, | ||
170 | const char *new_name) | ||
171 | { | 136 | { |
172 | return 0; | 137 | return 0; |
173 | } | 138 | } |
174 | 139 | ||
175 | static inline int sysfs_move_dir(struct kobject * k, struct kobject * new_parent) | 140 | static inline int sysfs_move_dir(struct kobject *kobj, |
141 | struct kobject *new_parent_kobj) | ||
176 | { | 142 | { |
177 | return 0; | 143 | return 0; |
178 | } | 144 | } |
179 | 145 | ||
180 | static inline int sysfs_create_file(struct kobject * k, const struct attribute * a) | 146 | static inline int sysfs_create_file(struct kobject *kobj, |
147 | const struct attribute *attr) | ||
181 | { | 148 | { |
182 | return 0; | 149 | return 0; |
183 | } | 150 | } |
184 | 151 | ||
185 | static inline int sysfs_update_file(struct kobject * k, const struct attribute * a) | 152 | static inline int sysfs_chmod_file(struct kobject *kobj, |
186 | { | 153 | struct attribute *attr, mode_t mode) |
187 | return 0; | ||
188 | } | ||
189 | static inline int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode) | ||
190 | { | 154 | { |
191 | return 0; | 155 | return 0; |
192 | } | 156 | } |
193 | 157 | ||
194 | static inline void sysfs_remove_file(struct kobject * k, const struct attribute * a) | 158 | static inline void sysfs_remove_file(struct kobject *kobj, |
159 | const struct attribute *attr) | ||
195 | { | 160 | { |
196 | ; | 161 | ; |
197 | } | 162 | } |
198 | 163 | ||
199 | static inline int sysfs_create_link(struct kobject * k, struct kobject * t, const char * n) | 164 | static inline int sysfs_create_bin_file(struct kobject *kobj, |
165 | struct bin_attribute *attr) | ||
200 | { | 166 | { |
201 | return 0; | 167 | return 0; |
202 | } | 168 | } |
203 | 169 | ||
204 | static inline void sysfs_remove_link(struct kobject * k, const char * name) | 170 | static inline int sysfs_remove_bin_file(struct kobject *kobj, |
171 | struct bin_attribute *attr) | ||
205 | { | 172 | { |
206 | ; | 173 | return 0; |
207 | } | 174 | } |
208 | 175 | ||
209 | 176 | static inline int sysfs_create_link(struct kobject *kobj, | |
210 | static inline int sysfs_create_bin_file(struct kobject * k, struct bin_attribute * a) | 177 | struct kobject *target, const char *name) |
211 | { | 178 | { |
212 | return 0; | 179 | return 0; |
213 | } | 180 | } |
214 | 181 | ||
215 | static inline int sysfs_remove_bin_file(struct kobject * k, struct bin_attribute * a) | 182 | static inline void sysfs_remove_link(struct kobject *kobj, const char *name) |
216 | { | 183 | { |
217 | return 0; | 184 | ; |
218 | } | 185 | } |
219 | 186 | ||
220 | static inline int sysfs_create_group(struct kobject * k, const struct attribute_group *g) | 187 | static inline int sysfs_create_group(struct kobject *kobj, |
188 | const struct attribute_group *grp) | ||
221 | { | 189 | { |
222 | return 0; | 190 | return 0; |
223 | } | 191 | } |
224 | 192 | ||
225 | static inline void sysfs_remove_group(struct kobject * k, const struct attribute_group * g) | 193 | static inline void sysfs_remove_group(struct kobject *kobj, |
194 | const struct attribute_group *grp) | ||
226 | { | 195 | { |
227 | ; | 196 | ; |
228 | } | 197 | } |
@@ -238,14 +207,8 @@ static inline void sysfs_remove_file_from_group(struct kobject *kobj, | |||
238 | { | 207 | { |
239 | } | 208 | } |
240 | 209 | ||
241 | static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) | 210 | static inline void sysfs_notify(struct kobject *kobj, char *dir, char *attr) |
242 | { | ||
243 | } | ||
244 | |||
245 | static inline int sysfs_make_shadowed_dir(struct kobject *kobj, | ||
246 | void * (*follow_link)(struct dentry *, struct nameidata *)) | ||
247 | { | 211 | { |
248 | return 0; | ||
249 | } | 212 | } |
250 | 213 | ||
251 | static inline int __must_check sysfs_init(void) | 214 | static inline int __must_check sysfs_init(void) |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 6570719eafdf..60478f6e5dc6 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -21,7 +21,6 @@ | |||
21 | * (Note: the *_driver.minor_start values 1, 64, 128, 192 are | 21 | * (Note: the *_driver.minor_start values 1, 64, 128, 192 are |
22 | * hardcoded at present.) | 22 | * hardcoded at present.) |
23 | */ | 23 | */ |
24 | #define NR_PTYS CONFIG_LEGACY_PTY_COUNT /* Number of legacy ptys */ | ||
25 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ | 24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ |
26 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ | 25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ |
27 | #define NR_LDISCS 17 | 26 | #define NR_LDISCS 17 |
diff --git a/include/linux/video_output.h b/include/linux/video_output.h index e63e0c03ee0d..2fb46bc9340d 100644 --- a/include/linux/video_output.h +++ b/include/linux/video_output.h | |||
@@ -31,9 +31,9 @@ struct output_properties { | |||
31 | struct output_device { | 31 | struct output_device { |
32 | int request_state; | 32 | int request_state; |
33 | struct output_properties *props; | 33 | struct output_properties *props; |
34 | struct class_device class_dev; | 34 | struct device dev; |
35 | }; | 35 | }; |
36 | #define to_output_device(obj) container_of(obj, struct output_device, class_dev) | 36 | #define to_output_device(obj) container_of(obj, struct output_device, dev) |
37 | struct output_device *video_output_register(const char *name, | 37 | struct output_device *video_output_register(const char *name, |
38 | struct device *dev, | 38 | struct device *dev, |
39 | void *devdata, | 39 | void *devdata, |