]> git.baikalelectronics.ru Git - kernel.git/commit
sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe
authorEdward Cree <ecree@solarflare.com>
Tue, 22 Jan 2019 19:02:17 +0000 (19:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Jan 2019 19:15:35 +0000 (11:15 -0800)
commit89594b2c6a4ae32ff691041f9dbca75bdea01aa0
tree9b2f2ceb689a9334ea1adac44fa84d254a2871fe
parentb152f408864b72ce2def8be6b794c7495cfcd4c9
sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe

Use a bitmap to keep track of which partition types we've already seen;
 for duplicates, return -EEXIST from efx_ef10_mtd_probe_partition() and
 thus skip adding that partition.
Duplicate partitions occur because of the A/B backup scheme used by newer
 sfc NICs.  Prior to this patch they cause sysfs_warn_dup errors because
 they have the same name, causing us not to expose any MTDs at all.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/ef10.c