source: GPL/trunk/include/linux/sysfs.h

Last change on this file was 777, checked in by David Azarewicz, 4 months ago

Merge from uniaud32-exp branch

File size: 913 bytes
Line 
1#ifndef _LINUX_SYSFS_H
2#define _LINUX_SYSFS_H
3#include <linux/types.h>
4
5int sysfs_emit(char *buf, const char *fmt, ...);
6int sysfs_emit_at(char *buf, int at, const char *fmt, ...);
7
8struct attribute {
9 const char *name;
10 umode_t mode;
11};
12
13struct attribute_group {
14 const char *name;
15 umode_t (*is_visible)(struct kobject *,
16 struct attribute *, int);
17 struct attribute **attrs;
18 struct bin_attribute **bin_attrs;
19};
20
21#define __ATTR_RO(_name) { \
22 .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \
23 .show = _name##_show, \
24}
25
26static inline int sysfs_create_groups(struct kobject *kobj,
27 const struct attribute_group **groups)
28{
29 return 0;
30}
31
32struct sysfs_ops {
33 ssize_t (*show)(struct kobject *, struct attribute *,char *);
34 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
35};
36
37#endif /* _LINUX_SYSFS_H */
Note: See TracBrowser for help on using the repository browser.