Commit 858838b8 authored by Boris Brezillon's avatar Boris Brezillon Committed by Miquel Raynal
Browse files

mtd: rawnand: Pass a nand_chip object to chip->setup_data_interface()



Let's make the raw NAND API consistent by patching all helpers and
hooks to take a nand_chip object instead of an mtd_info one or
remove the mtd_info object when both are passed.

Let's tackle the chip->setup_data_interface() hook.

Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 2e7f1cec
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1448,10 +1448,9 @@ static int atmel_hsmc_nand_setup_data_interface(struct atmel_nand *nand,
	return 0;
}

static int atmel_nand_setup_data_interface(struct mtd_info *mtd, int csline,
static int atmel_nand_setup_data_interface(struct nand_chip *chip, int csline,
					const struct nand_data_interface *conf)
{
	struct nand_chip *chip = mtd_to_nand(mtd);
	struct atmel_nand *nand = to_atmel_nand(chip);
	struct atmel_nand_controller *nc;

+2 −2
Original line number Diff line number Diff line
@@ -932,10 +932,10 @@ static int denali_erase(struct nand_chip *chip, int page)
	return irq_status & INTR__ERASE_COMP ? 0 : -EIO;
}

static int denali_setup_data_interface(struct mtd_info *mtd, int chipnr,
static int denali_setup_data_interface(struct nand_chip *chip, int chipnr,
				       const struct nand_data_interface *conf)
{
	struct denali_nand_info *denali = mtd_to_denali(mtd);
	struct denali_nand_info *denali = mtd_to_denali(nand_to_mtd(chip));
	const struct nand_sdr_timings *timings;
	unsigned long t_x, mult_x;
	int acc_clks, re_2_we, re_2_re, we_2_re, addr_2_data;
+1 −2
Original line number Diff line number Diff line
@@ -340,10 +340,9 @@ static int fsmc_calc_timings(struct fsmc_nand_data *host,
	return 0;
}

static int fsmc_setup_data_interface(struct mtd_info *mtd, int csline,
static int fsmc_setup_data_interface(struct nand_chip *nand, int csline,
				     const struct nand_data_interface *conf)
{
	struct nand_chip *nand = mtd_to_nand(mtd);
	struct fsmc_nand_data *host = nand_get_controller_data(nand);
	struct fsmc_nand_timings tims;
	const struct nand_sdr_timings *sdrt;
+1 −2
Original line number Diff line number Diff line
@@ -471,10 +471,9 @@ void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
	udelay(dll_wait_time_us);
}

int gpmi_setup_data_interface(struct mtd_info *mtd, int chipnr,
int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
			      const struct nand_data_interface *conf)
{
	struct nand_chip *chip = mtd_to_nand(mtd);
	struct gpmi_nand_data *this = nand_get_controller_data(chip);
	const struct nand_sdr_timings *sdr;

+1 −1
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ int gpmi_is_ready(struct gpmi_nand_data *, unsigned chip);
int gpmi_send_command(struct gpmi_nand_data *);
int gpmi_enable_clk(struct gpmi_nand_data *this);
int gpmi_disable_clk(struct gpmi_nand_data *this);
int gpmi_setup_data_interface(struct mtd_info *mtd, int chipnr,
int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
			      const struct nand_data_interface *conf);
void gpmi_nfc_apply_timings(struct gpmi_nand_data *this);
int gpmi_read_data(struct gpmi_nand_data *, void *buf, int len);
Loading