diff options
| author | Gabor Juhos <j4g8y7@gmail.com> | 2026-09-25 21:06:10 +0200 |
|---|---|---|
| committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2026-10-12 20:17:16 +0200 |
| commit | 19961db84d806c8a7f6cbe457e752ae62bf65ee4 (patch) | |
| tree | c2c2af2d97c0e9e8383c6e2e095a25fe5b8d3538 /drivers | |
| parent | 8e301fd598806b9480b00a2c16314140de7c4db6 (diff) | |
| download | linux-next-19961db84d806c8a7f6cbe457e752ae62bf65ee4.tar.gz linux-next-19961db84d806c8a7f6cbe457e752ae62bf65ee4.zip | |
mtd: rawnand: qcom: make check_flash_errors() more generic
The function gets a 'qcom_nand_host' pointer as a parameter but it is
only used to extract the nand controller's private structure from that.
In order to make the function more generic, change the declaration to
get a 'qcom_nandc_controller' pointer directly, and update the callers
accordingly.
While at it, also change the function name to use a 'qcom_nandc' prefix.
No functional changes. This is in preparation of moving the function
into the 'qpic_common' code to allow reusing it from the 'spi-qpic-snand'
driver.
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/mtd/nand/raw/qcom_nandc.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c index d7642db2e2df..12bfb14cd9a3 100644 --- a/drivers/mtd/nand/raw/qcom_nandc.c +++ b/drivers/mtd/nand/raw/qcom_nandc.c @@ -449,10 +449,9 @@ struct read_stats { }; /* reads back FLASH_STATUS register set by the controller */ -static int check_flash_errors(struct qcom_nand_host *host, int cw_cnt) +static int qcom_nandc_check_flash_errors(struct qcom_nand_controller *nandc, + int cw_cnt) { - struct nand_chip *chip = &host->chip; - struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip); int i; qcom_nandc_dev_to_mem(nandc, true); @@ -538,7 +537,7 @@ qcom_nandc_read_cw_raw(struct mtd_info *mtd, struct nand_chip *chip, return ret; } - return check_flash_errors(host, 1); + return qcom_nandc_check_flash_errors(nandc, 1); } /* @@ -1181,7 +1180,7 @@ static int qcom_nandc_block_bad(struct nand_chip *chip, loff_t ofs) if (ret) goto err; - if (check_flash_errors(host, 1)) { + if (qcom_nandc_check_flash_errors(nandc, 1)) { dev_warn(nandc->dev, "error when trying to read BBM\n"); goto err; } |
