Skip to content

Commit 149d1af

Browse files
committed
nvme: nvme_fw_download use nvme_passthru_cmd directly
Drop nvme_fw_download_args entirely. Signed-off-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com>
1 parent 55f3ea1 commit 149d1af

File tree

3 files changed

+3
-31
lines changed

3 files changed

+3
-31
lines changed

nvme.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4977,22 +4977,13 @@ static int fw_download_single(nvme_link_t l, void *fw_buf,
49774977
offset, fw_len, (int)(100 * offset / fw_len));
49784978
}
49794979

4980-
struct nvme_fw_download_args args = {
4981-
.args_size = sizeof(args),
4982-
.offset = offset,
4983-
.data_len = len,
4984-
.data = fw_buf,
4985-
.timeout = nvme_cfg.timeout,
4986-
.result = NULL,
4987-
};
4988-
49894980
for (try = 0; try < max_retries; try++) {
49904981
if (try > 0) {
49914982
fprintf(stderr, "retrying offset %x (%u/%u)\n",
49924983
offset, try, max_retries);
49934984
}
49944985

4995-
err = nvme_fw_download(l, &args);
4986+
err = nvme_fw_download(l, fw_buf, len, offset, NULL);
49964987
if (!err)
49974988
return 0;
49984989

plugins/memblaze/memblaze-nvme.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -880,16 +880,7 @@ static int mb_selective_download(int argc, char **argv, struct command *cmd, str
880880

881881
while (fw_size > 0) {
882882
xfer = min(xfer, fw_size);
883-
884-
struct nvme_fw_download_args args = {
885-
.args_size = sizeof(args),
886-
.offset = offset,
887-
.data_len = xfer,
888-
.data = fw_buf,
889-
.timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
890-
.result = NULL,
891-
};
892-
err = nvme_fw_download(l, &args);
883+
err = nvme_fw_download(l, fw_buf, xfer, offset, NULL);
893884
if (err < 0) {
894885
perror("fw-download");
895886
goto out_free;

plugins/micron/micron-nvme.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -649,17 +649,7 @@ static int micron_selective_download(int argc, char **argv,
649649

650650
while (fw_size > 0) {
651651
xfer = min(xfer, fw_size);
652-
653-
struct nvme_fw_download_args args = {
654-
.args_size = sizeof(args),
655-
.offset = offset,
656-
.data_len = xfer,
657-
.data = fw_buf,
658-
.timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
659-
.result = NULL,
660-
};
661-
662-
err = nvme_fw_download(l, &args);
652+
err = nvme_fw_download(l, fw_buf, xfer, offset, NULL);
663653
if (err < 0) {
664654
perror("fw-download");
665655
goto out_free;

0 commit comments

Comments
 (0)