diff options
author | Venu Byravarasu <vbyravarasu@nvidia.com> | 2012-06-01 15:18:47 +0530 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-06-04 14:20:56 -0700 |
commit | 8b1478527df8856e9c9b57e5234fe931cf96d252 (patch) | |
tree | a4e9cf49bb717d2afff2ad7cbee607623847dd6c | |
parent | aa52019b1b10988afaf210abbf321d41b7803804 (diff) |
usb: otg: tegra: using sscanf in enable_host store functionality
Replaced kstrtoul with sscanf.
Change-Id: I1c82e92bf43d2ceba6ac3a7c0090394ba3497f13
Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Reviewed-on: http://git-master/r/105888
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
-rw-r--r-- | drivers/usb/otg/tegra-otg.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/otg/tegra-otg.c b/drivers/usb/otg/tegra-otg.c index f91a8f8f78e7..2719a62f873d 100644 --- a/drivers/usb/otg/tegra-otg.c +++ b/drivers/usb/otg/tegra-otg.c @@ -366,10 +366,8 @@ static ssize_t store_host_en(struct device *dev, struct device_attribute *attr, unsigned long host; int err; - err = kstrtoul(buf, 10, &host); - if (err < 0) { - return err; - } + if (sscanf(buf, "%d", &host) != 1 || host < 0 || host > 1) + return -EINVAL; if (host) { enable_interrupt(tegra, false); |