[U-Boot] [PATCH v1 5/6] mtd: nand: omap_gpmc: rename struct nand_bch_priv to struct omap_nand_info

Stefan Roese sr at denx.de
Thu Apr 10 13:05:10 CEST 2014


On 10.04.2014 11:35, Pekon Gupta wrote:
> This patch renames 'struct nand_bch_priv' which currently holds private data only
> for BCH ECC schemes, into 'struct omap_nand_info' so that same can be used for
> all ECC schemes
>
> Signed-off-by: Pekon Gupta <pekon at ti.com>
> ---
>   drivers/mtd/nand/omap_gpmc.c | 58 ++++++++++++++++++++------------------------
>   1 file changed, 26 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
> index 4bd296e..ae541c2 100644
> --- a/drivers/mtd/nand/omap_gpmc.c
> +++ b/drivers/mtd/nand/omap_gpmc.c
> @@ -148,9 +148,9 @@ static int __maybe_unused omap_correct_data(struct mtd_info *mtd, uint8_t *dat,
>   }
>
>   /*
> - * Generic BCH interface
> + * Driver configurations
>    */
> -struct nand_bch_priv {
> +struct omap_nand_info {
>   	struct bch_control *control;
>   	enum omap_ecc ecc_scheme;
>   };
> @@ -161,7 +161,7 @@ struct nand_bch_priv {
>    * library).
>    * When some users with other BCH strength will exists this have to change!
>    */
> -static __maybe_unused struct nand_bch_priv bch_priv = {
> +static __maybe_unused struct omap_nand_info omap_nand_info = {
>   	.control = NULL
>   };
>
> @@ -191,7 +191,7 @@ __maybe_unused
>   static void omap_enable_hwecc(struct mtd_info *mtd, int32_t mode)
>   {
>   	struct nand_chip	*nand	= mtd->priv;
> -	struct nand_bch_priv	*bch	= nand->priv;
> +	struct omap_nand_info	*info = nand->priv;
>   	unsigned int dev_width = (nand->options & NAND_BUSWIDTH_16) ? 1 : 0;
>   	unsigned int ecc_algo = 0;
>   	unsigned int bch_type = 0;
> @@ -200,7 +200,7 @@ static void omap_enable_hwecc(struct mtd_info *mtd, int32_t mode)
>   	u32 ecc_config_val = 0;
>
>   	/* configure GPMC for specific ecc-scheme */
> -	switch (bch->ecc_scheme) {
> +	switch (info->ecc_scheme) {
>   	case OMAP_ECC_HAM1_CODE_SW:
>   		return;
>   	case OMAP_ECC_HAM1_CODE_HW:
> @@ -262,11 +262,11 @@ static int omap_calculate_ecc(struct mtd_info *mtd, const uint8_t *dat,
>   				uint8_t *ecc_code)
>   {
>   	struct nand_chip *chip = mtd->priv;
> -	struct nand_bch_priv *bch = chip->priv;
> +	struct omap_nand_info	*info = chip->priv;
>   	uint32_t *ptr, val = 0;
>   	int8_t i = 0, j;

Nitpicking:

This seems to be the only variable declaration with a tab for 
indentation. As the others are not aligned via tab's I suggest to use 
one space here as well. There are other places in this source where this 
indentation is inconsistent. Please re-check.

Other than this:

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan



More information about the U-Boot mailing list