extcon: madera: Fix up reporting of EXTCON_MECHANICAL state
authorStuart Henderson <stuarth@opensource.wolfsonmicro.com>
Tue, 16 May 2017 12:23:22 +0000 (13:23 +0100)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:27 +0000 (20:22 +0300)
Change-Id: I81c6a005bca49b776f71f1156e8f7ac7f24a7806
Signed-off-by: Stuart Henderson <stuarth@opensource.wolfsonmicro.com>
drivers/extcon/extcon-madera.c

index 4c7b10249a6b5e10243b81e539997910a79ad031..a0a565b3dc9380682ce2aaec8e98d3fe73ee5710 100644 (file)
@@ -2174,7 +2174,7 @@ static irqreturn_t madera_jackdet(int irq, void *data)
        struct madera *madera = info->madera;
        unsigned int val, mask;
        bool cancelled_state;
-       int i, present, ret;
+       int i, present;
 
        dev_dbg(info->dev, "jackdet IRQ");
 
@@ -2228,8 +2228,6 @@ static irqreturn_t madera_jackdet(int irq, void *data)
        } else {
                dev_dbg(info->dev, "Detected jack removal\n");
 
-               madera_extcon_report(info, EXTCON_MECHANICAL, false);
-
                info->have_mic = false;
                info->micd_res_old = 0;
                info->micd_debounce = 0;
@@ -2241,14 +2239,8 @@ static irqreturn_t madera_jackdet(int irq, void *data)
                                         info->micd_ranges[i].key, 0);
                input_sync(info->input);
 
-               for (i = 0; i < ARRAY_SIZE(madera_cable) - 1; i++) {
-                       ret = extcon_set_state_sync(info->edev,
-                                                   madera_cable[i],
-                                                   false);
-                       if (ret != 0)
-                               dev_err(info->dev,
-                                       "Removal report failed: %d\n", ret);
-               }
+               for (i = 0; i < ARRAY_SIZE(madera_cable) - 1; i++)
+                       madera_extcon_report(info, madera_cable[i], false);
 
                regmap_update_bits(madera->regmap, MADERA_INTERRUPT_DEBOUNCE_7,
                                   mask, mask);