BigW Consortium Gitlab

Commit 831a8bec by David Frey Committed by David Clark

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 c26c231f
...@@ -189,7 +189,7 @@ cleanup: ...@@ -189,7 +189,7 @@ cleanup:
return ret; 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; int ret;
u16 value; u16 value;
...@@ -201,27 +201,25 @@ int mt7697io_rd_s2m_mbx(struct mt7697q_info *qinfo) ...@@ -201,27 +201,25 @@ int mt7697io_rd_s2m_mbx(struct mt7697q_info *qinfo)
goto cleanup; 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", dev_dbg(qinfo->dev, "%s(): s2m mbx(0x%02x)\n",
__func__, qinfo->s2m_mbox); __func__, *s2m_mbx);
cleanup: cleanup:
return ret; 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; int ret;
ret = mt7697io_write16(qinfo, MT7697_IO_SLAVE_REG_MAILBOX_S2M, value); ret = mt7697io_write16(qinfo, MT7697_IO_SLAVE_REG_MAILBOX_S2M, value);
if (ret < 0) { if (ret < 0) {
dev_err(qinfo->dev, "%s(): mt7697io_write16() failed(%d)\n", dev_err(qinfo->dev, "%s(): mt7697io_write16() failed(%d)\n",
__func__, ret); __func__, ret);
goto cleanup;
} }
cleanup:
return ret; return ret;
} }
......
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
struct mt7697q_info; struct mt7697q_info;
int mt7697io_wr_m2s_mbx(struct mt7697q_info*, u8); int mt7697io_wr_m2s_mbx(struct mt7697q_info*, u8);
int mt7697io_rd_s2m_mbx(struct mt7697q_info*); int mt7697io_rd_s2m_mbx(struct mt7697q_info*, u8*);
int mt7697io_clr_s2m_mbx(struct mt7697q_info*); int mt7697io_clr_s2m_mbx(struct mt7697q_info*, u8);
int mt7697io_wr(struct mt7697q_info*, u32, const u32*, size_t); int mt7697io_wr(struct mt7697q_info*, u32, const u32*, size_t);
int mt7697io_rd(struct mt7697q_info*, u32, 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) ...@@ -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); 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; int ret;
mutex_lock(&qinfo->mutex); mutex_lock(&qinfo->mutex);
ret = mt7697io_rd_s2m_mbx(qinfo); ret = mt7697io_rd_s2m_mbx(qinfo, s2m_mbox);
if (ret < 0) { if (ret < 0) {
dev_err(qinfo->dev, "%s(): mt7697io_rd_s2m_mbx() failed(%d)\n", dev_err(qinfo->dev, "%s(): mt7697io_rd_s2m_mbx() failed(%d)\n",
__func__, ret); __func__, ret);
goto cleanup; goto cleanup;
} }
*s2m_mbox = qinfo->s2m_mbox; ret = mt7697io_clr_s2m_mbx(qinfo, *s2m_mbox);
if (ret < 0) {
ret = mt7697io_clr_s2m_mbx(qinfo);
if (ret < 0) {
dev_err(qinfo->dev, dev_err(qinfo->dev,
"%s(): mt7697io_clr_s2m_mbx() failed(%d)\n", "%s(): mt7697io_clr_s2m_mbx() failed(%d)\n",
__func__, ret); __func__, ret);
......
...@@ -68,7 +68,6 @@ struct mt7697q_info { ...@@ -68,7 +68,6 @@ struct mt7697q_info {
atomic_t blocked_writer; atomic_t blocked_writer;
int gpio_pin; int gpio_pin;
int irq; int irq;
u8 s2m_mbox;
}; };
void mt7697q_irq_delayed_work(struct work_struct*); 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