]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ethernet: ucc_geth: use qe_muram_free_addr()
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Tue, 19 Jan 2021 15:07:50 +0000 (16:07 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 Jan 2021 20:19:55 +0000 (12:19 -0800)
This removes the explicit NULL checks, and allows us to stop storing
at least some of the _offset values separately.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/ucc_geth.c

index d4b775870f4e9d6abe844ddbcfb7d5f3d2fedf91..14c58667992e837151c698ba309f975cdd31dd04 100644 (file)
@@ -1921,50 +1921,39 @@ static void ucc_geth_memclean(struct ucc_geth_private *ugeth)
                ugeth->uccf = NULL;
        }
 
-       if (ugeth->p_thread_data_tx) {
-               qe_muram_free(ugeth->thread_dat_tx_offset);
-               ugeth->p_thread_data_tx = NULL;
-       }
-       if (ugeth->p_thread_data_rx) {
-               qe_muram_free(ugeth->thread_dat_rx_offset);
-               ugeth->p_thread_data_rx = NULL;
-       }
-       if (ugeth->p_exf_glbl_param) {
-               qe_muram_free(ugeth->exf_glbl_param_offset);
-               ugeth->p_exf_glbl_param = NULL;
-       }
-       if (ugeth->p_rx_glbl_pram) {
-               qe_muram_free(ugeth->rx_glbl_pram_offset);
-               ugeth->p_rx_glbl_pram = NULL;
-       }
-       if (ugeth->p_tx_glbl_pram) {
-               qe_muram_free(ugeth->tx_glbl_pram_offset);
-               ugeth->p_tx_glbl_pram = NULL;
-       }
-       if (ugeth->p_send_q_mem_reg) {
-               qe_muram_free(ugeth->send_q_mem_reg_offset);
-               ugeth->p_send_q_mem_reg = NULL;
-       }
-       if (ugeth->p_scheduler) {
-               qe_muram_free(ugeth->scheduler_offset);
-               ugeth->p_scheduler = NULL;
-       }
-       if (ugeth->p_tx_fw_statistics_pram) {
-               qe_muram_free(ugeth->tx_fw_statistics_pram_offset);
-               ugeth->p_tx_fw_statistics_pram = NULL;
-       }
-       if (ugeth->p_rx_fw_statistics_pram) {
-               qe_muram_free(ugeth->rx_fw_statistics_pram_offset);
-               ugeth->p_rx_fw_statistics_pram = NULL;
-       }
-       if (ugeth->p_rx_irq_coalescing_tbl) {
-               qe_muram_free(ugeth->rx_irq_coalescing_tbl_offset);
-               ugeth->p_rx_irq_coalescing_tbl = NULL;
-       }
-       if (ugeth->p_rx_bd_qs_tbl) {
-               qe_muram_free(ugeth->rx_bd_qs_tbl_offset);
-               ugeth->p_rx_bd_qs_tbl = NULL;
-       }
+       qe_muram_free_addr(ugeth->p_thread_data_tx);
+       ugeth->p_thread_data_tx = NULL;
+
+       qe_muram_free_addr(ugeth->p_thread_data_rx);
+       ugeth->p_thread_data_rx = NULL;
+
+       qe_muram_free_addr(ugeth->p_exf_glbl_param);
+       ugeth->p_exf_glbl_param = NULL;
+
+       qe_muram_free_addr(ugeth->p_rx_glbl_pram);
+       ugeth->p_rx_glbl_pram = NULL;
+
+       qe_muram_free_addr(ugeth->p_tx_glbl_pram);
+       ugeth->p_tx_glbl_pram = NULL;
+
+       qe_muram_free_addr(ugeth->p_send_q_mem_reg);
+       ugeth->p_send_q_mem_reg = NULL;
+
+       qe_muram_free_addr(ugeth->p_scheduler);
+       ugeth->p_scheduler = NULL;
+
+       qe_muram_free_addr(ugeth->p_tx_fw_statistics_pram);
+       ugeth->p_tx_fw_statistics_pram = NULL;
+
+       qe_muram_free_addr(ugeth->p_rx_fw_statistics_pram);
+       ugeth->p_rx_fw_statistics_pram = NULL;
+
+       qe_muram_free_addr(ugeth->p_rx_irq_coalescing_tbl);
+       ugeth->p_rx_irq_coalescing_tbl = NULL;
+
+       qe_muram_free_addr(ugeth->p_rx_bd_qs_tbl);
+       ugeth->p_rx_bd_qs_tbl = NULL;
+
        if (ugeth->p_init_enet_param_shadow) {
                return_init_enet_entries(ugeth,
                                         &(ugeth->p_init_enet_param_shadow->