|
@@ -5960,7 +5960,7 @@ static int nand_dt_init(struct nand_chip *chip)
|
|
|
|
|
|
/**
|
|
|
* nand_scan_ident - Scan for the NAND device
|
|
|
- * @mtd: MTD device structure
|
|
|
+ * @chip: NAND chip object
|
|
|
* @maxchips: number of chips to scan for
|
|
|
* @table: alternative NAND ID table
|
|
|
*
|
|
@@ -5972,11 +5972,11 @@ static int nand_dt_init(struct nand_chip *chip)
|
|
|
* prevented dynamic allocations during this phase which was unconvenient and
|
|
|
* as been banned for the benefit of the ->init_ecc()/cleanup_ecc() hooks.
|
|
|
*/
|
|
|
-static int nand_scan_ident(struct mtd_info *mtd, int maxchips,
|
|
|
+static int nand_scan_ident(struct nand_chip *chip, int maxchips,
|
|
|
struct nand_flash_dev *table)
|
|
|
{
|
|
|
+ struct mtd_info *mtd = nand_to_mtd(chip);
|
|
|
int i, nand_maf_id, nand_dev_id;
|
|
|
- struct nand_chip *chip = mtd_to_nand(mtd);
|
|
|
int ret;
|
|
|
|
|
|
/* Enforce the right timings for reset/detection */
|
|
@@ -6430,15 +6430,15 @@ static bool nand_ecc_strength_good(struct mtd_info *mtd)
|
|
|
|
|
|
/**
|
|
|
* nand_scan_tail - Scan for the NAND device
|
|
|
- * @mtd: MTD device structure
|
|
|
+ * @chip: NAND chip object
|
|
|
*
|
|
|
* This is the second phase of the normal nand_scan() function. It fills out
|
|
|
* all the uninitialized function pointers with the defaults and scans for a
|
|
|
* bad block table if appropriate.
|
|
|
*/
|
|
|
-static int nand_scan_tail(struct mtd_info *mtd)
|
|
|
+static int nand_scan_tail(struct nand_chip *chip)
|
|
|
{
|
|
|
- struct nand_chip *chip = mtd_to_nand(mtd);
|
|
|
+ struct mtd_info *mtd = nand_to_mtd(chip);
|
|
|
struct nand_ecc_ctrl *ecc = &chip->ecc;
|
|
|
int ret, i;
|
|
|
|
|
@@ -6777,7 +6777,7 @@ static void nand_detach(struct nand_chip *chip)
|
|
|
|
|
|
/**
|
|
|
* nand_scan_with_ids - [NAND Interface] Scan for the NAND device
|
|
|
- * @mtd: MTD device structure
|
|
|
+ * @chip: NAND chip object
|
|
|
* @maxchips: number of chips to scan for. @nand_scan_ident() will not be run if
|
|
|
* this parameter is zero (useful for specific drivers that must
|
|
|
* handle this part of the process themselves, e.g docg4).
|
|
@@ -6787,14 +6787,13 @@ static void nand_detach(struct nand_chip *chip)
|
|
|
* The flash ID is read and the mtd/chip structures are filled with the
|
|
|
* appropriate values.
|
|
|
*/
|
|
|
-int nand_scan_with_ids(struct mtd_info *mtd, int maxchips,
|
|
|
+int nand_scan_with_ids(struct nand_chip *chip, int maxchips,
|
|
|
struct nand_flash_dev *ids)
|
|
|
{
|
|
|
- struct nand_chip *chip = mtd_to_nand(mtd);
|
|
|
int ret;
|
|
|
|
|
|
if (maxchips) {
|
|
|
- ret = nand_scan_ident(mtd, maxchips, ids);
|
|
|
+ ret = nand_scan_ident(chip, maxchips, ids);
|
|
|
if (ret)
|
|
|
return ret;
|
|
|
}
|
|
@@ -6803,7 +6802,7 @@ int nand_scan_with_ids(struct mtd_info *mtd, int maxchips,
|
|
|
if (ret)
|
|
|
goto cleanup_ident;
|
|
|
|
|
|
- ret = nand_scan_tail(mtd);
|
|
|
+ ret = nand_scan_tail(chip);
|
|
|
if (ret)
|
|
|
goto detach_chip;
|
|
|
|