Re: [PATCH v4 05/19] mtd: rawnand: Declare the nand_manufacturer structure out of nand_chip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 25 May 2020 19:42:25 +0200
Miquel Raynal <miquel.raynal@xxxxxxxxxxx> wrote:

> Now that struct nand_manufacturer type is free, use it to store the
> nand_manufacturer_desc and the manufacturer's private data.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>

I'm honestly not convinced this brings any value, but it's also
harmless, so

Reviewed-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>

> ---
>  include/linux/mtd/rawnand.h | 20 ++++++++++++--------
>  1 file changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
> index d8492d966b40..2a9b5d5b315b 100644
> --- a/include/linux/mtd/rawnand.h
> +++ b/include/linux/mtd/rawnand.h
> @@ -1043,10 +1043,21 @@ struct nand_chip_ops {
>  	int (*setup_read_retry)(struct nand_chip *chip, int retry_mode);
>  };
>  
> +/**
> + * struct nand_manufacturer - NAND manufacturer structure
> + * @desc: The manufacturer description
> + * @priv: Private information for the manufacturer driver
> + */
> +struct nand_manufacturer {
> +	const struct nand_manufacturer_desc *desc;
> +	void *priv;
> +};
> +
>  /**
>   * struct nand_chip - NAND Private Flash Chip Data
>   * @base:		Inherit from the generic NAND device
>   * @ops:		NAND chip operations
> + * @manufacturer:	Manufacturer information
>   * @legacy:		All legacy fields/hooks. If you develop a new driver,
>   *			don't even try to use any of these fields/hooks, and if
>   *			you're modifying an existing driver that is using those
> @@ -1106,13 +1117,11 @@ struct nand_chip_ops {
>   *			structure which is shared among multiple independent
>   *			devices.
>   * @priv:		[OPTIONAL] pointer to private chip data
> - * @manufacturer:	[INTERN] Contains manufacturer information
> - * @manufacturer.desc:	[INTERN] Contains manufacturer's description
> - * @manufacturer.priv:	[INTERN] Contains manufacturer private information
>   */
>  
>  struct nand_chip {
>  	struct nand_device base;
> +	struct nand_manufacturer manufacturer;
>  	struct nand_chip_ops ops;
>  	struct nand_legacy legacy;
>  
> @@ -1161,11 +1170,6 @@ struct nand_chip {
>  	struct nand_bbt_descr *badblock_pattern;
>  
>  	void *priv;
> -
> -	struct {
> -		const struct nand_manufacturer_desc *desc;
> -		void *priv;
> -	} manufacturer;
>  };
>  
>  extern const struct mtd_ooblayout_ops nand_ooblayout_sp_ops;


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux