Commit 31d78a3d authored by Kalle Valo's avatar Kalle Valo

ath11k: change ath11k_core_fetch_board_data_api_n() to use ath11k_core_create_firmware_path()

Use the helper added in previous comment to create the full path, instead of doing it manually.

No functional changes. Compile tested only.
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1592316055-24958-9-git-send-email-kvalo@codeaurora.org
parent 34d9fc80
...@@ -165,11 +165,13 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *ab, ...@@ -165,11 +165,13 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *ab,
{ {
size_t len, magic_len; size_t len, magic_len;
const u8 *data; const u8 *data;
char *filename = ATH11K_BOARD_API2_FILE; char *filename, filepath[100];
size_t ie_len; size_t ie_len;
struct ath11k_fw_ie *hdr; struct ath11k_fw_ie *hdr;
int ret, ie_id; int ret, ie_id;
filename = ATH11K_BOARD_API2_FILE;
if (!bd->fw) if (!bd->fw)
bd->fw = ath11k_core_firmware_request(ab, filename); bd->fw = ath11k_core_firmware_request(ab, filename);
...@@ -179,11 +181,14 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *ab, ...@@ -179,11 +181,14 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *ab,
data = bd->fw->data; data = bd->fw->data;
len = bd->fw->size; len = bd->fw->size;
ath11k_core_create_firmware_path(ab, filename,
filepath, sizeof(filepath));
/* magic has extra null byte padded */ /* magic has extra null byte padded */
magic_len = strlen(ATH11K_BOARD_MAGIC) + 1; magic_len = strlen(ATH11K_BOARD_MAGIC) + 1;
if (len < magic_len) { if (len < magic_len) {
ath11k_err(ab, "failed to find magic value in %s/%s, file too short: %zu\n", ath11k_err(ab, "failed to find magic value in %s, file too short: %zu\n",
ab->hw_params.fw.dir, filename, len); filepath, len);
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
} }
...@@ -197,8 +202,8 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *ab, ...@@ -197,8 +202,8 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *ab,
/* magic is padded to 4 bytes */ /* magic is padded to 4 bytes */
magic_len = ALIGN(magic_len, 4); magic_len = ALIGN(magic_len, 4);
if (len < magic_len) { if (len < magic_len) {
ath11k_err(ab, "failed: %s/%s too small to contain board data, len: %zu\n", ath11k_err(ab, "failed: %s too small to contain board data, len: %zu\n",
ab->hw_params.fw.dir, filename, len); filepath, len);
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
} }
...@@ -246,8 +251,8 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *ab, ...@@ -246,8 +251,8 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *ab,
out: out:
if (!bd->data || !bd->len) { if (!bd->data || !bd->len) {
ath11k_err(ab, ath11k_err(ab,
"failed to fetch board data for %s from %s/%s\n", "failed to fetch board data for %s from %s\n",
boardname, ab->hw_params.fw.dir, filename); boardname, filepath);
ret = -ENODATA; ret = -ENODATA;
goto err; goto err;
} }
......
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