diff options
author | Dan Bogdan Nechita <dan.bogdan.nechita@gmail.com> | 2016-02-23 10:48:45 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-02 01:55:13 +0100 |
commit | 1bb850a1b7f68b66361e658e334f9fdf8231f17d (patch) | |
tree | d7bffea3f7cb600631c93615783c32e482a0c937 | |
parent | drivers/misc/ad525x_dpot: AD5274 fix RDAC read back errors (diff) | |
download | linux-1bb850a1b7f68b66361e658e334f9fdf8231f17d.tar.xz linux-1bb850a1b7f68b66361e658e334f9fdf8231f17d.zip |
misc: ad525x_dpot: Fix the enabling of the "otpXen" attributes
Currently writing the attributes with "echo" will result in comparing:
"enabled\n" with "enabled\0" and attribute is always set to false.
Use the sysfs_streq() instead because it treats both NUL and
new-line-then-NUL as equivalent string terminations.
Signed-off-by: Dan Bogdan Nechita <dan.bogdan.nechita@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/misc/ad525x_dpot.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c index f1a0b99f5a9a..fe1672747bc1 100644 --- a/drivers/misc/ad525x_dpot.c +++ b/drivers/misc/ad525x_dpot.c @@ -452,7 +452,7 @@ static ssize_t sysfs_set_reg(struct device *dev, int err; if (reg & DPOT_ADDR_OTP_EN) { - if (!strncmp(buf, "enabled", sizeof("enabled"))) + if (sysfs_streq(buf, "enabled")) set_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask); else clear_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask); |