Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Geert Uytterhoeven and committed by
Greg Kroah-Hartman
0566752c 61de21a8

+8 -3
+8 -3
include/uapi/linux/map_to_7segment.h
··· 45 45 * In device drivers it is recommended, if required, to make the char map 46 46 * accessible via the sysfs interface using the following scheme: 47 47 * 48 - * static ssize_t show_map(struct device *dev, char *buf) { 48 + * static ssize_t map_seg7_show(struct device *dev, 49 + * struct device_attribute *attr, char *buf) 50 + * { 49 51 * memcpy(buf, &map_seg7, sizeof(map_seg7)); 50 52 * return sizeof(map_seg7); 51 53 * } 52 - * static ssize_t store_map(struct device *dev, const char *buf, size_t cnt) { 54 + * static ssize_t map_seg7_store(struct device *dev, 55 + * struct device_attribute *attr, const char *buf, 56 + * size_t cnt) 57 + * { 53 58 * if(cnt != sizeof(map_seg7)) 54 59 * return -EINVAL; 55 60 * memcpy(&map_seg7, buf, cnt); 56 61 * return cnt; 57 62 * } 58 - * static DEVICE_ATTR(map_seg7, PERMS_RW, show_map, store_map); 63 + * static DEVICE_ATTR_RW(map_seg7); 59 64 * 60 65 * History: 61 66 * 2005-05-31 RFC linux-kernel@vger.kernel.org