Skip to content

Commit

Permalink
greybus: endo: Add missing '\n' sprintf() for sysfs files
Browse files Browse the repository at this point in the history
Because of the missing '\n', this is how the output of reading endo
sysfs files looks:

root# cat /sys/bus/greybus/devices/endo/id
0x4755root#

Fix it by including \n to the end of the printed string.

Signed-off-by: Viresh Kumar <[email protected]>
Reviewed-by: Alex Elder <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
vireshk authored and gregkh committed Jun 4, 2015
1 parent 7ba864a commit 3cb494c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/greybus/endo.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static ssize_t serial_number_show(struct device *dev,
{
struct gb_endo *endo = to_gb_endo(dev);

return sprintf(buf, "%s", &endo->svc_info.serial_number[0]);
return sprintf(buf, "%s\n", &endo->svc_info.serial_number[0]);
}
static DEVICE_ATTR_RO(serial_number);

Expand All @@ -58,7 +58,7 @@ static ssize_t version_show(struct device *dev,
{
struct gb_endo *endo = to_gb_endo(dev);

return sprintf(buf, "%s", &endo->svc_info.version[0]);
return sprintf(buf, "%s\n", &endo->svc_info.version[0]);
}
static DEVICE_ATTR_RO(version);

Expand All @@ -78,7 +78,7 @@ static ssize_t id_show(struct device *dev,
{
struct gb_endo *endo = to_gb_endo(dev);

return sprintf(buf, "0x%04x", endo->id);
return sprintf(buf, "0x%04x\n", endo->id);
}
static DEVICE_ATTR_RO(id);

Expand All @@ -87,7 +87,7 @@ static ssize_t ap_intf_id_show(struct device *dev,
{
struct gb_endo *endo = to_gb_endo(dev);

return sprintf(buf, "0x%02x", endo->ap_intf_id);
return sprintf(buf, "0x%02x\n", endo->ap_intf_id);
}
static DEVICE_ATTR_RO(ap_intf_id);

Expand Down

0 comments on commit 3cb494c

Please sign in to comment.