Linux Kernel
3.7.1
|
#include <linux/compiler.h>
#include <linux/errno.h>
#include <linux/list.h>
#include <linux/lockdep.h>
#include <linux/kobject_ns.h>
#include <linux/atomic.h>
Go to the source code of this file.
Data Structures | |
struct | attribute |
struct | attribute_group |
struct | bin_attribute |
struct | sysfs_ops |
Macros | |
#define | sysfs_attr_init(attr) do {} while(0) |
#define | __ATTR(_name, _mode, _show, _store) |
#define | __ATTR_RO(_name) |
#define | __ATTR_NULL { .attr = { .name = NULL } } |
#define | __ATTR_IGNORE_LOCKDEP __ATTR |
#define | attr_name(_attr) (_attr).attr.name |
#define | sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr) |
#define __ATTR | ( | _name, | |
_mode, | |||
_show, | |||
_store | |||
) |
Use these macros to make defining attributes easier. See include/linux/device.h for examples..
#define __ATTR_RO | ( | _name | ) |
#define sysfs_attr_init | ( | attr | ) | do {} while(0) |
sysfs_attr_init - initialize a dynamically allocated sysfs attribute : struct attribute to initialize
Initialize a dynamically allocated struct attribute so we can make lockdep happy. This is a new requirement for attributes and initially this is only needed when lockdep is enabled. Lockdep gives a nice error when your attribute is added to sysfs if you don't have this.
#define sysfs_bin_attr_init | ( | bin_attr | ) | sysfs_attr_init(&(bin_attr)->attr) |
sysfs_bin_attr_init - initialize a dynamically allocated bin_attribute : struct bin_attribute to initialize
Initialize a dynamically allocated struct bin_attribute so we can make lockdep happy. This is a new requirement for attributes and initially this is only needed when lockdep is enabled. Lockdep gives a nice error when your attribute is added to sysfs if you don't have this.