aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/sysfs.c
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2011-07-07 18:14:19 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-08 11:47:13 -0400
commite2df64c1d767eb52a5c617668e20745d5e3015c8 (patch)
tree1ccaa6f8bc7cd5dd6f8859cfb2a482ef6f2032e3 /drivers/net/wireless/ath/ath5k/sysfs.c
parentath5k: fix formatting errors found by checkpatch.pl (diff)
downloadlinux-dev-e2df64c1d767eb52a5c617668e20745d5e3015c8.tar.xz
linux-dev-e2df64c1d767eb52a5c617668e20745d5e3015c8.zip
ath5k: use kstrtoint() to parse numbers coming from sysfs
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/sysfs.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/sysfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath5k/sysfs.c b/drivers/net/wireless/ath/ath5k/sysfs.c
index 1090bbab9459..5406f44309c8 100644
--- a/drivers/net/wireless/ath/ath5k/sysfs.c
+++ b/drivers/net/wireless/ath/ath5k/sysfs.c
@@ -19,9 +19,11 @@ static ssize_t ath5k_attr_store_##name(struct device *dev, \
const char *buf, size_t count) \
{ \
struct ath5k_softc *sc = dev_get_drvdata(dev); \
- int val; \
+ int val, ret; \
\
- val = (int)simple_strtoul(buf, NULL, 10); \
+ ret = kstrtoint(buf, 10, &val); \
+ if (ret < 0) \
+ return ret; \
set(sc->ah, val); \
return count; \
} \