summaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon.c
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2016-06-30 13:41:18 -0400
committerChanwoo Choi <cw00.choi@samsung.com>2016-08-07 21:58:36 -0400
commit912465bcf869660900cf77c4761869048f3ff063 (patch)
tree2b04bc845cb5e76a70246790059c5016fc8c7d69 /drivers/extcon/extcon.c
parent5d5321e90a69881a6e92604b73f7c8e8ca473373 (diff)
extcon: Block the bit masking operation for cable state except for extcon core
This patch restrict the usage of extcon_update_state() in the extcon core because the extcon_update_state() use the bit masking to change the state of external connector. When this function is used in device drivers, it may occur the probelm with the handling mistake of bit masking. Also, this patch removes the extcon_get/set_state() functions because these functions use the bit masking which is reluctant way. Instead, extcon provides the extcon_set/get_cable_state_() functions. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon/extcon.c')
-rw-r--r--drivers/extcon/extcon.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index ad5e4546f82c..5b61000cde26 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -224,7 +224,7 @@ static ssize_t cable_state_show(struct device *dev,
224 * Note that the notifier provides which bits are changed in the state 224 * Note that the notifier provides which bits are changed in the state
225 * variable with the val parameter (second) to the callback. 225 * variable with the val parameter (second) to the callback.
226 */ 226 */
227int extcon_update_state(struct extcon_dev *edev, u32 mask, u32 state) 227static int extcon_update_state(struct extcon_dev *edev, u32 mask, u32 state)
228{ 228{
229 char name_buf[120]; 229 char name_buf[120];
230 char state_buf[120]; 230 char state_buf[120];
@@ -300,24 +300,6 @@ int extcon_update_state(struct extcon_dev *edev, u32 mask, u32 state)
300 300
301 return 0; 301 return 0;
302} 302}
303EXPORT_SYMBOL_GPL(extcon_update_state);
304
305/**
306 * extcon_set_state() - Set the cable attach states of the extcon device.
307 * @edev: the extcon device
308 * @state: new cable attach status for @edev
309 *
310 * Note that notifier provides which bits are changed in the state
311 * variable with the val parameter (second) to the callback.
312 */
313int extcon_set_state(struct extcon_dev *edev, u32 state)
314{
315 if (!edev)
316 return -EINVAL;
317
318 return extcon_update_state(edev, 0xffffffff, state);
319}
320EXPORT_SYMBOL_GPL(extcon_set_state);
321 303
322/** 304/**
323 * extcon_get_cable_state_() - Get the status of a specific cable. 305 * extcon_get_cable_state_() - Get the status of a specific cable.