]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
sfc: Allow efx_nic_type::dimension_resources to fail
authorBen Hutchings <bhutchings@solarflare.com>
Wed, 28 Aug 2013 23:45:48 +0000 (00:45 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Thu, 29 Aug 2013 17:12:09 +0000 (18:12 +0100)
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/ethernet/sfc/efx.c
drivers/net/ethernet/sfc/falcon.c
drivers/net/ethernet/sfc/net_driver.h
drivers/net/ethernet/sfc/siena.c

index 84c47d3f2b533c714ff7a17a13b7d9040a88a46a..59aa73ccefed421f298aff4140b6cad5c893694f 100644 (file)
@@ -1513,9 +1513,11 @@ static int efx_probe_nic(struct efx_nic *efx)
         * in MSI-X interrupts. */
        rc = efx_probe_interrupts(efx);
        if (rc)
-               goto fail;
+               goto fail1;
 
-       efx->type->dimension_resources(efx);
+       rc = efx->type->dimension_resources(efx);
+       if (rc)
+               goto fail2;
 
        if (efx->n_channels > 1)
                get_random_bytes(&efx->rx_hash_key, sizeof(efx->rx_hash_key));
@@ -1533,7 +1535,9 @@ static int efx_probe_nic(struct efx_nic *efx)
 
        return 0;
 
-fail:
+fail2:
+       efx_remove_interrupts(efx);
+fail1:
        efx->type->remove(efx);
        return rc;
 }
index ec77611a52e453cc50d839a3331c6622578ef5c3..a7b30ddbd4e0c47af54989194106ecdea3d0d001 100644 (file)
@@ -2174,10 +2174,11 @@ out:
        return rc;
 }
 
-static void falcon_dimension_resources(struct efx_nic *efx)
+static int falcon_dimension_resources(struct efx_nic *efx)
 {
        efx->rx_dc_base = 0x20000;
        efx->tx_dc_base = 0x26000;
+       return 0;
 }
 
 /* Probe all SPI devices on the NIC */
index 54900f3c83b10bb831dcfbea540c883f82f95417..89974f739bb6da735f2be88b47068b79f15e095a 100644 (file)
@@ -1036,7 +1036,7 @@ struct efx_nic_type {
        int (*probe)(struct efx_nic *efx);
        void (*remove)(struct efx_nic *efx);
        int (*init)(struct efx_nic *efx);
-       void (*dimension_resources)(struct efx_nic *efx);
+       int (*dimension_resources)(struct efx_nic *efx);
        void (*fini)(struct efx_nic *efx);
        void (*monitor)(struct efx_nic *efx);
        enum reset_type (*map_reset_reason)(enum reset_type reason);
index 89180d47536788267e6e2631597d9fd1771b3f85..1500405b3a5540d5b2f7b5a0a2603ee458821f10 100644 (file)
@@ -177,13 +177,14 @@ static int siena_probe_nvconfig(struct efx_nic *efx)
        return rc;
 }
 
-static void siena_dimension_resources(struct efx_nic *efx)
+static int siena_dimension_resources(struct efx_nic *efx)
 {
        /* Each port has a small block of internal SRAM dedicated to
         * the buffer table and descriptor caches.  In theory we can
         * map both blocks to one port, but we don't.
         */
        efx_farch_dimension_resources(efx, FR_CZ_BUF_FULL_TBL_ROWS / 2);
+       return 0;
 }
 
 static unsigned int siena_mem_map_size(struct efx_nic *efx)