greybus: sysfs: put a \n at the end of all sysfs files
authorGreg Kroah-Hartman <greg@kroah.com>
Wed, 24 Dec 2014 00:09:26 +0000 (16:09 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 2 Jan 2015 21:08:03 +0000 (13:08 -0800)
Right now some sysfs attributes have \n and some do not, so fix that and
put \n at the end of all of them to make it easier to parse things
properly in userspace.

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/bundle.c
drivers/staging/greybus/connection.c

index 96153c5..d020660 100644 (file)
@@ -18,7 +18,7 @@ static ssize_t device_id_show(struct device *dev, struct device_attribute *attr,
 {
        struct gb_bundle *bundle = to_gb_bundle(dev);
 
-       return sprintf(buf, "%d", bundle->device_id);
+       return sprintf(buf, "%d\n", bundle->device_id);
 }
 static DEVICE_ATTR_RO(device_id);
 
index 82b03c3..c805022 100644 (file)
@@ -91,7 +91,7 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr,
 {
        struct gb_connection *connection = to_gb_connection(dev);
 
-       return sprintf(buf, "%d", connection->state);
+       return sprintf(buf, "%d\n", connection->state);
 }
 static DEVICE_ATTR_RO(state);
 
@@ -100,7 +100,7 @@ protocol_id_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
        struct gb_connection *connection = to_gb_connection(dev);
 
-       return sprintf(buf, "%d", connection->protocol->id);
+       return sprintf(buf, "%d\n", connection->protocol->id);
 }
 static DEVICE_ATTR_RO(protocol_id);