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

input: serio: use DEVICE_ATTR_RO()

Convert the serio sysfs fiels to use the DEVICE_ATTR_RO() macros to make
it easier to audit the correct sysfs file permission usage.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: <linux-input@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+8 -8
+8 -8
drivers/input/serio/serio.c
··· 373 373 serio->id.type, serio->id.proto, serio->id.id, serio->id.extra); 374 374 } 375 375 376 - static ssize_t serio_show_id_type(struct device *dev, struct device_attribute *attr, char *buf) 376 + static ssize_t type_show(struct device *dev, struct device_attribute *attr, char *buf) 377 377 { 378 378 struct serio *serio = to_serio_port(dev); 379 379 return sprintf(buf, "%02x\n", serio->id.type); 380 380 } 381 381 382 - static ssize_t serio_show_id_proto(struct device *dev, struct device_attribute *attr, char *buf) 382 + static ssize_t proto_show(struct device *dev, struct device_attribute *attr, char *buf) 383 383 { 384 384 struct serio *serio = to_serio_port(dev); 385 385 return sprintf(buf, "%02x\n", serio->id.proto); 386 386 } 387 387 388 - static ssize_t serio_show_id_id(struct device *dev, struct device_attribute *attr, char *buf) 388 + static ssize_t id_show(struct device *dev, struct device_attribute *attr, char *buf) 389 389 { 390 390 struct serio *serio = to_serio_port(dev); 391 391 return sprintf(buf, "%02x\n", serio->id.id); 392 392 } 393 393 394 - static ssize_t serio_show_id_extra(struct device *dev, struct device_attribute *attr, char *buf) 394 + static ssize_t extra_show(struct device *dev, struct device_attribute *attr, char *buf) 395 395 { 396 396 struct serio *serio = to_serio_port(dev); 397 397 return sprintf(buf, "%02x\n", serio->id.extra); 398 398 } 399 399 400 - static DEVICE_ATTR(type, S_IRUGO, serio_show_id_type, NULL); 401 - static DEVICE_ATTR(proto, S_IRUGO, serio_show_id_proto, NULL); 402 - static DEVICE_ATTR(id, S_IRUGO, serio_show_id_id, NULL); 403 - static DEVICE_ATTR(extra, S_IRUGO, serio_show_id_extra, NULL); 400 + static DEVICE_ATTR_RO(type); 401 + static DEVICE_ATTR_RO(proto); 402 + static DEVICE_ATTR_RO(id); 403 + static DEVICE_ATTR_RO(extra); 404 404 405 405 static struct attribute *serio_device_id_attrs[] = { 406 406 &dev_attr_type.attr,