diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-07 21:08:23 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-19 23:02:44 -0400 |
commit | 7eab8ded347244f1464006ace851521254cabb07 (patch) | |
tree | 1b14baff80dad1825e042a45c07f04c10f81eb57 | |
parent | a7204d72db251784808b0c050220992d7f833a2c (diff) |
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>
-rw-r--r-- | drivers/input/serio/serio.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index 2b56855c2c77..478880e3dde2 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c | |||
@@ -373,34 +373,34 @@ static ssize_t serio_show_modalias(struct device *dev, struct device_attribute * | |||
373 | serio->id.type, serio->id.proto, serio->id.id, serio->id.extra); | 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 | struct serio *serio = to_serio_port(dev); | 378 | struct serio *serio = to_serio_port(dev); |
379 | return sprintf(buf, "%02x\n", serio->id.type); | 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 | struct serio *serio = to_serio_port(dev); | 384 | struct serio *serio = to_serio_port(dev); |
385 | return sprintf(buf, "%02x\n", serio->id.proto); | 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 | struct serio *serio = to_serio_port(dev); | 390 | struct serio *serio = to_serio_port(dev); |
391 | return sprintf(buf, "%02x\n", serio->id.id); | 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 | struct serio *serio = to_serio_port(dev); | 396 | struct serio *serio = to_serio_port(dev); |
397 | return sprintf(buf, "%02x\n", serio->id.extra); | 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); | 400 | static DEVICE_ATTR_RO(type); |
401 | static DEVICE_ATTR(proto, S_IRUGO, serio_show_id_proto, NULL); | 401 | static DEVICE_ATTR_RO(proto); |
402 | static DEVICE_ATTR(id, S_IRUGO, serio_show_id_id, NULL); | 402 | static DEVICE_ATTR_RO(id); |
403 | static DEVICE_ATTR(extra, S_IRUGO, serio_show_id_extra, NULL); | 403 | static DEVICE_ATTR_RO(extra); |
404 | 404 | ||
405 | static struct attribute *serio_device_id_attrs[] = { | 405 | static struct attribute *serio_device_id_attrs[] = { |
406 | &dev_attr_type.attr, | 406 | &dev_attr_type.attr, |