linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: storage_common: use kstrto*()
@ 2011-04-13 22:37 Michal Nazarewicz
  2011-04-14  0:40 ` [PATCHv2] " Michal Nazarewicz
  2011-04-14 10:29 ` [PATCH] usb: gadget: storage_common: use kstrto*() Sergei Shtylyov
  0 siblings, 2 replies; 6+ messages in thread
From: Michal Nazarewicz @ 2011-04-13 22:37 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alan Stern, linux-usb, linux-kernel

This commit replaces the usage of strict_strtoul() (which
became deprecated after commit 33ee3b2e) with kstrtouint().

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
---
 drivers/usb/gadget/storage_common.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

Feel free to ignore the patch.

diff --git a/drivers/usb/gadget/storage_common.c b/drivers/usb/gadget/storage_common.c
index b015561..109635a 100644
--- a/drivers/usb/gadget/storage_common.c
+++ b/drivers/usb/gadget/storage_common.c
@@ -711,10 +711,11 @@ static ssize_t fsg_store_ro(struct device *dev, struct device_attribute *attr,
 	ssize_t		rc = count;
 	struct fsg_lun	*curlun = fsg_lun_from_dev(dev);
 	struct rw_semaphore	*filesem = dev_get_drvdata(dev);
-	unsigned long	ro;
+	unsigned	ro;
 
-	if (strict_strtoul(buf, 2, &ro))
-		return -EINVAL;
+	rc = kstrtouint(buf, 2, &ro);
+	if (rc)
+		return rc;
 
 	/*
 	 * Allow the write-enable status to change only while the
@@ -738,10 +739,12 @@ static ssize_t fsg_store_nofua(struct device *dev,
 			       const char *buf, size_t count)
 {
 	struct fsg_lun	*curlun = fsg_lun_from_dev(dev);
-	unsigned long	nofua;
+	unsigned	nofua;
+	int		ret;
 
-	if (strict_strtoul(buf, 2, &nofua))
-		return -EINVAL;
+	ret = kstrtouint(buf, 2, &nofua);
+	if (ret)
+		return ret;
 
 	/* Sync data when switching from async mode to sync */
 	if (!nofua && curlun->nofua)
-- 
1.7.3.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-04-14 10:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-13 22:37 [PATCH] usb: gadget: storage_common: use kstrto*() Michal Nazarewicz
2011-04-14  0:40 ` [PATCHv2] " Michal Nazarewicz
2011-04-14  2:16   ` Greg KH
2011-04-14  9:55     ` [PATCH] usb: gadget: storage_common: use kstrto*() [bug fix] Michal Nazarewicz
2011-04-14 10:29 ` [PATCH] usb: gadget: storage_common: use kstrto*() Sergei Shtylyov
2011-04-14 10:32   ` Michal Nazarewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).