diff options
author | Mattias Wallin <mattias.wallin@stericsson.com> | 2012-03-01 11:06:06 +0100 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:07:27 +0200 |
commit | adf9fa7b2e81465eead46f8b6e8737d559da9e60 (patch) | |
tree | 77db613f1d44ada732d9870964efdabdc490e40a | |
parent | 5885e4a2af9b0f4e4d0fd4decfab42563d24b477 (diff) |
sim_detect: file access for SIM voltage changed
Allow userspace not beeing root to update the SIM
voltage level through sysfs. Modem needs to go via userspace
to update the voltage level and that program is currently not root.
Also change sysfs return value when a faulty input is given.
ST-Ericsson ID: 411141
ST-Ericsson FOSS-OUT ID: Trivial
ST-Ericsson Linux next: -
Change-Id: I3ba59721197b8bd10482806a5471ad635d045bf1
Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/51080
Reviewed-by: Teddie STENVI <teddie.xx.stenvi@stericsson.com>
Reviewed-by: Bibek BASU <bibek.basu@stericsson.com>
Reviewed-by: Bengt JONSSON <bengt.g.jonsson@stericsson.com>
-rw-r--r-- | drivers/misc/sim_detect.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/misc/sim_detect.c b/drivers/misc/sim_detect.c index 6e6446d0fc5..20975c8d4b5 100644 --- a/drivers/misc/sim_detect.c +++ b/drivers/misc/sim_detect.c @@ -64,7 +64,7 @@ static ssize_t write_voltage(struct device *dev, struct device_attribute *attr, /* check input */ if (strict_strtol(buf, 0, &val) != 0) { dev_err(dev, "Invalid voltage class configured.\n"); - return count; + return -EINVAL; } switch (val) { @@ -75,7 +75,7 @@ static ssize_t write_voltage(struct device *dev, struct device_attribute *attr, break; default: dev_err(dev, "Invalid voltage class configured.\n"); - return count; + return -EINVAL; } /* lock */ @@ -117,7 +117,7 @@ out_unlock: return count; } -static DEVICE_ATTR(voltage, S_IWUSR | S_IRUGO, show_voltage, write_voltage); +static DEVICE_ATTR(voltage, S_IWUGO | S_IRUGO, show_voltage, write_voltage); static struct attribute *sim_attributes[] = { &dev_attr_voltage.attr, |