Skip to content

Commit 10011fd

Browse files
Thalleygalak
authored andcommitted
Bluetooth: Audio: Update VOCS conn check return value
Change the return value from -ENOTCONN to -EINVAL as that is a more appropriate return value for checking a NULL pointer. Signed-off-by: Emil Gydesen <[email protected]>
1 parent a9efa14 commit 10011fd

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

subsys/bluetooth/audio/vocs_client.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,9 @@ int bt_vocs_client_state_get(struct bt_conn *conn, struct bt_vocs *inst)
422422
{
423423
int err;
424424

425-
CHECKIF(!conn) {
425+
CHECKIF(conn == NULL) {
426426
BT_DBG("NULL conn");
427-
return -ENOTCONN;
427+
return -EINVAL;
428428
}
429429

430430
CHECKIF(!inst) {
@@ -457,9 +457,9 @@ int bt_vocs_client_state_get(struct bt_conn *conn, struct bt_vocs *inst)
457457

458458
int bt_vocs_client_location_set(struct bt_conn *conn, struct bt_vocs *inst, uint32_t location)
459459
{
460-
CHECKIF(!conn) {
460+
CHECKIF(conn == NULL) {
461461
BT_DBG("NULL conn");
462-
return -ENOTCONN;
462+
return -EINVAL;
463463
}
464464

465465
CHECKIF(!inst) {
@@ -486,9 +486,9 @@ int bt_vocs_client_location_get(struct bt_conn *conn, struct bt_vocs *inst)
486486
{
487487
int err;
488488

489-
CHECKIF(!conn) {
489+
CHECKIF(conn == NULL) {
490490
BT_DBG("NULL conn");
491-
return -ENOTCONN;
491+
return -EINVAL;
492492
}
493493

494494
CHECKIF(!inst) {
@@ -520,9 +520,9 @@ int bt_vocs_client_state_set(struct bt_conn *conn, struct bt_vocs *inst, int16_t
520520
{
521521
int err;
522522

523-
CHECKIF(!conn) {
523+
CHECKIF(conn == NULL) {
524524
BT_DBG("NULL conn");
525-
return -ENOTCONN;
525+
return -EINVAL;
526526
}
527527

528528
CHECKIF(!inst) {
@@ -559,9 +559,9 @@ int bt_vocs_client_description_get(struct bt_conn *conn, struct bt_vocs *inst)
559559
{
560560
int err;
561561

562-
CHECKIF(!conn) {
562+
CHECKIF(conn == NULL) {
563563
BT_DBG("NULL conn");
564-
return -ENOTCONN;
564+
return -EINVAL;
565565
}
566566

567567
CHECKIF(!inst) {
@@ -592,9 +592,9 @@ int bt_vocs_client_description_get(struct bt_conn *conn, struct bt_vocs *inst)
592592
int bt_vocs_client_description_set(struct bt_conn *conn, struct bt_vocs *inst,
593593
const char *description)
594594
{
595-
CHECKIF(!conn) {
595+
CHECKIF(conn == NULL) {
596596
BT_DBG("NULL conn");
597-
return -ENOTCONN;
597+
return -EINVAL;
598598
}
599599

600600
CHECKIF(!inst) {

0 commit comments

Comments
 (0)