aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/fsl-mc/mc_sys.c
diff options
context:
space:
mode:
authorIoana Ciornei <ioana.ciornei@nxp.com>2023-05-31 19:04:36 +0300
committerPeng Fan <peng.fan@nxp.com>2023-06-15 17:58:53 +0800
commit5654ffa8f13a20f587bf15c31c4a52efab887ca3 (patch)
treeaec5e8da42c318d65ddbc2e3ef74ee363c73fa18 /drivers/net/fsl-mc/mc_sys.c
parent0aebee70bb0edc42a2e9d764b7993a8a048a2ea7 (diff)
net: fsl-mc: sync remaining MC commands
This patch targets the last remaining commands left to sync to their latest form - mainly the mc_get_version() API. Besides this, remove any macro which is now of no help. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/net/fsl-mc/mc_sys.c')
-rw-r--r--drivers/net/fsl-mc/mc_sys.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/fsl-mc/mc_sys.c b/drivers/net/fsl-mc/mc_sys.c
index b5ae2ea3eb..4d32516b00 100644
--- a/drivers/net/fsl-mc/mc_sys.c
+++ b/drivers/net/fsl-mc/mc_sys.c
@@ -13,8 +13,13 @@
#include <asm/io.h>
#include <linux/delay.h>
-#define MC_CMD_HDR_READ_CMDID(_hdr) \
- ((uint16_t)mc_dec((_hdr), MC_CMD_HDR_CMDID_O, MC_CMD_HDR_CMDID_S))
+static u16 mc_cmd_hdr_read_cmdid(struct mc_command *cmd)
+{
+ struct mc_cmd_header *hdr = (struct mc_cmd_header *)&cmd->header;
+ u16 cmd_id = le16_to_cpu(hdr->cmd_id);
+
+ return cmd_id;
+}
/**
* mc_send_command - Send MC command and wait for response
@@ -52,8 +57,8 @@ int mc_send_command(struct fsl_mc_io *mc_io,
if (status != MC_CMD_STATUS_OK) {
printf("Error: MC command failed (portal: %p, obj handle: %#x, command: %#x, status: %#x)\n",
mc_io->mmio_regs,
- (unsigned int)MC_CMD_HDR_READ_TOKEN(cmd->header),
- (unsigned int)MC_CMD_HDR_READ_CMDID(cmd->header),
+ (unsigned int)mc_cmd_hdr_read_token(cmd),
+ (unsigned int)mc_cmd_hdr_read_cmdid(cmd),
(unsigned int)status);
return -EIO;