From: Chanwoo Choi Date: Thu, 30 Jun 2016 17:36:49 +0000 (+0900) Subject: UPSTREAM: extcon: arizona: Remove the usage of extcon_update_state() X-Git-Tag: firefly_0821_release~2013 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8d3725ca479adaae476adb246fea6df99bd23e29;p=firefly-linux-kernel-4.4.55.git UPSTREAM: extcon: arizona: Remove the usage of extcon_update_state() This patch remvoes the usage of extcon_update_state() because the extcon_update_state() use directly the bit masking calculation to change the state of external connector without the unique id of external connector. It makes the code diffcult to read it. So, this patch uses the extcon_set_cable_state_() instead. Change-Id: I807cce6c46e37b32d5fbdbf65c45d1ddf6587996 Signed-off-by: Chanwoo Choi Acked-by: Charles Keepax Signed-off-by: Chris Zhong (cherry picked from commit af67ea70da0e8e906a81ae00d742c82ecda63a27) --- diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index 6d55ce90900b..5be668817d85 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c @@ -1149,10 +1149,13 @@ static irqreturn_t arizona_jackdet(int irq, void *data) info->micd_ranges[i].key, 0); input_sync(info->input); - ret = extcon_update_state(info->edev, 0xffffffff, 0); - if (ret != 0) - dev_err(arizona->dev, "Removal report failed: %d\n", - ret); + for (i = 0; i < ARRAY_SIZE(arizona_cable) - 1; i++) { + ret = extcon_set_cable_state_(info->edev, + arizona_cable[i], false); + if (ret != 0) + dev_err(arizona->dev, + "Removal report failed: %d\n", ret); + } regmap_update_bits(arizona->regmap, ARIZONA_JACK_DETECT_DEBOUNCE,