summaryrefslogtreecommitdiff
path: root/net/bluetooth/hci_sysfs.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2011-04-02 14:19:41 +0300
committerGustavo F. Padovan <padovan@profusion.mobi>2011-04-05 13:21:11 -0300
commitdb940cb0db7c69a217661ecd49e1e6b0d680a6cc (patch)
tree6946cd73ad7d914df6a650231c5791743ae6db33 /net/bluetooth/hci_sysfs.c
parente63a15ec0f25c0f97e8f6247b97ac9b30968b6b3 (diff)
downloadlwn-db940cb0db7c69a217661ecd49e1e6b0d680a6cc.tar.gz
lwn-db940cb0db7c69a217661ecd49e1e6b0d680a6cc.zip
Bluetooth: convert net/bluetooth/ to kstrtox
Convert from strict_strto*() interfaces to kstrto*() interfaces. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_sysfs.c')
-rw-r--r--net/bluetooth/hci_sysfs.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index e54421693eb8..8775933ea837 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -277,10 +277,12 @@ static ssize_t show_idle_timeout(struct device *dev, struct device_attribute *at
static ssize_t store_idle_timeout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{
struct hci_dev *hdev = dev_get_drvdata(dev);
- unsigned long val;
+ unsigned int val;
+ int rv;
- if (strict_strtoul(buf, 0, &val) < 0)
- return -EINVAL;
+ rv = kstrtouint(buf, 0, &val);
+ if (rv < 0)
+ return rv;
if (val != 0 && (val < 500 || val > 3600000))
return -EINVAL;
@@ -299,15 +301,14 @@ static ssize_t show_sniff_max_interval(struct device *dev, struct device_attribu
static ssize_t store_sniff_max_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{
struct hci_dev *hdev = dev_get_drvdata(dev);
- unsigned long val;
-
- if (strict_strtoul(buf, 0, &val) < 0)
- return -EINVAL;
+ u16 val;
+ int rv;
- if (val < 0x0002 || val > 0xFFFE || val % 2)
- return -EINVAL;
+ rv = kstrtou16(buf, 0, &val);
+ if (rv < 0)
+ return rv;
- if (val < hdev->sniff_min_interval)
+ if (val == 0 || val % 2 || val < hdev->sniff_min_interval)
return -EINVAL;
hdev->sniff_max_interval = val;
@@ -324,15 +325,14 @@ static ssize_t show_sniff_min_interval(struct device *dev, struct device_attribu
static ssize_t store_sniff_min_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{
struct hci_dev *hdev = dev_get_drvdata(dev);
- unsigned long val;
+ u16 val;
+ int rv;
- if (strict_strtoul(buf, 0, &val) < 0)
- return -EINVAL;
-
- if (val < 0x0002 || val > 0xFFFE || val % 2)
- return -EINVAL;
+ rv = kstrtou16(buf, 0, &val);
+ if (rv < 0)
+ return rv;
- if (val > hdev->sniff_max_interval)
+ if (val == 0 || val % 2 || val > hdev->sniff_max_interval)
return -EINVAL;
hdev->sniff_min_interval = val;