summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sfc/mtd.c
diff options
context:
space:
mode:
authorBert Kenward <bkenward@solarflare.com>2019-01-16 13:00:39 +0300
committerDavid S. Miller <davem@davemloft.net>2019-01-17 23:10:14 +0300
commit5fb1beeceab857d57312e9351d836f168b513027 (patch)
treee3d9760b7a4e8373dee1ae231484e5623b5298b7 /drivers/net/ethernet/sfc/mtd.c
parentcea3bfb37482c601fc2f739bc0215e5c64e45ab0 (diff)
downloadlinux-5fb1beeceab857d57312e9351d836f168b513027.tar.xz
sfc: extend MTD support for newer hardware
The X2 family of NICs (based on the SFC9250) have additional MTD partitions for firmware and configuration. This includes partitions that are read-only. The NICs also have extended versions of the NVRAM interface, allowing more detailed status information to be returned. Signed-off-by: Bert Kenward <bkenward@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/mtd.c')
-rw-r--r--drivers/net/ethernet/sfc/mtd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/mtd.c b/drivers/net/ethernet/sfc/mtd.c
index 4ac30b6e5dab..0d03e0577d85 100644
--- a/drivers/net/ethernet/sfc/mtd.c
+++ b/drivers/net/ethernet/sfc/mtd.c
@@ -66,6 +66,9 @@ int efx_mtd_add(struct efx_nic *efx, struct efx_mtd_partition *parts,
part->mtd.writesize = 1;
+ if (!(part->mtd.flags & MTD_NO_ERASE))
+ part->mtd.flags |= MTD_WRITEABLE;
+
part->mtd.owner = THIS_MODULE;
part->mtd.priv = efx;
part->mtd.name = part->name;