The cpsw common is ought to be reference counted, but the reference
counter is only ever increased to one. Increase the reference for
additional am65_cpsw_common_start() calls.

This fixes a warning when barebox is shut down:

ERROR: 8000000.ether...@8000000.of: dma failed with -22

Signed-off-by: Sascha Hauer <s.ha...@pengutronix.de>
---
 drivers/net/am65-cpsw-nuss.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/am65-cpsw-nuss.c b/drivers/net/am65-cpsw-nuss.c
index 651b0b29cf..6b5a5d9533 100644
--- a/drivers/net/am65-cpsw-nuss.c
+++ b/drivers/net/am65-cpsw-nuss.c
@@ -274,8 +274,10 @@ static int am65_cpsw_common_start(struct am65_cpsw_common 
*common)
        struct am65_cpsw_port *port0 = &common->ports[0];
        int ret, i;
 
-       if (common->started)
+       if (common->started) {
+               common->started++;
                return 0;
+       }
 
        ret = clk_enable(common->fclk);
        if (ret) {
-- 
2.39.5


Reply via email to