summaryrefslogtreecommitdiff
path: root/include/uapi/linux/map_to_7segment.h
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2021-02-07 16:05:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-02-09 14:27:32 +0300
commit0566752c3e8681ec47fee37374cb38081d801e95 (patch)
tree5d9f2a1465313ffa3e0d50bd6642b3386fc214e5 /include/uapi/linux/map_to_7segment.h
parent61de21a8315147da08a37ff8db2716739977eadc (diff)
downloadlinux-0566752c3e8681ec47fee37374cb38081d801e95.tar.xz
uapi: map_to_7segment: Update example in documentation
The device_attribute .show() and .store() methods gained an extra parameter in v2.6.13, but the example in the documentation for the 7-segment header file was never updated. Add the missing parameters. While at it, get rid of the (misspelled) deprecated symbolic permissions, and switch to DEVICE_ATTR_RW(), which was introduced in v3.11 Fixes: 54b6f35c99974e99 ("[PATCH] Driver core: change device_attribute callbacks") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/r/20210207130543.2128980-1-geert@linux-m68k.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi/linux/map_to_7segment.h')
-rw-r--r--include/uapi/linux/map_to_7segment.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/uapi/linux/map_to_7segment.h b/include/uapi/linux/map_to_7segment.h
index 13a06e5e966e..8b02088f96e3 100644
--- a/include/uapi/linux/map_to_7segment.h
+++ b/include/uapi/linux/map_to_7segment.h
@@ -45,17 +45,22 @@
* In device drivers it is recommended, if required, to make the char map
* accessible via the sysfs interface using the following scheme:
*
- * static ssize_t show_map(struct device *dev, char *buf) {
+ * static ssize_t map_seg7_show(struct device *dev,
+ * struct device_attribute *attr, char *buf)
+ * {
* memcpy(buf, &map_seg7, sizeof(map_seg7));
* return sizeof(map_seg7);
* }
- * static ssize_t store_map(struct device *dev, const char *buf, size_t cnt) {
+ * static ssize_t map_seg7_store(struct device *dev,
+ * struct device_attribute *attr, const char *buf,
+ * size_t cnt)
+ * {
* if(cnt != sizeof(map_seg7))
* return -EINVAL;
* memcpy(&map_seg7, buf, cnt);
* return cnt;
* }
- * static DEVICE_ATTR(map_seg7, PERMS_RW, show_map, store_map);
+ * static DEVICE_ATTR_RW(map_seg7);
*
* History:
* 2005-05-31 RFC linux-kernel@vger.kernel.org