summaryrefslogtreecommitdiff
path: root/nuttx/drivers/mtd/at24xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/drivers/mtd/at24xx.c')
-rw-r--r--nuttx/drivers/mtd/at24xx.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/nuttx/drivers/mtd/at24xx.c b/nuttx/drivers/mtd/at24xx.c
index d157a9c47..2eb7c9af0 100644
--- a/nuttx/drivers/mtd/at24xx.c
+++ b/nuttx/drivers/mtd/at24xx.c
@@ -10,7 +10,7 @@
*
* Derived from drivers/mtd/m25px.c
*
- * Copyright (C) 2009-2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009-2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -365,7 +365,7 @@ static int at24c_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
break;
case MTDIOC_BULKERASE:
- ret=at24c_eraseall(priv);
+ ret = at24c_eraseall(priv);
break;
case MTDIOC_XIPBASE:
@@ -413,6 +413,10 @@ FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_dev_s *dev)
priv->pagesize = AT24XX_PAGESIZE;
priv->npages = AT24XX_NPAGES;
+ /* NOTE since the pre-allocated device structure lies in .bss, any
+ * unsupported methods should have been nullified.
+ */
+
priv->mtd.erase = at24c_erase;
priv->mtd.bread = at24c_bread;
priv->mtd.bwrite = at24c_bwrite;