summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2017-04-14 18:35:09 -0700
committerStefan Agner <stefan.agner@toradex.com>2017-12-14 23:32:39 +0100
commit25ad1c3f7fe5fc7e5d41e1c6e3f79994ffda6c80 (patch)
tree94612060ee69a5466797808c116ce9494692dbf8
parent916f5680dd0d609d78b9e215258b63463f7571c6 (diff)
usb: gadget: configfs: use hexadecimal values and new line
Other unsigned properties return hexadecimal values, follow this convention when printing b_vendor_code too. Also add newlines to the OS Descriptor support related properties, like other sysfs files use. Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com> Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> (cherry picked from commit e800e8cbdf42c73602b90258f82a2cfe86ec53a7)
-rw-r--r--drivers/usb/gadget/configfs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index 9908d36..812374f 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -763,7 +763,7 @@ static ssize_t os_desc_use_show(struct os_desc *os_desc, char *page)
gi = to_gadget_info(os_desc->group.cg_item.ci_parent);
- return sprintf(page, "%d", gi->use_os_desc);
+ return sprintf(page, "%d\n", gi->use_os_desc);
}
static ssize_t os_desc_use_store(struct os_desc *os_desc, const char *page,
@@ -797,7 +797,7 @@ static ssize_t os_desc_b_vendor_code_show(struct os_desc *os_desc, char *page)
gi = to_gadget_info(os_desc->group.cg_item.ci_parent);
- return sprintf(page, "%d", gi->b_vendor_code);
+ return sprintf(page, "0x%02x\n", gi->b_vendor_code);
}
static ssize_t os_desc_b_vendor_code_store(struct os_desc *os_desc,
@@ -960,7 +960,7 @@ CONFIGFS_ATTR_OPS(usb_os_desc_ext_prop);
static ssize_t ext_prop_type_show(struct usb_os_desc_ext_prop *ext_prop,
char *page)
{
- return sprintf(page, "%d", ext_prop->type);
+ return sprintf(page, "%d\n", ext_prop->type);
}
static ssize_t ext_prop_type_store(struct usb_os_desc_ext_prop *ext_prop,