Skip to content

Commit d37f250

Browse files
lylezhu2012kartben
authored andcommitted
Bluetooth: HFP_AG: Change "-EOPNOTSUPP" to "-ENOEXEC"
There is an error reported in platform `native_sim` that the value of `EOPNOTSUPP` is same as `ENOTSUP`. It cause the building error `duplicate case value '-95'` reported. Use `ENOEXEC` to replace `EOPNOTSUPP` to fix the building issue. Signed-off-by: Lyle Zhu <[email protected]>
1 parent 68d2526 commit d37f250

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

subsys/bluetooth/host/classic/hfp_ag.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static enum at_cme bt_hfp_ag_get_cme_err(int err)
156156
enum at_cme cme_err;
157157

158158
switch (err) {
159-
case -EOPNOTSUPP:
159+
case -ENOEXEC:
160160
cme_err = CME_ERROR_OPERATION_NOT_SUPPORTED;
161161
break;
162162
case -EFAULT:
@@ -961,7 +961,7 @@ static int bt_hfp_ag_bac_handler(struct bt_hfp_ag *ag, struct net_buf *buf)
961961
if (!(ag->hf_features & BT_HFP_HF_FEATURE_CODEC_NEG) ||
962962
!(ag->ag_features & BT_HFP_AG_FEATURE_CODEC_NEG)) {
963963
hfp_ag_unlock(ag);
964-
return -EOPNOTSUPP;
964+
return -ENOEXEC;
965965
}
966966
hfp_ag_unlock(ag);
967967

@@ -983,7 +983,7 @@ static int bt_hfp_ag_bac_handler(struct bt_hfp_ag *ag, struct net_buf *buf)
983983
}
984984

985985
if (!(codec_ids & BIT(BT_HFP_AG_CODEC_CVSD))) {
986-
return -EOPNOTSUPP;
986+
return -ENOEXEC;
987987
}
988988

989989
hfp_ag_lock(ag);
@@ -1380,7 +1380,7 @@ static int chld_drop_conversation(struct bt_hfp_ag *ag)
13801380
}
13811381

13821382
if (!bt_ag || !bt_ag->explicit_call_transfer) {
1383-
return -EOPNOTSUPP;
1383+
return -ENOEXEC;
13841384
}
13851385

13861386
bt_ag->explicit_call_transfer(ag);
@@ -1495,13 +1495,13 @@ static int chld_other(struct bt_hfp_ag *ag, uint32_t value)
14951495
command = value / 10;
14961496

14971497
if (!index) {
1498-
return -EOPNOTSUPP;
1498+
return -ENOEXEC;
14991499
}
15001500

15011501
index = index - 1;
15021502

15031503
if (index >= ARRAY_SIZE(ag->calls)) {
1504-
return -EOPNOTSUPP;
1504+
return -ENOEXEC;
15051505
}
15061506

15071507
switch (command) {
@@ -1511,7 +1511,7 @@ static int chld_other(struct bt_hfp_ag *ag, uint32_t value)
15111511
return chld_held_other_calls(ag, index);
15121512
}
15131513

1514-
return -EOPNOTSUPP;
1514+
return -ENOEXEC;
15151515
}
15161516
#endif /* CONFIG_BT_HFP_AG_3WAY_CALL */
15171517

@@ -1526,7 +1526,7 @@ static int bt_hfp_ag_chld_handler(struct bt_hfp_ag *ag, struct net_buf *buf)
15261526
if (!((ag->ag_features & BT_HFP_AG_FEATURE_3WAY_CALL) &&
15271527
(ag->hf_features & BT_HFP_HF_FEATURE_3WAY_CALL))) {
15281528
hfp_ag_unlock(ag);
1529-
return -EOPNOTSUPP;
1529+
return -ENOEXEC;
15301530
}
15311531
hfp_ag_unlock(ag);
15321532

@@ -1568,7 +1568,7 @@ static int bt_hfp_ag_chld_handler(struct bt_hfp_ag *ag, struct net_buf *buf)
15681568

15691569
return chld_other(ag, value);
15701570
#else
1571-
return -EOPNOTSUPP;
1571+
return -ENOEXEC;
15721572
#endif /* CONFIG_BT_HFP_AG_3WAY_CALL */
15731573
}
15741574

