aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/extcon/extcon-class.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/drivers/extcon/extcon-class.c b/drivers/extcon/extcon-class.c
index 60adc04b0561..a5a03ae069ee 100644
--- a/drivers/extcon/extcon-class.c
+++ b/drivers/extcon/extcon-class.c
@@ -185,26 +185,6 @@ static ssize_t cable_state_show(struct device *dev,
185 cable->cable_index)); 185 cable->cable_index));
186} 186}
187 187
188static ssize_t cable_state_store(struct device *dev,
189 struct device_attribute *attr, const char *buf,
190 size_t count)
191{
192 struct extcon_cable *cable = container_of(attr, struct extcon_cable,
193 attr_state);
194 int ret, state;
195
196 ret = sscanf(buf, "%d", &state);
197 if (ret == 0)
198 ret = -EINVAL;
199 else
200 ret = extcon_set_cable_state_(cable->edev, cable->cable_index,
201 state);
202
203 if (ret < 0)
204 return ret;
205 return count;
206}
207
208/** 188/**
209 * extcon_update_state() - Update the cable attach states of the extcon device 189 * extcon_update_state() - Update the cable attach states of the extcon device
210 * only for the masked bits. 190 * only for the masked bits.
@@ -665,9 +645,8 @@ int extcon_dev_register(struct extcon_dev *edev, struct device *dev)
665 645
666 sysfs_attr_init(&cable->attr_state.attr); 646 sysfs_attr_init(&cable->attr_state.attr);
667 cable->attr_state.attr.name = "state"; 647 cable->attr_state.attr.name = "state";
668 cable->attr_state.attr.mode = 0644; 648 cable->attr_state.attr.mode = 0444;
669 cable->attr_state.show = cable_state_show; 649 cable->attr_state.show = cable_state_show;
670 cable->attr_state.store = cable_state_store;
671 } 650 }
672 } 651 }
673 652