Commit ea9dd9d6 authored by Chanwoo Choi's avatar Chanwoo Choi Committed by Greg Kroah-Hartman

extcon: Change permission 'state' sysfs entry (rw -> r)

This patch change permission from read/write to only read.
The specific process in the user-space couldn't change the state
of cable when cable is attached or detached.
- /sys/class/extcon/[devine name]/state
Signed-off-by: default avatarChanwoo Choi <>
Signed-off-by: default avatarMyungjoo Ham <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 12e50c30
......@@ -185,26 +185,6 @@ static ssize_t cable_state_show(struct device *dev,
static ssize_t cable_state_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
struct extcon_cable *cable = container_of(attr, struct extcon_cable,
int ret, state;
ret = sscanf(buf, "%d", &state);
if (ret == 0)
ret = -EINVAL;
ret = extcon_set_cable_state_(cable->edev, cable->cable_index,
if (ret < 0)
return ret;
return count;
* extcon_update_state() - Update the cable attach states of the extcon device
* only for the masked bits.
......@@ -665,9 +645,8 @@ int extcon_dev_register(struct extcon_dev *edev, struct device *dev)
cable-> = "state";
cable->attr_state.attr.mode = 0644;
cable->attr_state.attr.mode = 0444;
cable-> = cable_state_show;
cable-> = cable_state_store;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment