bus/dpaa: update platform SoC value register routines
[dpdk.git] / drivers / net / dpaa / dpaa_ethdev.c
index 2eb00b5..24943ef 100644 (file)
@@ -186,19 +186,17 @@ dpaa_fw_version_get(struct rte_eth_dev *dev __rte_unused,
                DPAA_PMD_ERR("Unable to open SoC device");
                return -ENOTSUP; /* Not supported on this infra */
        }
-
-       ret = fscanf(svr_file, "svr:%x", &svr_ver);
-       if (ret <= 0) {
+       if (fscanf(svr_file, "svr:%x", &svr_ver) > 0)
+               dpaa_svr_family = svr_ver & SVR_MASK;
+       else
                DPAA_PMD_ERR("Unable to read SoC device");
-               return -ENOTSUP; /* Not supported on this infra */
-       }
 
-       ret = snprintf(fw_version, fw_size,
-                      "svr:%x-fman-v%x",
-                      svr_ver,
-                      fman_ip_rev);
+       fclose(svr_file);
 
+       ret = snprintf(fw_version, fw_size, "SVR:%x-fman-v%x",
+                      svr_ver, fman_ip_rev);
        ret += 1; /* add the size of '\0' */
+
        if (fw_size < (uint32_t)ret)
                return ret;
        else
@@ -697,7 +695,7 @@ static int dpaa_fc_set_default(struct dpaa_if *dpaa_intf)
 static int dpaa_rx_queue_init(struct qman_fq *fq,
                              uint32_t fqid)
 {
-       struct qm_mcc_initfq opts;
+       struct qm_mcc_initfq opts = {0};
        int ret;
 
        PMD_INIT_FUNC_TRACE();
@@ -743,7 +741,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq,
 static int dpaa_tx_queue_init(struct qman_fq *fq,
                              struct fman_if *fman_intf)
 {
-       struct qm_mcc_initfq opts;
+       struct qm_mcc_initfq opts = {0};
        int ret;
 
        PMD_INIT_FUNC_TRACE();
@@ -774,7 +772,7 @@ static int dpaa_tx_queue_init(struct qman_fq *fq,
 /* Initialise a DEBUG FQ ([rt]x_error, rx_default). */
 static int dpaa_debug_queue_init(struct qman_fq *fq, uint32_t fqid)
 {
-       struct qm_mcc_initfq opts;
+       struct qm_mcc_initfq opts = {0};
        int ret;
 
        PMD_INIT_FUNC_TRACE();