From 312bb84942cb6707cf9b3933a6c74cbe5e9ed037 Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Wed, 27 May 2015 11:17:52 -0500 Subject: [PATCH] greybus: endo: drop redundant prefixes from sysfs basenames This commit: 7e761e2 endo: rework some attributes added a new "endo_id" attribute, located under a new "Endo" directory in sysfs. The resulting path looks like: Documentation/sysfs/endo-TYPE/Endo/endo_id There's no need to have a separate "Endo" subdirectory to contain Endo-specific attributes. That commit also added "svc_" to some other paths related to the SVC, like: Documentation/sysfs/endo-TYPE/SVC/svc_version The additional "svc_" is redundant. This patch retouches those paths a bit, mainly to remove some redundancy. It also makes the pathname components all lower case. As a result, the above two paths now look like: Documentation/sysfs/endo-TYPE/id Documentation/sysfs/endo-TYPE/svc/version All other Endo sysfs files are updated similarly. Signed-off-by: Alex Elder Reviewed-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- .../staging/greybus/Documentation/sysfs-bus-greybus | 8 ++++---- .../sysfs/endo-TYPE/{Endo => }/ap_intf_id | 0 .../sysfs/endo-TYPE/{SVC/version => id} | 0 .../sysfs/endo-TYPE/{SVC => svc}/firmware | 0 .../sysfs/endo-TYPE/{SVC => svc}/serial_number | 0 .../sysfs/endo-TYPE/{Endo/endo_id => svc/version} | 0 drivers/staging/greybus/endo.c | 21 ++++++++++----------- 7 files changed, 14 insertions(+), 15 deletions(-) rename drivers/staging/greybus/Documentation/sysfs/endo-TYPE/{Endo => }/ap_intf_id (100%) rename drivers/staging/greybus/Documentation/sysfs/endo-TYPE/{SVC/version => id} (100%) rename drivers/staging/greybus/Documentation/sysfs/endo-TYPE/{SVC => svc}/firmware (100%) rename drivers/staging/greybus/Documentation/sysfs/endo-TYPE/{SVC => svc}/serial_number (100%) rename drivers/staging/greybus/Documentation/sysfs/endo-TYPE/{Endo/endo_id => svc/version} (100%) diff --git a/drivers/staging/greybus/Documentation/sysfs-bus-greybus b/drivers/staging/greybus/Documentation/sysfs-bus-greybus index 738dcff..9cd3e02 100644 --- a/drivers/staging/greybus/Documentation/sysfs-bus-greybus +++ b/drivers/staging/greybus/Documentation/sysfs-bus-greybus @@ -7,7 +7,7 @@ Description: replaced with the numeric value of the endo layout scheme as documented in the ARA Module Developer Kit. -What: /sys/bus/greybus/device/endo-0xXXXX/Endo/id +What: /sys/bus/greybus/device/endo-0xXXXX/id Date: October 2015 KernelVersion: 4.XX Contact: Greg Kroah-Hartman @@ -16,7 +16,7 @@ Description: defined by the the Endo layout scheme, documented in the ARA Module Developer Kit. -What: /sys/bus/greybus/device/endo-0xXXXX/Endo/ap_intf_id +What: /sys/bus/greybus/device/endo-0xXXXX/ap_intf_id Date: October 2015 KernelVersion: 4.XX Contact: Greg Kroah-Hartman @@ -26,14 +26,14 @@ Description: The interface positions are defined in the ARA Module Developer Kit. -What: /sys/bus/greybus/device/endo-0xXXXX/SVC/serial_number +What: /sys/bus/greybus/device/endo-0xXXXX/svc/serial_number Date: October 2015 KernelVersion: 4.XX Contact: Greg Kroah-Hartman Description: The serial number of the SVC device -What: /sys/bus/greybus/device/endo-0xXXXX/SVC/version +What: /sys/bus/greybus/device/endo-0xXXXX/svc/version Date: October 2015 KernelVersion: 4.XX Contact: Greg Kroah-Hartman diff --git a/drivers/staging/greybus/Documentation/sysfs/endo-TYPE/Endo/ap_intf_id b/drivers/staging/greybus/Documentation/sysfs/endo-TYPE/ap_intf_id similarity index 100% rename from drivers/staging/greybus/Documentation/sysfs/endo-TYPE/Endo/ap_intf_id rename to drivers/staging/greybus/Documentation/sysfs/endo-TYPE/ap_intf_id diff --git a/drivers/staging/greybus/Documentation/sysfs/endo-TYPE/SVC/version b/drivers/staging/greybus/Documentation/sysfs/endo-TYPE/id similarity index 100% rename from drivers/staging/greybus/Documentation/sysfs/endo-TYPE/SVC/version rename to drivers/staging/greybus/Documentation/sysfs/endo-TYPE/id diff --git a/drivers/staging/greybus/Documentation/sysfs/endo-TYPE/SVC/firmware b/drivers/staging/greybus/Documentation/sysfs/endo-TYPE/svc/firmware similarity index 100% rename from drivers/staging/greybus/Documentation/sysfs/endo-TYPE/SVC/firmware rename to drivers/staging/greybus/Documentation/sysfs/endo-TYPE/svc/firmware diff --git a/drivers/staging/greybus/Documentation/sysfs/endo-TYPE/SVC/serial_number b/drivers/staging/greybus/Documentation/sysfs/endo-TYPE/svc/serial_number similarity index 100% rename from drivers/staging/greybus/Documentation/sysfs/endo-TYPE/SVC/serial_number rename to drivers/staging/greybus/Documentation/sysfs/endo-TYPE/svc/serial_number diff --git a/drivers/staging/greybus/Documentation/sysfs/endo-TYPE/Endo/endo_id b/drivers/staging/greybus/Documentation/sysfs/endo-TYPE/svc/version similarity index 100% rename from drivers/staging/greybus/Documentation/sysfs/endo-TYPE/Endo/endo_id rename to drivers/staging/greybus/Documentation/sysfs/endo-TYPE/svc/version diff --git a/drivers/staging/greybus/endo.c b/drivers/staging/greybus/endo.c index 1e8485b..aa89868 100644 --- a/drivers/staging/greybus/endo.c +++ b/drivers/staging/greybus/endo.c @@ -44,43 +44,43 @@ (4 + ((endo_layout)->max_ribs + 1) * 2) /* endo sysfs attributes */ -static ssize_t svc_serial_number_show(struct device *dev, +static ssize_t serial_number_show(struct device *dev, struct device_attribute *attr, char *buf) { struct gb_endo *endo = to_gb_endo(dev); return sprintf(buf, "%s", &endo->svc_info.serial_number[0]); } -static DEVICE_ATTR_RO(svc_serial_number); +static DEVICE_ATTR_RO(serial_number); -static ssize_t svc_version_show(struct device *dev, +static ssize_t version_show(struct device *dev, struct device_attribute *attr, char *buf) { struct gb_endo *endo = to_gb_endo(dev); return sprintf(buf, "%s", &endo->svc_info.version[0]); } -static DEVICE_ATTR_RO(svc_version); +static DEVICE_ATTR_RO(version); static struct attribute *svc_attrs[] = { - &dev_attr_svc_serial_number.attr, - &dev_attr_svc_version.attr, + &dev_attr_serial_number.attr, + &dev_attr_version.attr, NULL, }; static const struct attribute_group svc_group = { .attrs = svc_attrs, - .name = "SVC", + .name = "svc", }; -static ssize_t endo_id_show(struct device *dev, +static ssize_t id_show(struct device *dev, struct device_attribute *attr, char *buf) { struct gb_endo *endo = to_gb_endo(dev); return sprintf(buf, "0x%04x", endo->id); } -static DEVICE_ATTR_RO(endo_id); +static DEVICE_ATTR_RO(id); static ssize_t ap_intf_id_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -92,14 +92,13 @@ static ssize_t ap_intf_id_show(struct device *dev, static DEVICE_ATTR_RO(ap_intf_id); static struct attribute *endo_attrs[] = { - &dev_attr_endo_id.attr, + &dev_attr_id.attr, &dev_attr_ap_intf_id.attr, NULL, }; static const struct attribute_group endo_group = { .attrs = endo_attrs, - .name = "Endo", }; static const struct attribute_group *endo_groups[] = { -- 2.7.4