BigW Consortium Gitlab

Commit 82eb8f8d by David Frey

mt7697: Remove s2m_mbox from mt7697q_info

This member does not need to be persisted as it can simply be returned to the caller requesting the mailbox value.
parent 379eee2f
......@@ -189,7 +189,7 @@ cleanup:
return ret;
}
int mt7697io_rd_s2m_mbx(struct mt7697q_info *qinfo)
int mt7697io_rd_s2m_mbx(struct mt7697q_info *qinfo, u8 *s2m_mbx)
{
int ret;
u16 value;
......@@ -201,27 +201,25 @@ int mt7697io_rd_s2m_mbx(struct mt7697q_info *qinfo)
goto cleanup;
}
qinfo->s2m_mbox = mt7697io_get_s2m_mbox(value);
*s2m_mbx = mt7697io_get_s2m_mbox(value);
dev_dbg(qinfo->dev, "%s(): s2m mbx(0x%02x)\n",
__func__, qinfo->s2m_mbox);
__func__, *s2m_mbx);
cleanup:
return ret;
}
int mt7697io_clr_s2m_mbx(struct mt7697q_info *qinfo)
int mt7697io_clr_s2m_mbx(struct mt7697q_info *qinfo, u8 s2m_mbx)
{
const u16 value = mt7697io_set_s2m_mbox(qinfo->s2m_mbox);
const u16 value = mt7697io_set_s2m_mbox(s2m_mbx);
int ret;
ret = mt7697io_write16(qinfo, MT7697_IO_SLAVE_REG_MAILBOX_S2M, value);
if (ret < 0) {
dev_err(qinfo->dev, "%s(): mt7697io_write16() failed(%d)\n",
__func__, ret);
goto cleanup;
}
cleanup:
return ret;
}
......
......@@ -84,8 +84,8 @@
struct mt7697q_info;
int mt7697io_wr_m2s_mbx(struct mt7697q_info*, u8);
int mt7697io_rd_s2m_mbx(struct mt7697q_info*);
int mt7697io_clr_s2m_mbx(struct mt7697q_info*);
int mt7697io_rd_s2m_mbx(struct mt7697q_info*, u8*);
int mt7697io_clr_s2m_mbx(struct mt7697q_info*, u8);
int mt7697io_wr(struct mt7697q_info*, u32, const u32*, size_t);
int mt7697io_rd(struct mt7697q_info*, u32, u32*, size_t);
......
......@@ -330,24 +330,21 @@ size_t mt7697q_get_free_words(const struct mt7697q_spec *qs)
return mt7697q_get_capacity(qs) - mt7697q_get_num_words(qs);
}
int mt7697q_get_s2m_mbx(struct mt7697q_info *qinfo, u8* s2m_mbox)
int mt7697q_get_s2m_mbx(struct mt7697q_info *qinfo, u8 *s2m_mbox)
{
int ret;
mutex_lock(&qinfo->mutex);
ret = mt7697io_rd_s2m_mbx(qinfo);
if (ret < 0) {
ret = mt7697io_rd_s2m_mbx(qinfo, s2m_mbox);
if (ret < 0) {
dev_err(qinfo->dev, "%s(): mt7697io_rd_s2m_mbx() failed(%d)\n",
__func__, ret);
goto cleanup;
}
*s2m_mbox = qinfo->s2m_mbox;
ret = mt7697io_clr_s2m_mbx(qinfo);
if (ret < 0) {
ret = mt7697io_clr_s2m_mbx(qinfo, *s2m_mbox);
if (ret < 0) {
dev_err(qinfo->dev,
"%s(): mt7697io_clr_s2m_mbx() failed(%d)\n",
__func__, ret);
......
......@@ -68,7 +68,6 @@ struct mt7697q_info {
atomic_t blocked_writer;
int gpio_pin;
int irq;
u8 s2m_mbox;
};
void mt7697q_irq_delayed_work(struct work_struct*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment