summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattias Wallin <mattias.wallin@stericsson.com>2012-03-01 11:06:06 +0100
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-06-05 10:40:32 +0200
commitbff3038b9cee56f1751ac4bb229a851dd7346e7e (patch)
tree7140455362d5c6a41a00469cf6c5d2b4b260f8af
parentfa3b6f6a31bccb6d19bdffbae57723013c8083aa (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.c6
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,