- 论坛徽章:
- 5
|
回复 12# 虫虫2003 - static ssize_t xxx_store_caliberate(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count)
- {
- const ptrdiff_t offset = attr - s_attr;
- int set_value = simple_strtoul(buf, NULL, 10);
- switch(offset)
- {
- case 0:
- case 1:
- }
- }
- static ssize_t xxx_show_caliberate(struct device *dev,
- struct device_attribute *attr, char *buf)
- {
- const ptrdiff_t offset = attr - s_attr;
- switch(offset)
- {
- case 0:
- case 1:
- }
- }
- #define XXX_ATTR(_name) \
- { \
- .attr = { .name = #_name, .mode = S_IRUGO | S_IWUSR | S_IWGRP, }, \
- .show = xxx_show_caliberate, \
- .store = xxx_store_caliberate, \
- }
- static struct device_attribute s_attr[] = {
- XXX_ATTR(a),
- XXX_ATTR(b),
- };
复制代码 |
|