usb: gadget: storage_common: use kstrto*()
This commit replaces the usage of strict_strtoul() (which
became deprecated after commit 33ee3b2e
) with kstrtouint().
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
90e6ca5cda
commit
db8fa2852e
1 changed files with 9 additions and 6 deletions
|
@ -704,10 +704,11 @@ static ssize_t fsg_store_ro(struct device *dev, struct device_attribute *attr,
|
||||||
ssize_t rc = count;
|
ssize_t rc = count;
|
||||||
struct fsg_lun *curlun = fsg_lun_from_dev(dev);
|
struct fsg_lun *curlun = fsg_lun_from_dev(dev);
|
||||||
struct rw_semaphore *filesem = dev_get_drvdata(dev);
|
struct rw_semaphore *filesem = dev_get_drvdata(dev);
|
||||||
unsigned long ro;
|
unsigned ro;
|
||||||
|
|
||||||
if (strict_strtoul(buf, 2, &ro))
|
rc = kstrtouint(buf, 2, &ro);
|
||||||
return -EINVAL;
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allow the write-enable status to change only while the
|
* Allow the write-enable status to change only while the
|
||||||
|
@ -731,10 +732,12 @@ static ssize_t fsg_store_nofua(struct device *dev,
|
||||||
const char *buf, size_t count)
|
const char *buf, size_t count)
|
||||||
{
|
{
|
||||||
struct fsg_lun *curlun = fsg_lun_from_dev(dev);
|
struct fsg_lun *curlun = fsg_lun_from_dev(dev);
|
||||||
unsigned long nofua;
|
unsigned nofua;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (strict_strtoul(buf, 2, &nofua))
|
ret = kstrtouint(buf, 2, &nofua);
|
||||||
return -EINVAL;
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
/* Sync data when switching from async mode to sync */
|
/* Sync data when switching from async mode to sync */
|
||||||
if (!nofua && curlun->nofua)
|
if (!nofua && curlun->nofua)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue