summaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon.c
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2016-07-18 08:39:28 +0200
committerChanwoo Choi <cw00.choi@samsung.com>2016-08-08 03:58:36 +0200
commit5d5321e90a69881a6e92604b73f7c8e8ca473373 (patch)
tree1daa641dd53683e0636ad2ff66169562d858c24b /drivers/extcon/extcon.c
parentextcon: gpio: Remove the usage of extcon_set_state() (diff)
downloadlinux-5d5321e90a69881a6e92604b73f7c8e8ca473373.tar.xz
linux-5d5321e90a69881a6e92604b73f7c8e8ca473373.zip
extcon: Remove the state_store() to prevent the wrong access
This patch removes the state_store() which change the state of external connectors with bit masking on user-space. It is wrong access to modify the change the state of external connectors. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to '')
-rw-r--r--drivers/extcon/extcon.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index 319659c6af28..ad5e4546f82c 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -174,26 +174,7 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr,
return count;
}
-
-static ssize_t state_store(struct device *dev, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- u32 state;
- ssize_t ret = 0;
- struct extcon_dev *edev = dev_get_drvdata(dev);
-
- ret = sscanf(buf, "0x%x", &state);
- if (ret == 0)
- ret = -EINVAL;
- else
- ret = extcon_set_state(edev, state);
-
- if (ret < 0)
- return ret;
-
- return count;
-}
-static DEVICE_ATTR_RW(state);
+static DEVICE_ATTR_RO(state);
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
char *buf)