]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: mvneta: Convert netdev_xxx to dev_xxx
authorSean Anderson <seanga2@gmail.com>
Tue, 15 Sep 2020 14:44:55 +0000 (10:44 -0400)
committerTom Rini <trini@konsulko.com>
Wed, 30 Sep 2020 12:53:14 +0000 (08:53 -0400)
netdev_xxx evaluates to printf in U-Boot, so there is no extra info
printed. mvneta is one of two drivers which use these functions in U-Boot.
Convert these functions to dev_xxx where possible (and to log_xxx where
not).

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
drivers/net/mvneta.c

index 2c93fe42f7e32faea9333269cff80e8e621d6cdf..83f99e5d8aba105db5f6838d92e218498196132f 100644 (file)
@@ -625,9 +625,9 @@ static void mvneta_port_down(struct mvneta_port *pp)
        count = 0;
        do {
                if (count++ >= MVNETA_RX_DISABLE_TIMEOUT_MSEC) {
-                       netdev_warn(pp->dev,
-                                   "TIMEOUT for RX stopped ! rx_queue_cmd: 0x08%x\n",
-                                   val);
+                       dev_warn(pp->phydev->dev,
+                                "TIMEOUT for RX stopped ! rx_queue_cmd: 0x08%x\n",
+                                val);
                        break;
                }
                mdelay(1);
@@ -648,9 +648,9 @@ static void mvneta_port_down(struct mvneta_port *pp)
        count = 0;
        do {
                if (count++ >= MVNETA_TX_DISABLE_TIMEOUT_MSEC) {
-                       netdev_warn(pp->dev,
-                                   "TIMEOUT for TX stopped status=0x%08x\n",
-                                   val);
+                       dev_warn(pp->phydev->dev,
+                                "TIMEOUT for TX stopped status=0x%08x\n",
+                                val);
                        break;
                }
                mdelay(1);
@@ -664,9 +664,9 @@ static void mvneta_port_down(struct mvneta_port *pp)
        count = 0;
        do {
                if (count++ >= MVNETA_TX_FIFO_EMPTY_TIMEOUT) {
-                       netdev_warn(pp->dev,
-                                   "TX FIFO empty timeout status=0x08%x\n",
-                                   val);
+                       dev_warn(pp->phydev->dev,
+                                "TX FIFO empty timeout status=0x08%x\n",
+                                val);
                        break;
                }
                mdelay(1);
@@ -949,28 +949,32 @@ static void mvneta_rx_error(struct mvneta_port *pp,
        u32 status = rx_desc->status;
 
        if (!mvneta_rxq_desc_is_first_last(status)) {
-               netdev_err(pp->dev,
-                          "bad rx status %08x (buffer oversize), size=%d\n",
-                          status, rx_desc->data_size);
+               dev_err(pp->phydev->dev,
+                       "bad rx status %08x (buffer oversize), size=%d\n",
+                       status, rx_desc->data_size);
                return;
        }
 
        switch (status & MVNETA_RXD_ERR_CODE_MASK) {
        case MVNETA_RXD_ERR_CRC:
-               netdev_err(pp->dev, "bad rx status %08x (crc error), size=%d\n",
-                          status, rx_desc->data_size);
+               dev_err(pp->phydev->dev,
+                       "bad rx status %08x (crc error), size=%d\n", status,
+                       rx_desc->data_size);
                break;
        case MVNETA_RXD_ERR_OVERRUN:
-               netdev_err(pp->dev, "bad rx status %08x (overrun error), size=%d\n",
-                          status, rx_desc->data_size);
+               dev_err(pp->phydev->dev,
+                       "bad rx status %08x (overrun error), size=%d\n", status,
+                       rx_desc->data_size);
                break;
        case MVNETA_RXD_ERR_LEN:
-               netdev_err(pp->dev, "bad rx status %08x (max frame length error), size=%d\n",
-                          status, rx_desc->data_size);
+               dev_err(pp->phydev->dev,
+                       "bad rx status %08x (max frame length error), size=%d\n",
+                       status, rx_desc->data_size);
                break;
        case MVNETA_RXD_ERR_RESOURCE:
-               netdev_err(pp->dev, "bad rx status %08x (resource error), size=%d\n",
-                          status, rx_desc->data_size);
+               dev_err(pp->phydev->dev,
+                       "bad rx status %08x (resource error), size=%d\n",
+                       status, rx_desc->data_size);
                break;
        }
 }
@@ -1127,8 +1131,8 @@ static int mvneta_setup_rxqs(struct mvneta_port *pp)
        for (queue = 0; queue < rxq_number; queue++) {
                int err = mvneta_rxq_init(pp, &pp->rxqs[queue]);
                if (err) {
-                       netdev_err(pp->dev, "%s: can't create rxq=%d\n",
-                                  __func__, queue);
+                       dev_err(pp->phydev->dev, "%s: can't create rxq=%d\n",
+                               __func__, queue);
                        mvneta_cleanup_rxqs(pp);
                        return err;
                }
@@ -1145,8 +1149,8 @@ static int mvneta_setup_txqs(struct mvneta_port *pp)
        for (queue = 0; queue < txq_number; queue++) {
                int err = mvneta_txq_init(pp, &pp->txqs[queue]);
                if (err) {
-                       netdev_err(pp->dev, "%s: can't create txq=%d\n",
-                                  __func__, queue);
+                       dev_err(pp->phydev->dev, "%s: can't create txq=%d\n",
+                               __func__, queue);
                        mvneta_cleanup_txqs(pp);
                        return err;
                }