Add an optional byte-oriented write method to the MTD interface

This commit is contained in:
Gregory Nutt
2013-05-01 10:59:57 -06:00
parent ba52f8d3ec
commit 99c2cfc168
16 changed files with 122 additions and 33 deletions
+4 -2
View File
@@ -429,7 +429,7 @@ FAR struct mtd_dev_s *rammtd_initialize(FAR uint8_t *start, size_t size)
/* Create an instance of the RAM MTD device state structure */
priv = (FAR struct ram_dev_s *)kmalloc(sizeof(struct ram_dev_s));
priv = (FAR struct ram_dev_s *)kzalloc(sizeof(struct ram_dev_s));
if (!priv)
{
fdbg("Failed to allocate the RAM MTD state structure\n");
@@ -445,7 +445,9 @@ FAR struct mtd_dev_s *rammtd_initialize(FAR uint8_t *start, size_t size)
return NULL;
}
/* Perform initialization as necessary */
/* Perform initialization as necessary. (unsupported methods were
* nullified by kzalloc).
*/
priv->mtd.erase = ram_erase;
priv->mtd.bread = ram_bread;