Lines Matching refs:mtd
16 #define to_ef4_mtd_partition(mtd) \ argument
17 container_of(mtd, struct ef4_mtd_partition, mtd)
21 static int ef4_mtd_erase(struct mtd_info *mtd, struct erase_info *erase) in ef4_mtd_erase() argument
23 struct ef4_nic *efx = mtd->priv; in ef4_mtd_erase()
25 return efx->type->mtd_erase(mtd, erase->addr, erase->len); in ef4_mtd_erase()
28 static void ef4_mtd_sync(struct mtd_info *mtd) in ef4_mtd_sync() argument
30 struct ef4_mtd_partition *part = to_ef4_mtd_partition(mtd); in ef4_mtd_sync()
31 struct ef4_nic *efx = mtd->priv; in ef4_mtd_sync()
34 rc = efx->type->mtd_sync(mtd); in ef4_mtd_sync()
45 rc = mtd_device_unregister(&part->mtd); in ef4_mtd_remove_partition()
64 part->mtd.writesize = 1; in ef4_mtd_add()
66 part->mtd.owner = THIS_MODULE; in ef4_mtd_add()
67 part->mtd.priv = efx; in ef4_mtd_add()
68 part->mtd.name = part->name; in ef4_mtd_add()
69 part->mtd._erase = ef4_mtd_erase; in ef4_mtd_add()
70 part->mtd._read = efx->type->mtd_read; in ef4_mtd_add()
71 part->mtd._write = efx->type->mtd_write; in ef4_mtd_add()
72 part->mtd._sync = ef4_mtd_sync; in ef4_mtd_add()
76 if (mtd_device_register(&part->mtd, NULL, 0)) in ef4_mtd_add()