mtd: spi-nor: winbond: unify function names
To avoid name clashes unify all the function and static object names and use one of the following prefixes which should be sufficiently unique: - <vendor>_nor_ - <flash_family>_nor_ - <flash_part>_ There are no functional changes. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Acked-by: Pratyush Yadav <p.yadav@ti.com> Link: https://lore.kernel.org/r/20220223134358.1914798-15-michael@walle.cc
This commit is contained in:
parent
7e5b38ae4f
commit
a7a0466f58
|
@ -32,7 +32,7 @@ static const struct spi_nor_fixups w25q256_fixups = {
|
||||||
.post_bfpt = w25q256_post_bfpt_fixups,
|
.post_bfpt = w25q256_post_bfpt_fixups,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct flash_info winbond_parts[] = {
|
static const struct flash_info winbond_nor_parts[] = {
|
||||||
/* Winbond -- w25x "blocks" are 64K, "sectors" are 4KiB */
|
/* Winbond -- w25x "blocks" are 64K, "sectors" are 4KiB */
|
||||||
{ "w25x05", INFO(0xef3010, 0, 64 * 1024, 1)
|
{ "w25x05", INFO(0xef3010, 0, 64 * 1024, 1)
|
||||||
NO_SFDP_FLAGS(SECT_4K) },
|
NO_SFDP_FLAGS(SECT_4K) },
|
||||||
|
@ -130,14 +130,15 @@ static const struct flash_info winbond_parts[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* winbond_set_4byte_addr_mode() - Set 4-byte address mode for Winbond flashes.
|
* winbond_nor_set_4byte_addr_mode() - Set 4-byte address mode for Winbond
|
||||||
|
* flashes.
|
||||||
* @nor: pointer to 'struct spi_nor'.
|
* @nor: pointer to 'struct spi_nor'.
|
||||||
* @enable: true to enter the 4-byte address mode, false to exit the 4-byte
|
* @enable: true to enter the 4-byte address mode, false to exit the 4-byte
|
||||||
* address mode.
|
* address mode.
|
||||||
*
|
*
|
||||||
* Return: 0 on success, -errno otherwise.
|
* Return: 0 on success, -errno otherwise.
|
||||||
*/
|
*/
|
||||||
static int winbond_set_4byte_addr_mode(struct spi_nor *nor, bool enable)
|
static int winbond_nor_set_4byte_addr_mode(struct spi_nor *nor, bool enable)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -161,7 +162,7 @@ static int winbond_set_4byte_addr_mode(struct spi_nor *nor, bool enable)
|
||||||
return spi_nor_write_disable(nor);
|
return spi_nor_write_disable(nor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct spi_nor_otp_ops winbond_otp_ops = {
|
static const struct spi_nor_otp_ops winbond_nor_otp_ops = {
|
||||||
.read = spi_nor_otp_read_secr,
|
.read = spi_nor_otp_read_secr,
|
||||||
.write = spi_nor_otp_write_secr,
|
.write = spi_nor_otp_write_secr,
|
||||||
.erase = spi_nor_otp_erase_secr,
|
.erase = spi_nor_otp_erase_secr,
|
||||||
|
@ -169,25 +170,25 @@ static const struct spi_nor_otp_ops winbond_otp_ops = {
|
||||||
.is_locked = spi_nor_otp_is_locked_sr2,
|
.is_locked = spi_nor_otp_is_locked_sr2,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void winbond_default_init(struct spi_nor *nor)
|
static void winbond_nor_default_init(struct spi_nor *nor)
|
||||||
{
|
{
|
||||||
nor->params->set_4byte_addr_mode = winbond_set_4byte_addr_mode;
|
nor->params->set_4byte_addr_mode = winbond_nor_set_4byte_addr_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void winbond_late_init(struct spi_nor *nor)
|
static void winbond_nor_late_init(struct spi_nor *nor)
|
||||||
{
|
{
|
||||||
if (nor->params->otp.org->n_regions)
|
if (nor->params->otp.org->n_regions)
|
||||||
nor->params->otp.ops = &winbond_otp_ops;
|
nor->params->otp.ops = &winbond_nor_otp_ops;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct spi_nor_fixups winbond_fixups = {
|
static const struct spi_nor_fixups winbond_nor_fixups = {
|
||||||
.default_init = winbond_default_init,
|
.default_init = winbond_nor_default_init,
|
||||||
.late_init = winbond_late_init,
|
.late_init = winbond_nor_late_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct spi_nor_manufacturer spi_nor_winbond = {
|
const struct spi_nor_manufacturer spi_nor_winbond = {
|
||||||
.name = "winbond",
|
.name = "winbond",
|
||||||
.parts = winbond_parts,
|
.parts = winbond_nor_parts,
|
||||||
.nparts = ARRAY_SIZE(winbond_parts),
|
.nparts = ARRAY_SIZE(winbond_nor_parts),
|
||||||
.fixups = &winbond_fixups,
|
.fixups = &winbond_nor_fixups,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue