Commit 81a1d5ea authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Felipe Balbi

usb: gadget: storage_common: use strtobool instead of kstrtouint

strtobool is more flexible for the user and is more appropriate in the
context.
Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 7f4d1e7b
...@@ -375,9 +375,9 @@ ssize_t fsg_store_ro(struct fsg_lun *curlun, struct rw_semaphore *filesem, ...@@ -375,9 +375,9 @@ ssize_t fsg_store_ro(struct fsg_lun *curlun, struct rw_semaphore *filesem,
const char *buf, size_t count) const char *buf, size_t count)
{ {
ssize_t rc; ssize_t rc;
unsigned ro; bool ro;
rc = kstrtouint(buf, 2, &ro); rc = strtobool(buf, &ro);
if (rc) if (rc)
return rc; return rc;
...@@ -402,10 +402,10 @@ EXPORT_SYMBOL(fsg_store_ro); ...@@ -402,10 +402,10 @@ EXPORT_SYMBOL(fsg_store_ro);
ssize_t fsg_store_nofua(struct fsg_lun *curlun, const char *buf, size_t count) ssize_t fsg_store_nofua(struct fsg_lun *curlun, const char *buf, size_t count)
{ {
unsigned nofua; bool nofua;
int ret; int ret;
ret = kstrtouint(buf, 2, &nofua); ret = strtobool(buf, &nofua);
if (ret) if (ret)
return ret; return ret;
...@@ -452,10 +452,10 @@ EXPORT_SYMBOL(fsg_store_file); ...@@ -452,10 +452,10 @@ EXPORT_SYMBOL(fsg_store_file);
ssize_t fsg_store_cdrom(struct fsg_lun *curlun, const char *buf, size_t count) ssize_t fsg_store_cdrom(struct fsg_lun *curlun, const char *buf, size_t count)
{ {
unsigned cdrom; bool cdrom;
int ret; int ret;
ret = kstrtouint(buf, 2, &cdrom); ret = strtobool(buf, &cdrom);
if (ret) if (ret)
return ret; return ret;
...@@ -468,10 +468,10 @@ EXPORT_SYMBOL(fsg_store_cdrom); ...@@ -468,10 +468,10 @@ EXPORT_SYMBOL(fsg_store_cdrom);
ssize_t fsg_store_removable(struct fsg_lun *curlun, const char *buf, ssize_t fsg_store_removable(struct fsg_lun *curlun, const char *buf,
size_t count) size_t count)
{ {
unsigned removable; bool removable;
int ret; int ret;
ret = kstrtouint(buf, 2, &removable); ret = strtobool(buf, &removable);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment