ethernet: unify return value of .ndo_set_mac_address if address is invalid
[deliverable/linux.git] / drivers / net / ethernet / sfc / efx.c
index ac571cf144853c77d50dd9081a1886d0324bbf9f..1908ba7ca7e6a0c5c3765e1d8ffeab3ec9be02f4 100644 (file)
@@ -585,7 +585,12 @@ static int efx_probe_channels(struct efx_nic *efx)
        /* Restart special buffer allocation */
        efx->next_buffer_table = 0;
 
-       efx_for_each_channel(channel, efx) {
+       /* Probe channels in reverse, so that any 'extra' channels
+        * use the start of the buffer table. This allows the traffic
+        * channels to be resized without moving them or wasting the
+        * entries before them.
+        */
+       efx_for_each_channel_rev(channel, efx) {
                rc = efx_probe_channel(channel);
                if (rc) {
                        netif_err(efx, probe, efx->net_dev,
@@ -1930,7 +1935,7 @@ static int efx_set_mac_address(struct net_device *net_dev, void *data)
                netif_err(efx, drv, efx->net_dev,
                          "invalid ethernet MAC address requested: %pM\n",
                          new_addr);
-               return -EINVAL;
+               return -EADDRNOTAVAIL;
        }
 
        memcpy(net_dev->dev_addr, new_addr, net_dev->addr_len);
This page took 0.025124 seconds and 5 git commands to generate.