arm: tegra: bbc: fix xxx_store_state() method
Julien Vuillaumier [Fri, 12 Apr 2013 13:50:34 +0000 (15:50 +0200)]
Function expects to receives a string that contains either keyword
or numerical value.
Remove unused integer conversion that returns with error code when
keyword is passed as argument ('enabled' or 'disabled').

bug 1271082

Change-Id: I704a5e65073251aaf9657a9e4d57907845cd80e6
Signed-off-by: Julien Vuillaumier <jvuillaumier@nvidia.com>
Reviewed-on: http://git-master/r/218951
Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
Tested-by: Thomas Cherry <tcherry@nvidia.com>
GVS: Gerrit_Virtual_Submit

arch/arm/mach-tegra/tegra_bbc_proxy.c

index 952f557..b37f1e2 100644 (file)
@@ -457,14 +457,10 @@ field ## _store_state(struct device *dev, struct device_attribute *attr,\
                      const char *buf, size_t count)                    \
 {                                                                      \
        struct tegra_bbc_proxy *bbc = dev_get_drvdata(dev);             \
-       int value;                                                      \
                                                                        \
        if (!bbc)                                                       \
                return -EAGAIN;                                         \
                                                                        \
-       if (sscanf(buf, "%d", &value) != 1)                             \
-               return -EINVAL;                                         \
-                                                                       \
        if (sysfs_streq(buf, "enabled\n") || sysfs_streq(buf, "1"))     \
                regulator_enable(bbc->field);                           \
        else if (sysfs_streq(buf, "disabled\n") ||                      \