Lines Matching refs:device_attribute
101 例如:驱动程序模型定义的 device_attribute 结构体如下:
103 struct device_attribute {
105 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
107 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
111 int device_create_file(struct device *, const struct device_attribute *);
112 void device_remove_file(struct device *, const struct device_attribute *);
117 struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
125 static struct device_attribute dev_attr_foo = {
158 #define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
163 struct device_attribute *dev_attr = to_dev_attr(attr);
184 ssize_t (*show)(struct device *dev, struct device_attribute *attr, char *buf);
185 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
233 static ssize_t show_name(struct device *dev, struct device_attribute *attr,
239 static ssize_t store_name(struct device *dev, struct device_attribute *attr,
307 struct device_attribute {
309 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
311 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
321 int device_create_file(struct device *dev, const struct device_attribute * attr);
322 void device_remove_file(struct device *dev, const struct device_attribute * attr);