diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/gadget/storage_common.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/usb/gadget/storage_common.c b/drivers/usb/gadget/storage_common.c index 3179b8bb6ce..86fcebd89ab 100644 --- a/drivers/usb/gadget/storage_common.c +++ b/drivers/usb/gadget/storage_common.c | |||
@@ -704,10 +704,11 @@ static ssize_t fsg_store_ro(struct device *dev, struct device_attribute *attr, | |||
704 | ssize_t rc = count; | 704 | ssize_t rc = count; |
705 | struct fsg_lun *curlun = fsg_lun_from_dev(dev); | 705 | struct fsg_lun *curlun = fsg_lun_from_dev(dev); |
706 | struct rw_semaphore *filesem = dev_get_drvdata(dev); | 706 | struct rw_semaphore *filesem = dev_get_drvdata(dev); |
707 | unsigned long ro; | 707 | unsigned ro; |
708 | 708 | ||
709 | if (strict_strtoul(buf, 2, &ro)) | 709 | rc = kstrtouint(buf, 2, &ro); |
710 | return -EINVAL; | 710 | if (rc) |
711 | return rc; | ||
711 | 712 | ||
712 | /* | 713 | /* |
713 | * Allow the write-enable status to change only while the | 714 | * Allow the write-enable status to change only while the |
@@ -731,10 +732,12 @@ static ssize_t fsg_store_nofua(struct device *dev, | |||
731 | const char *buf, size_t count) | 732 | const char *buf, size_t count) |
732 | { | 733 | { |
733 | struct fsg_lun *curlun = fsg_lun_from_dev(dev); | 734 | struct fsg_lun *curlun = fsg_lun_from_dev(dev); |
734 | unsigned long nofua; | 735 | unsigned nofua; |
736 | int ret; | ||
735 | 737 | ||
736 | if (strict_strtoul(buf, 2, &nofua)) | 738 | ret = kstrtouint(buf, 2, &nofua); |
737 | return -EINVAL; | 739 | if (ret) |
740 | return ret; | ||
738 | 741 | ||
739 | /* Sync data when switching from async mode to sync */ | 742 | /* Sync data when switching from async mode to sync */ |
740 | if (!nofua && curlun->nofua) | 743 | if (!nofua && curlun->nofua) |