@@ -1585,7 +1585,7 @@ static int bt_hfp_ag_bind_handler(struct bt_hfp_ag *ag, struct net_buf *buf)
15851585
if (!((ag->ag_features & BT_HFP_AG_FEATURE_HF_IND) &&
15861586
(ag->hf_features & BT_HFP_HF_FEATURE_HF_IND))) {
15871587
hfp_ag_unlock(ag);
1588-
return -EOPNOTSUPP;
1588+
return -ENOEXEC;
15891589
}
15901590
hfp_ag_unlock(ag);
15911591

@@ -2550,7 +2550,7 @@ static int bt_hfp_ag_outgoing_call(struct bt_hfp_ag *ag, const char *number, uin
25502550
#if defined(CONFIG_BT_HFP_AG_3WAY_CALL)
25512551
if (!((ag->ag_features & BT_HFP_AG_FEATURE_3WAY_CALL) &&
25522552
(ag->hf_features & BT_HFP_HF_FEATURE_3WAY_CALL))) {
2553-
return -EOPNOTSUPP;
2553+
return -ENOEXEC;
25542554
}
25552555

25562556
if (!get_active_held_calls(ag)) {
@@ -2908,7 +2908,7 @@ static int bt_hfp_ag_ccwa_handler(struct bt_hfp_ag *ag, struct net_buf *buf)
29082908
if (!((ag->ag_features & BT_HFP_AG_FEATURE_3WAY_CALL) &&
29092909
(ag->hf_features & BT_HFP_HF_FEATURE_3WAY_CALL))) {
29102910
hfp_ag_unlock(ag);
2911-
return -EOPNOTSUPP;
2911+
return -ENOEXEC;
29122912
}
29132913
hfp_ag_unlock(ag);
29142914

@@ -2990,7 +2990,7 @@ static int bt_hfp_ag_bvra_handler(struct bt_hfp_ag *ag, struct net_buf *buf)
29902990
if (!((ag->ag_features & BT_HFP_AG_FEATURE_VOICE_RECG) &&
29912991
(ag->hf_features & BT_HFP_HF_FEATURE_VOICE_RECG))) {
29922992
hfp_ag_unlock(ag);
2993-
return -EOPNOTSUPP;
2993+
return -ENOEXEC;
29942994
}
29952995
hfp_ag_unlock(ag);
29962996

@@ -3029,7 +3029,7 @@ static int bt_hfp_ag_bvra_handler(struct bt_hfp_ag *ag, struct net_buf *buf)
30293029
(ag->hf_features & BT_HFP_HF_FEATURE_ENH_VOICE_RECG))) {
30303030
hfp_ag_unlock(ag);
30313031
LOG_WRN("Enhance voice recognition is not supported");
3032-
return -EOPNOTSUPP;
3032+
return -ENOEXEC;
30333033
}
30343034
hfp_ag_unlock(ag);
30353035
if (!atomic_test_bit(ag->flags, BT_HFP_AG_VRE_ACTIVATE)) {
@@ -3056,7 +3056,7 @@ static int bt_hfp_ag_binp_handler(struct bt_hfp_ag *ag, struct net_buf *buf)
30563056
hfp_ag_lock(ag);
30573057
if (!(ag->ag_features & BT_HFP_AG_FEATURE_VOICE_TAG)) {
30583058
hfp_ag_unlock(ag);
3059-
return -EOPNOTSUPP;
3059+
return -ENOEXEC;
30603060
}
30613061
hfp_ag_unlock(ag);
30623062

@@ -3284,7 +3284,7 @@ static void hfp_ag_recv(struct bt_rfcomm_dlc *dlc, struct net_buf *buf)
32843284
uint8_t *data = buf->data;
32853285
uint16_t len = buf->len;
32863286
enum at_cme cme_err;
3287-
int err = -EOPNOTSUPP;
3287+
int err = -ENOEXEC;
32883288

32893289
LOG_HEXDUMP_DBG(data, len, "Received:");
32903290

@@ -3868,7 +3868,7 @@ int bt_hfp_ag_remote_incoming(struct bt_hfp_ag *ag, const char *number)
38683868
if (!((ag->ag_features & BT_HFP_AG_FEATURE_3WAY_CALL) &&
38693869
(ag->hf_features & BT_HFP_HF_FEATURE_3WAY_CALL))) {
38703870
LOG_WRN("3 Way call feature is not supported on both sides");
3871-
return -EOPNOTSUPP;
3871+
return -ENOEXEC;
38723872
}
38733873

38743874
if (!atomic_test_bit(ag->flags, BT_HFP_AG_CCWA_ENABLE)) {

0 commit comments

Comments
 (0)