New upstream version 17.11-rc3
[deb_dpdk.git] / drivers / bus / fslmc / mc / mc_sys.c
index 4573165..f0f9a26 100644 (file)
@@ -5,6 +5,7 @@
  *   BSD LICENSE
  *
  * Copyright 2013-2015 Freescale Semiconductor Inc.
+ * Copyright 2017 NXP.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -86,6 +87,7 @@ static int mc_status_to_error(enum mc_cmd_status status)
 int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd)
 {
        enum mc_cmd_status status;
+       uint64_t response;
 
        if (!mc_io || !mc_io->regs)
                return -EACCES;
@@ -97,7 +99,8 @@ int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd)
 
        /* Spin until status changes */
        do {
-               status = MC_CMD_HDR_READ_STATUS(ioread64(mc_io->regs));
+               response = ioread64(mc_io->regs);
+               status = mc_cmd_read_status((struct mc_command *)&response);
 
                /* --- Call wait function here to prevent blocking ---
                 * Change the loop condition accordingly to exit on timeout.