Lines Matching refs:mtd
16 #define to_efx_mtd_partition(mtd) \ argument
17 container_of(mtd, struct efx_mtd_partition, mtd)
21 static int efx_mtd_erase(struct mtd_info *mtd, struct erase_info *erase) in efx_mtd_erase() argument
23 struct efx_nic *efx = mtd->priv; in efx_mtd_erase()
25 return efx->type->mtd_erase(mtd, erase->addr, erase->len); in efx_mtd_erase()
28 static void efx_mtd_sync(struct mtd_info *mtd) in efx_mtd_sync() argument
30 struct efx_mtd_partition *part = to_efx_mtd_partition(mtd); in efx_mtd_sync()
31 struct efx_nic *efx = mtd->priv; in efx_mtd_sync()
34 rc = efx->type->mtd_sync(mtd); in efx_mtd_sync()
45 rc = mtd_device_unregister(&part->mtd); in efx_mtd_remove_partition()
64 part->mtd.writesize = 1; in efx_mtd_add()
66 if (!(part->mtd.flags & MTD_NO_ERASE)) in efx_mtd_add()
67 part->mtd.flags |= MTD_WRITEABLE; in efx_mtd_add()
69 part->mtd.owner = THIS_MODULE; in efx_mtd_add()
70 part->mtd.priv = efx; in efx_mtd_add()
71 part->mtd.name = part->name; in efx_mtd_add()
72 part->mtd._erase = efx_mtd_erase; in efx_mtd_add()
73 part->mtd._read = efx->type->mtd_read; in efx_mtd_add()
74 part->mtd._write = efx->type->mtd_write; in efx_mtd_add()
75 part->mtd._sync = efx_mtd_sync; in efx_mtd_add()
79 if (mtd_device_register(&part->mtd, NULL, 0)) in efx_mtd_add()