diff mbox

[v6,2/4] ath6kl: change to use mmc api for accessing host supported maximum segment count and size

Message ID 1513685211-640-2-git-send-email-huxm@marvell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Xinming Hu Dec. 19, 2017, 12:06 p.m. UTC
Using mmc standard api to get the host sg capability.

Signed-off-by: Xinming Hu <huxm@marvell.com>
---
v6: separate driver patch from patch 1/4.
---
 drivers/net/wireless/ath/ath6kl/sdio.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Kalle Valo Dec. 20, 2017, 3:40 p.m. UTC | #1
Xinming Hu <huxm@marvell.com> writes:

> Using mmc standard api to get the host sg capability.
>
> Signed-off-by: Xinming Hu <huxm@marvell.com>
> ---
> v6: separate driver patch from patch 1/4.
> ---
>  drivers/net/wireless/ath/ath6kl/sdio.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

I assume this will go via some other tree and I should not take this.
So:

Acked-by: Kalle Valo <kvalo@qca.qualcomm.com>
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index 2195b1b..3217698 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -734,17 +734,18 @@  static int ath6kl_sdio_enable_scatter(struct ath6kl *ar)
 	struct htc_target *target = ar->htc_target;
 	int ret = 0;
 	bool virt_scat = false;
+	unsigned short max_segs = 0;
 
 	if (ar_sdio->scatter_enabled)
 		return 0;
 
 	ar_sdio->scatter_enabled = true;
 
+	max_segs = sdio_get_host_max_seg_count(ar_sdio->func);
 	/* check if host supports scatter and it meets our requirements */
-	if (ar_sdio->func->card->host->max_segs < MAX_SCATTER_ENTRIES_PER_REQ) {
+	if (max_segs < MAX_SCATTER_ENTRIES_PER_REQ) {
 		ath6kl_err("host only supports scatter of :%d entries, need: %d\n",
-			   ar_sdio->func->card->host->max_segs,
-			   MAX_SCATTER_ENTRIES_PER_REQ);
+			   max_segs, MAX_SCATTER_ENTRIES_PER_REQ);
 		virt_scat = true;
 	}