Thread (62 messages) 62 messages, 3 authors, 2017-09-05

Re: [PATCH 21/30] brcmfmac: Remove {r,w}_sdreg32

From: Arend van Spriel <arend.vanspriel@broadcom.com>
Date: 2017-09-05 21:20:50

On 22-08-17 13:25, Ian Molton wrote:
Remove yet another IO function from the code and replace with one
that already exists.
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
quoted hunk ↗ jump to hunk
Signed-off-by: Ian Molton <redacted>
---
  .../wireless/broadcom/brcm80211/brcmfmac/sdio.c    | 91 +++++++++++-----------
  1 file changed, 45 insertions(+), 46 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index 289ff61b7bf8..c1f3366871e5 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
[...]
quoted hunk ↗ jump to hunk
@@ -1075,6 +1051,8 @@ static void brcmf_sdio_get_console_addr(struct brcmf_sdio *bus)
  
  static u32 brcmf_sdio_hostmail(struct brcmf_sdio *bus)
  {
+	struct brcmf_sdio_dev *sdiod = bus->sdiodev;
+	struct brcmf_core *core = bus->sdio_core;
  	u32 intstatus = 0;
  	u32 hmb_data;
  	u8 fcbits;
@@ -1083,10 +1061,13 @@ static u32 brcmf_sdio_hostmail(struct brcmf_sdio *bus)
  	brcmf_dbg(SDIO, "Enter\n");
  
  	/* Read mailbox data and ack that we did so */
-	ret = r_sdreg32(bus, &hmb_data,	__sd_reg(tohostmailboxdata));
+	hmb_data = brcmf_sdiod_readl(sdiod, core->base +
+					__sd_reg(tohostmailboxdata), &ret);
Please keep the address calculation (base + offset) in one line.
+
+	if (!ret)
+		brcmf_sdiod_writel(sdiod, core->base + __sd_reg(tosbmailbox),
+				   SMB_INT_ACK, &ret);
  
-	if (ret == 0)
-		w_sdreg32(bus, SMB_INT_ACK, __sd_reg(tosbmailbox));
  	bus->sdcnt.f1regdata += 2;
  
  	/* Dongle recomposed rx frames, accept them again */
[...]
quoted hunk ↗ jump to hunk
@@ -4044,7 +4041,9 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err,
  	if (!err) {
  		/* Set up the interrupt mask and enable interrupts */
  		bus->hostintmask = HOSTINTMASK;
-		w_sdreg32(bus, bus->hostintmask, __sd_reg(hostintmask));
+		brcmf_sdiod_writel(sdiod, core->base + __sd_reg(hostintmask),
+				   bus->hostintmask, NULL);
+
  
  		brcmf_sdiod_writeb(sdiodev, SBSDIO_WATERMARK, 8, &err);
It seems this function has two pointer variables, ie. sdiod and sdiodev, 
pointing to the same instance.
  	} else {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help