diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2011-04-02 07:19:41 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-04-05 12:21:11 -0400 |
commit | db940cb0db7c69a217661ecd49e1e6b0d680a6cc (patch) | |
tree | 6946cd73ad7d914df6a650231c5791743ae6db33 /net/bluetooth/hci_sysfs.c | |
parent | e63a15ec0f25c0f97e8f6247b97ac9b30968b6b3 (diff) |
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.c | 34 |
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 | |||
277 | static ssize_t store_idle_timeout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 277 | static ssize_t store_idle_timeout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
278 | { | 278 | { |
279 | struct hci_dev *hdev = dev_get_drvdata(dev); | 279 | struct hci_dev *hdev = dev_get_drvdata(dev); |
280 | unsigned long val; | 280 | unsigned int val; |
281 | int rv; | ||
281 | 282 | ||
282 | if (strict_strtoul(buf, 0, &val) < 0) | 283 | rv = kstrtouint(buf, 0, &val); |
283 | return -EINVAL; | 284 | if (rv < 0) |
285 | return rv; | ||
284 | 286 | ||
285 | if (val != 0 && (val < 500 || val > 3600000)) | 287 | if (val != 0 && (val < 500 || val > 3600000)) |
286 | return -EINVAL; | 288 | return -EINVAL; |
@@ -299,15 +301,14 @@ static ssize_t show_sniff_max_interval(struct device *dev, struct device_attribu | |||
299 | static ssize_t store_sniff_max_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 301 | static ssize_t store_sniff_max_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
300 | { | 302 | { |
301 | struct hci_dev *hdev = dev_get_drvdata(dev); | 303 | struct hci_dev *hdev = dev_get_drvdata(dev); |
302 | unsigned long val; | 304 | u16 val; |
303 | 305 | int rv; | |
304 | if (strict_strtoul(buf, 0, &val) < 0) | ||
305 | return -EINVAL; | ||
306 | 306 | ||
307 | if (val < 0x0002 || val > 0xFFFE || val % 2) | 307 | rv = kstrtou16(buf, 0, &val); |
308 | return -EINVAL; | 308 | if (rv < 0) |
309 | return rv; | ||
309 | 310 | ||
310 | if (val < hdev->sniff_min_interval) | 311 | if (val == 0 || val % 2 || val < hdev->sniff_min_interval) |
311 | return -EINVAL; | 312 | return -EINVAL; |
312 | 313 | ||
313 | hdev->sniff_max_interval = val; | 314 | hdev->sniff_max_interval = val; |
@@ -324,15 +325,14 @@ static ssize_t show_sniff_min_interval(struct device *dev, struct device_attribu | |||
324 | static ssize_t store_sniff_min_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 325 | static ssize_t store_sniff_min_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
325 | { | 326 | { |
326 | struct hci_dev *hdev = dev_get_drvdata(dev); | 327 | struct hci_dev *hdev = dev_get_drvdata(dev); |
327 | unsigned long val; | 328 | u16 val; |
329 | int rv; | ||
328 | 330 | ||
329 | if (strict_strtoul(buf, 0, &val) < 0) | 331 | rv = kstrtou16(buf, 0, &val); |
330 | return -EINVAL; | 332 | if (rv < 0) |
331 | 333 | return rv; | |
332 | if (val < 0x0002 || val > 0xFFFE || val % 2) | ||
333 | return -EINVAL; | ||
334 | 334 | ||
335 | if (val > hdev->sniff_max_interval) | 335 | if (val == 0 || val % 2 || val > hdev->sniff_max_interval) |
336 | return -EINVAL; | 336 | return -EINVAL; |
337 | 337 | ||
338 | hdev->sniff_min_interval = val; | 338 | hdev->sniff_min_interval = val; |