sfc: Expose FPGA bitfile partition through MTD
authorBen Hutchings <bhutchings@solarflare.com>
Mon, 4 Jul 2011 23:05:56 +0000 (00:05 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Wed, 19 Sep 2012 01:56:24 +0000 (02:56 +0100)
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/ethernet/sfc/mtd.c

index 8f4604d5d64212cc1f6c3c048ce538b4deba859e..08f825b71ac8c5a69db6995fda028626e702adae 100644 (file)
@@ -585,6 +585,7 @@ static const struct siena_nvram_type_info siena_nvram_types[] = {
        [MC_CMD_NVRAM_TYPE_EXP_ROM_CFG_PORT1]   = { 1, "sfc_exp_rom_cfg" },
        [MC_CMD_NVRAM_TYPE_PHY_PORT0]           = { 0, "sfc_phy_fw" },
        [MC_CMD_NVRAM_TYPE_PHY_PORT1]           = { 1, "sfc_phy_fw" },
+       [MC_CMD_NVRAM_TYPE_FPGA]                = { 0, "sfc_fpga" },
 };
 
 static int siena_mtd_probe_partition(struct efx_nic *efx,
@@ -598,7 +599,8 @@ static int siena_mtd_probe_partition(struct efx_nic *efx,
        bool protected;
        int rc;
 
-       if (type >= ARRAY_SIZE(siena_nvram_types))
+       if (type >= ARRAY_SIZE(siena_nvram_types) ||
+           siena_nvram_types[type].name == NULL)
                return -ENODEV;
 
        info = &siena_nvram_types[type];