summaryrefslogtreecommitdiff
path: root/drivers/extcon
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2016-07-18 15:39:28 +0900
committerHuang, Tao <huangtao@rock-chips.com>2016-08-03 09:45:30 +0800
commit0a5e7cc10c83976c466dd4b3939bd34724cd5e02 (patch)
tree5ec7ccd57bee0bc5afb974d60ab716ba2f876e6b /drivers/extcon
parent8693c5671ff59bfb5ace423ad4a0caf1bac5a287 (diff)
UPSTREAM: 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. Change-Id: I635e30e2a22ddc313ed90dc7ab0f7fdaa271ed1d Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Chris Zhong <zyw@rock-chips.com> (cherry picked from commit eeb820116207aa5dd71edbc0b8f0eaf3b20d77a1)
Diffstat (limited to 'drivers/extcon')
-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 540f7a0b0559..9c7bd53a9f65 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)