mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-22 20:16:02 +07:00
mtd: rawnand: Rename the manufacturer structure
It is currently called nand_manufacturer but could actually be called nand_manufacturer_desc, like its instances, so that the former name is left unused for now. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Link: https://lore.kernel.org/linux-mtd/20200529111322.7184-5-miquel.raynal@bootlin.com
This commit is contained in:
parent
8e8b2706e1
commit
271de009b7
@ -53,12 +53,12 @@ struct nand_manufacturer_ops {
|
||||
};
|
||||
|
||||
/**
|
||||
* struct nand_manufacturer - NAND Flash Manufacturer structure
|
||||
* struct nand_manufacturer_desc - NAND Flash Manufacturer descriptor
|
||||
* @name: Manufacturer name
|
||||
* @id: manufacturer ID code of device.
|
||||
* @ops: manufacturer operations
|
||||
*/
|
||||
struct nand_manufacturer {
|
||||
struct nand_manufacturer_desc {
|
||||
int id;
|
||||
char *name;
|
||||
const struct nand_manufacturer_ops *ops;
|
||||
@ -79,7 +79,7 @@ extern const struct nand_manufacturer_ops toshiba_nand_manuf_ops;
|
||||
extern const struct mtd_pairing_scheme dist3_pairing_scheme;
|
||||
|
||||
/* Core functions */
|
||||
const struct nand_manufacturer *nand_get_manufacturer(u8 id);
|
||||
const struct nand_manufacturer_desc *nand_get_manufacturer_desc(u8 id);
|
||||
int nand_bbm_get_next_page(struct nand_chip *chip, int page);
|
||||
int nand_markbad_bbm(struct nand_chip *chip, loff_t ofs);
|
||||
int nand_erase_nand(struct nand_chip *chip, struct erase_info *instr,
|
||||
|
@ -4810,9 +4810,9 @@ static void nand_manufacturer_cleanup(struct nand_chip *chip)
|
||||
}
|
||||
|
||||
static const char *
|
||||
nand_manufacturer_name(const struct nand_manufacturer *manufacturer)
|
||||
nand_manufacturer_name(const struct nand_manufacturer_desc *manufacturer_desc)
|
||||
{
|
||||
return manufacturer ? manufacturer->name : "Unknown";
|
||||
return manufacturer_desc ? manufacturer_desc->name : "Unknown";
|
||||
}
|
||||
|
||||
/*
|
||||
@ -4820,7 +4820,7 @@ nand_manufacturer_name(const struct nand_manufacturer *manufacturer)
|
||||
*/
|
||||
static int nand_detect(struct nand_chip *chip, struct nand_flash_dev *type)
|
||||
{
|
||||
const struct nand_manufacturer *manufacturer;
|
||||
const struct nand_manufacturer_desc *manufacturer_desc;
|
||||
struct mtd_info *mtd = nand_to_mtd(chip);
|
||||
struct nand_memory_organization *memorg;
|
||||
int busw, ret;
|
||||
@ -4877,8 +4877,8 @@ static int nand_detect(struct nand_chip *chip, struct nand_flash_dev *type)
|
||||
chip->id.len = nand_id_len(id_data, ARRAY_SIZE(chip->id.data));
|
||||
|
||||
/* Try to identify manufacturer */
|
||||
manufacturer = nand_get_manufacturer(maf_id);
|
||||
chip->manufacturer.desc = manufacturer;
|
||||
manufacturer_desc = nand_get_manufacturer_desc(maf_id);
|
||||
chip->manufacturer.desc = manufacturer_desc;
|
||||
|
||||
if (!type)
|
||||
type = nand_flash_ids;
|
||||
@ -4957,7 +4957,7 @@ static int nand_detect(struct nand_chip *chip, struct nand_flash_dev *type)
|
||||
*/
|
||||
pr_info("device found, Manufacturer ID: 0x%02x, Chip ID: 0x%02x\n",
|
||||
maf_id, dev_id);
|
||||
pr_info("%s %s\n", nand_manufacturer_name(manufacturer),
|
||||
pr_info("%s %s\n", nand_manufacturer_name(manufacturer_desc),
|
||||
mtd->name);
|
||||
pr_warn("bus width %d instead of %d bits\n", busw ? 16 : 8,
|
||||
(chip->options & NAND_BUSWIDTH_16) ? 16 : 8);
|
||||
@ -4992,7 +4992,7 @@ static int nand_detect(struct nand_chip *chip, struct nand_flash_dev *type)
|
||||
|
||||
pr_info("device found, Manufacturer ID: 0x%02x, Chip ID: 0x%02x\n",
|
||||
maf_id, dev_id);
|
||||
pr_info("%s %s\n", nand_manufacturer_name(manufacturer),
|
||||
pr_info("%s %s\n", nand_manufacturer_name(manufacturer_desc),
|
||||
chip->parameters.model);
|
||||
pr_info("%d MiB, %s, erase size: %d KiB, page size: %d, OOB size: %d\n",
|
||||
(int)(targetsize >> 20), nand_is_slc(chip) ? "SLC" : "MLC",
|
||||
|
@ -166,7 +166,7 @@ struct nand_flash_dev nand_flash_ids[] = {
|
||||
};
|
||||
|
||||
/* Manufacturer IDs */
|
||||
static const struct nand_manufacturer nand_manufacturers[] = {
|
||||
static const struct nand_manufacturer_desc nand_manufacturer_descs[] = {
|
||||
{NAND_MFR_AMD, "AMD/Spansion", &amd_nand_manuf_ops},
|
||||
{NAND_MFR_ATO, "ATO"},
|
||||
{NAND_MFR_EON, "Eon"},
|
||||
@ -186,20 +186,20 @@ static const struct nand_manufacturer nand_manufacturers[] = {
|
||||
};
|
||||
|
||||
/**
|
||||
* nand_get_manufacturer - Get manufacturer information from the manufacturer
|
||||
* ID
|
||||
* nand_get_manufacturer_desc - Get manufacturer information from the
|
||||
* manufacturer ID
|
||||
* @id: manufacturer ID
|
||||
*
|
||||
* Returns a pointer a nand_manufacturer object if the manufacturer is defined
|
||||
* Returns a nand_manufacturer_desc object if the manufacturer is defined
|
||||
* in the NAND manufacturers database, NULL otherwise.
|
||||
*/
|
||||
const struct nand_manufacturer *nand_get_manufacturer(u8 id)
|
||||
const struct nand_manufacturer_desc *nand_get_manufacturer_desc(u8 id)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(nand_manufacturers); i++)
|
||||
if (nand_manufacturers[i].id == id)
|
||||
return &nand_manufacturers[i];
|
||||
for (i = 0; i < ARRAY_SIZE(nand_manufacturer_descs); i++)
|
||||
if (nand_manufacturer_descs[i].id == id)
|
||||
return &nand_manufacturer_descs[i];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1163,7 +1163,7 @@ struct nand_chip {
|
||||
void *priv;
|
||||
|
||||
struct {
|
||||
const struct nand_manufacturer *desc;
|
||||
const struct nand_manufacturer_desc *desc;
|
||||
void *priv;
|
||||
} manufacturer;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user