Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[GitHub/LineageOS/android_kernel_samsung_universal7580.git] / drivers / input / tablet / aiptek.c
index d5ef3debd0455c8cb792e21e60bde573c37ce069..205d16aab441990283afd4f0068f97b106dcd198 100644 (file)
@@ -1198,9 +1198,9 @@ static ssize_t
 store_tabletXtilt(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 {
        struct aiptek *aiptek = dev_get_drvdata(dev);
-       long x;
+       int x;
 
-       if (strict_strtol(buf, 10, &x)) {
+       if (kstrtoint(buf, 10, &x)) {
                size_t len = buf[count - 1] == '\n' ? count - 1 : count;
 
                if (strncmp(buf, "disable", len))
@@ -1240,9 +1240,9 @@ static ssize_t
 store_tabletYtilt(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 {
        struct aiptek *aiptek = dev_get_drvdata(dev);
-       long y;
+       int y;
 
-       if (strict_strtol(buf, 10, &y)) {
+       if (kstrtoint(buf, 10, &y)) {
                size_t len = buf[count - 1] == '\n' ? count - 1 : count;
 
                if (strncmp(buf, "disable", len))
@@ -1277,12 +1277,13 @@ static ssize_t
 store_tabletJitterDelay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 {
        struct aiptek *aiptek = dev_get_drvdata(dev);
-       long j;
+       int err, j;
 
-       if (strict_strtol(buf, 10, &j))
-               return -EINVAL;
+       err = kstrtoint(buf, 10, &j);
+       if (err)
+               return err;
 
-       aiptek->newSetting.jitterDelay = (int)j;
+       aiptek->newSetting.jitterDelay = j;
        return count;
 }
 
@@ -1306,12 +1307,13 @@ static ssize_t
 store_tabletProgrammableDelay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 {
        struct aiptek *aiptek = dev_get_drvdata(dev);
-       long d;
+       int err, d;
 
-       if (strict_strtol(buf, 10, &d))
-               return -EINVAL;
+       err = kstrtoint(buf, 10, &d);
+       if (err)
+               return err;
 
-       aiptek->newSetting.programmableDelay = (int)d;
+       aiptek->newSetting.programmableDelay = d;
        return count;
 }
 
@@ -1557,11 +1559,13 @@ static ssize_t
 store_tabletWheel(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 {
        struct aiptek *aiptek = dev_get_drvdata(dev);
-       long w;
+       int err, w;
 
-       if (strict_strtol(buf, 10, &w)) return -EINVAL;
+       err = kstrtoint(buf, 10, &w);
+       if (err)
+               return err;
 
-       aiptek->newSetting.wheel = (int)w;
+       aiptek->newSetting.wheel = w;
        return count;
 }