Skip to content

Commit 316c600

Browse files
committed
drivers: firmware: scmi: Rename SCMI_SHMEM_CHAN_STATUS_BUSY_BIT
Rename SCMI_SHMEM_CHAN_STATUS_BUSY_BIT to SCMI_SHMEM_CHAN_STATUS_FREE_BIT for clearer semantics (bit set = channel free, bit clear = channel busy) Signed-off-by: Yongxu Wang <[email protected]>
1 parent ee5f38f commit 316c600

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

drivers/firmware/scmi/mailbox.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static bool scmi_mbox_channel_is_free(const struct device *transport,
7474
struct scmi_mbox_channel *mbox_chan = chan->data;
7575

7676
return scmi_shmem_channel_status(mbox_chan->shmem) &
77-
SCMI_SHMEM_CHAN_STATUS_BUSY_BIT;
77+
SCMI_SHMEM_CHAN_STATUS_FREE_BIT;
7878
}
7979

8080
static int scmi_mbox_setup_chan(const struct device *transport,

drivers/firmware/scmi/shmem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ int scmi_shmem_write_message(const struct device *shmem, struct scmi_message *ms
133133
return -EINVAL;
134134
}
135135

136-
if (!(layout->chan_status & SCMI_SHMEM_CHAN_STATUS_BUSY_BIT)) {
136+
if (!(layout->chan_status & SCMI_SHMEM_CHAN_STATUS_FREE_BIT)) {
137137
return -EBUSY;
138138
}
139139

@@ -150,7 +150,7 @@ int scmi_shmem_write_message(const struct device *shmem, struct scmi_message *ms
150150
}
151151

152152
/* done, mark channel as busy and proceed */
153-
layout->chan_status &= ~SCMI_SHMEM_CHAN_STATUS_BUSY_BIT;
153+
layout->chan_status &= ~SCMI_SHMEM_CHAN_STATUS_FREE_BIT;
154154

155155
return 0;
156156
}

include/zephyr/drivers/firmware/scmi/shmem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <zephyr/arch/cpu.h>
1717
#include <errno.h>
1818

19-
#define SCMI_SHMEM_CHAN_STATUS_BUSY_BIT BIT(0)
19+
#define SCMI_SHMEM_CHAN_STATUS_FREE_BIT BIT(0)
2020
#define SCMI_SHMEM_CHAN_FLAG_IRQ_BIT BIT(0)
2121

2222
struct scmi_shmem_layout {

0 commit comments

Comments
 (0)