mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
boards/arm/sama5/sama5d4-ek/src/sam_at25.c: CONFIG_BCH
This commit is contained in:
committed by
Xiang Xiao
parent
19edcab554
commit
ed10984e06
@@ -76,8 +76,10 @@ int sam_at25_automount(int minor)
|
|||||||
FAR struct spi_dev_s *spi;
|
FAR struct spi_dev_s *spi;
|
||||||
FAR struct mtd_dev_s *mtd;
|
FAR struct mtd_dev_s *mtd;
|
||||||
#ifdef CONFIG_SAMA5D4EK_AT25_CHARDEV
|
#ifdef CONFIG_SAMA5D4EK_AT25_CHARDEV
|
||||||
|
#if defined(CONFIG_BCH)
|
||||||
char blockdev[18];
|
char blockdev[18];
|
||||||
char chardev[12];
|
char chardev[12];
|
||||||
|
#endif /* defined(CONFIG_BCH) */
|
||||||
#endif
|
#endif
|
||||||
static bool initialized = false;
|
static bool initialized = false;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -127,6 +129,7 @@ int sam_at25_automount(int minor)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_BCH)
|
||||||
/* Use the minor number to create device paths */
|
/* Use the minor number to create device paths */
|
||||||
|
|
||||||
snprintf(blockdev, 18, "/dev/mtdblock%d", minor);
|
snprintf(blockdev, 18, "/dev/mtdblock%d", minor);
|
||||||
@@ -140,6 +143,7 @@ int sam_at25_automount(int minor)
|
|||||||
ferr("ERROR: bchdev_register %s failed: %d\n", chardev, ret);
|
ferr("ERROR: bchdev_register %s failed: %d\n", chardev, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif /* defined(CONFIG_BCH) */
|
||||||
|
|
||||||
#elif defined(CONFIG_SAMA5D4EK_AT25_NXFFS)
|
#elif defined(CONFIG_SAMA5D4EK_AT25_NXFFS)
|
||||||
/* Initialize to provide NXFFS on the MTD interface */
|
/* Initialize to provide NXFFS on the MTD interface */
|
||||||
|
|||||||
Reference in New Issue
Block a user