[RFC PATCH v2 3/6] mtd: nand: use a static data_interface in the nand_chip structure

Boris Brezillon boris.brezillon at free-electrons.com
Wed Nov 8 06:54:29 PST 2017


On Tue,  7 Nov 2017 15:54:16 +0100
Miquel Raynal <miquel.raynal at free-electrons.com> wrote:

> diff --git a/drivers/mtd/nand/nand_timings.c b/drivers/mtd/nand/nand_timings.c
> index 5d1533bcc5bd..5eac097be7f8 100644
> --- a/drivers/mtd/nand/nand_timings.c
> +++ b/drivers/mtd/nand/nand_timings.c
> @@ -283,17 +283,17 @@ const struct nand_sdr_timings *onfi_async_timing_mode_to_sdr_timings(int mode)
>  EXPORT_SYMBOL(onfi_async_timing_mode_to_sdr_timings);
>  
>  /**
> - * onfi_init_data_interface - [NAND Interface] Initialize a data interface from
> + * onfi_fill_data_interface - [NAND Interface] Initialize a data interface from
>   * given ONFI mode
> - * @iface: The data interface to be initialized
>   * @mode: The ONFI timing mode
>   */
> -int onfi_init_data_interface(struct nand_chip *chip,
> -			     struct nand_data_interface *iface,
> +int onfi_fill_data_interface(struct nand_chip *chip,
>  			     enum nand_data_interface_type type,
>  			     int timing_mode)
>  {
> -	if (type != NAND_SDR_IFACE)
> +	struct nand_data_interface *iface = &chip->data_interface;
> +
> +	if (iface->type != NAND_SDR_IFACE)

You should test type, not iface->type.



More information about the linux-mtd mailing list