• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision9d1806fadc24811a5338f3fecb82ff5538114455 (tree)
Time2022-07-22 17:34:02
AuthorMichael Trimarchi <michael@amar...>
CommiterMichael Trimarchi

Log Message

mtd: nand: Get rid of mtd variable in function calls

chip points to mtd. Passing chip is enough to have a reference
to mtd when is necessary

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

Change Summary

Incremental Difference

--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -4160,8 +4160,9 @@ static int nand_get_bits_per_cell(u8 cellinfo)
41604160 * chip. The rest of the parameters must be decoded according to generic or
41614161 * manufacturer-specific "extended ID" decoding patterns.
41624162 */
4163-static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip)
4163+static void nand_decode_ext_id(struct nand_chip *chip)
41644164 {
4165+ struct mtd_info *mtd = &chip->mtd;
41654166 int extid, id_len;
41664167 /* The 3rd id byte holds MLC / multichip data */
41674168 chip->bits_per_cell = nand_get_bits_per_cell(chip->id.data[2]);
@@ -4291,7 +4292,7 @@ static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip)
42914292 * compliant and does not have a full-id or legacy-id entry in the nand_ids
42924293 * table.
42934294 */
4294-static void nand_manufacturer_detect(struct mtd_info *mtd, struct nand_chip *chip)
4295+static void nand_manufacturer_detect(struct nand_chip *chip)
42954296 {
42964297 /*
42974298 * Try manufacturer detection if available and use
@@ -4301,7 +4302,7 @@ static void nand_manufacturer_detect(struct mtd_info *mtd, struct nand_chip *chi
43014302 chip->manufacturer.desc->ops->detect)
43024303 chip->manufacturer.desc->ops->detect(chip);
43034304 else
4304- nand_decode_ext_id(mtd, chip);
4305+ nand_decode_ext_id(chip);
43054306 }
43064307
43074308 /*
@@ -4324,9 +4325,9 @@ static int nand_manufacturer_init(struct nand_chip *chip)
43244325 * decodes a matching ID table entry and assigns the MTD size parameters for
43254326 * the chip.
43264327 */
4327-static void nand_decode_id(struct mtd_info *mtd, struct nand_chip *chip,
4328- struct nand_flash_dev *type)
4328+static void nand_decode_id(struct nand_chip *chip, struct nand_flash_dev *type)
43294329 {
4330+ struct mtd_info *mtd = &chip->mtd;
43304331 int maf_id = chip->id.data[0];
43314332
43324333 mtd->erasesize = type->erasesize;
@@ -4439,11 +4440,11 @@ static const struct nand_manufacturers *nand_get_manufacturer_desc(u8 id)
44394440 /*
44404441 * Get the flash and manufacturer id and lookup if the type is supported.
44414442 */
4442-struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
4443- struct nand_chip *chip,
4444- int *maf_id, int *dev_id,
4445- struct nand_flash_dev *type)
4443+struct nand_flash_dev *nand_get_flash_type(struct nand_chip *chip, int *maf_id,
4444+ int *dev_id,
4445+ struct nand_flash_dev *type)
44464446 {
4447+ struct mtd_info *mtd = &chip->mtd;
44474448 const struct nand_manufacturers *manufacturer_desc;
44484449 int busw, ret;
44494450 u8 *id_data = chip->id.data;
@@ -4539,9 +4540,9 @@ struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
45394540 chip->chipsize = (uint64_t)type->chipsize << 20;
45404541
45414542 if (!type->pagesize) {
4542- nand_manufacturer_detect(mtd, chip);
4543+ nand_manufacturer_detect(chip);
45434544 } else {
4544- nand_decode_id(mtd, chip, type);
4545+ nand_decode_id(chip, type);
45454546 }
45464547
45474548 /* Get chip options */
@@ -4729,7 +4730,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips,
47294730 nand_set_defaults(chip, chip->options & NAND_BUSWIDTH_16);
47304731
47314732 /* Read the flash type */
4732- type = nand_get_flash_type(mtd, chip, &nand_maf_id,
4733+ type = nand_get_flash_type(chip, &nand_maf_id,
47334734 &nand_dev_id, table);
47344735
47354736 if (IS_ERR(type)) {
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -29,8 +29,7 @@ struct nand_flash_dev;
2929 struct device_node;
3030
3131 /* Get the flash and manufacturer id and lookup if the type is supported. */
32-struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
33- struct nand_chip *chip,
32+struct nand_flash_dev *nand_get_flash_type(struct nand_chip *chip,
3433 int *maf_id, int *dev_id,
3534 struct nand_flash_dev *type);
3635