drivers/mtd/gd25.c: spi_devid argument was not used in initialization. Commit 4fc41b55b
to GD25 driver was always using priv->spi_devid initialized to zero by kmm_zalloc(). This commit initializes it from the supplied function argument.
This commit is contained in:
parent
29612c40c5
commit
dc3edca5a7
@ -153,9 +153,9 @@ struct gd25_dev_s
|
|||||||
{
|
{
|
||||||
struct mtd_dev_s mtd; /* MTD interface */
|
struct mtd_dev_s mtd; /* MTD interface */
|
||||||
FAR struct spi_dev_s *spi; /* Saved SPI interface instance */
|
FAR struct spi_dev_s *spi; /* Saved SPI interface instance */
|
||||||
|
uint32_t spi_devid; /* Chip select inputs */
|
||||||
uint16_t nsectors; /* Number of erase sectors */
|
uint16_t nsectors; /* Number of erase sectors */
|
||||||
uint8_t prev_instr; /* Previous instruction given to GD25 device */
|
uint8_t prev_instr; /* Previous instruction given to GD25 device */
|
||||||
uint32_t spi_devid; /* Chip select inputs */
|
|
||||||
bool addr_4byte; /* True: Use Four-byte address */
|
bool addr_4byte; /* True: Use Four-byte address */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -975,6 +975,7 @@ FAR struct mtd_dev_s *gd25_initialize(FAR struct spi_dev_s *spi,
|
|||||||
#endif
|
#endif
|
||||||
priv->mtd.name = "gd25";
|
priv->mtd.name = "gd25";
|
||||||
priv->spi = spi;
|
priv->spi = spi;
|
||||||
|
priv->spi_devid = spi_devid;
|
||||||
|
|
||||||
/* Deselect the FLASH */
|
/* Deselect the FLASH */
|
||||||
|
|
||||||
|
@ -165,11 +165,11 @@ struct gd5f_dev_s
|
|||||||
{
|
{
|
||||||
struct mtd_dev_s mtd; /* MTD interface */
|
struct mtd_dev_s mtd; /* MTD interface */
|
||||||
FAR struct spi_dev_s *dev; /* Saved SPI interface instance */
|
FAR struct spi_dev_s *dev; /* Saved SPI interface instance */
|
||||||
uint8_t sectorshift; /* 17 */
|
uint32_t spi_devid; /* Chip select inputs */
|
||||||
uint16_t nsectors; /* 1024 or 2048 */
|
uint16_t nsectors; /* 1024 or 2048 */
|
||||||
|
uint8_t sectorshift; /* 17 */
|
||||||
uint8_t pageshift; /* 11 */
|
uint8_t pageshift; /* 11 */
|
||||||
uint8_t eccstatus; /* Internal ECC status */
|
uint8_t eccstatus; /* Internal ECC status */
|
||||||
uint32_t spi_devid; /* Chip select inputs */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user