[PATCH 1/7] mtd: replace name of 'rfree' field with 'free' in struct mtd_ooblayout_ops to better match it's description

Michael Nazzareno Trimarchi michael at amarulasolutions.com
Fri Oct 7 13:34:09 CEST 2022


Hi mikhail

On Thu, Oct 6, 2022 at 5:15 AM <mikhail.kshevetskiy at iopsys.eu> wrote:
>
> From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
>
> In the description of struct mtd_ooblayout_ops we see:
>
>  * @free: function returning a free region in the OOB area.
>  *        Should return -ERANGE if %section exceeds the total number of
>  *        free sections.
>
> but corresponding field of the structure named as 'rfree'. This is
> wrong. Fix it the asme way as was done previously in linux kernel.
>

About this change, there was a commit from Simon 8d38a8459b0
that was renamed. You ask basically to revert it

Michael

> Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
> ---
>  drivers/mtd/mtdcore.c                | 4 ++--
>  drivers/mtd/nand/raw/denali.c        | 2 +-
>  drivers/mtd/nand/raw/octeontx_nand.c | 2 +-
>  drivers/mtd/nand/raw/rockchip_nfc.c  | 2 +-
>  drivers/mtd/nand/spi/core.c          | 2 +-
>  drivers/mtd/nand/spi/gigadevice.c    | 2 +-
>  drivers/mtd/nand/spi/macronix.c      | 2 +-
>  drivers/mtd/nand/spi/micron.c        | 2 +-
>  drivers/mtd/nand/spi/toshiba.c       | 2 +-
>  drivers/mtd/nand/spi/winbond.c       | 2 +-
>  include/linux/mtd/mtd.h              | 4 ++--
>  11 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index aa78d41a55..df8f3b8284 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -1208,10 +1208,10 @@ int mtd_ooblayout_free(struct mtd_info *mtd, int section,
>         if (!mtd || section < 0)
>                 return -EINVAL;
>
> -       if (!mtd->ooblayout || !mtd->ooblayout->rfree)
> +       if (!mtd->ooblayout || !mtd->ooblayout->free)
>                 return -ENOTSUPP;
>
> -       return mtd->ooblayout->rfree(mtd, section, oobfree);
> +       return mtd->ooblayout->free(mtd, section, oobfree);
>  }
>  EXPORT_SYMBOL_GPL(mtd_ooblayout_free);
>
> diff --git a/drivers/mtd/nand/raw/denali.c b/drivers/mtd/nand/raw/denali.c
> index c827f80281..ed24b84d82 100644
> --- a/drivers/mtd/nand/raw/denali.c
> +++ b/drivers/mtd/nand/raw/denali.c
> @@ -1166,7 +1166,7 @@ static int denali_ooblayout_free(struct mtd_info *mtd, int section,
>
>  static const struct mtd_ooblayout_ops denali_ooblayout_ops = {
>         .ecc = denali_ooblayout_ecc,
> -       .rfree = denali_ooblayout_free,
> +       .free = denali_ooblayout_free,
>  };
>
>  static int denali_multidev_fixup(struct denali_nand_info *denali)
> diff --git a/drivers/mtd/nand/raw/octeontx_nand.c b/drivers/mtd/nand/raw/octeontx_nand.c
> index b338b204f3..4023bbcec6 100644
> --- a/drivers/mtd/nand/raw/octeontx_nand.c
> +++ b/drivers/mtd/nand/raw/octeontx_nand.c
> @@ -435,7 +435,7 @@ static int nand_ooblayout_free_lp(struct mtd_info *mtd, int section,
>
>  static const struct mtd_ooblayout_ops nand_ooblayout_lp_ops = {
>         .ecc = nand_ooblayout_ecc_lp,
> -       .rfree = nand_ooblayout_free_lp,
> +       .free = nand_ooblayout_free_lp,
>  };
>
>  static inline struct octeontx_nand_chip *to_otx_nand(struct nand_chip *nand)
> diff --git a/drivers/mtd/nand/raw/rockchip_nfc.c b/drivers/mtd/nand/raw/rockchip_nfc.c
> index d016d25575..1ab429f430 100644
> --- a/drivers/mtd/nand/raw/rockchip_nfc.c
> +++ b/drivers/mtd/nand/raw/rockchip_nfc.c
> @@ -849,7 +849,7 @@ static int rk_nfc_ooblayout_ecc(struct mtd_info *mtd, int section,
>  }
>
>  static const struct mtd_ooblayout_ops rk_nfc_ooblayout_ops = {
> -       .rfree = rk_nfc_ooblayout_free,
> +       .free = rk_nfc_ooblayout_free,
>         .ecc = rk_nfc_ooblayout_ecc,
>  };
>
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index 134bf22c80..4edb7ae952 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -1021,7 +1021,7 @@ static int spinand_noecc_ooblayout_free(struct mtd_info *mtd, int section,
>
>  static const struct mtd_ooblayout_ops spinand_noecc_ooblayout = {
>         .ecc = spinand_noecc_ooblayout_ecc,
> -       .rfree = spinand_noecc_ooblayout_free,
> +       .free = spinand_noecc_ooblayout_free,
>  };
>
>  static int spinand_init(struct spinand_device *spinand)
> diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c
> index a2c93486f4..25d9f80d26 100644
> --- a/drivers/mtd/nand/spi/gigadevice.c
> +++ b/drivers/mtd/nand/spi/gigadevice.c
> @@ -154,7 +154,7 @@ static int gd5fxgq5xexxg_ecc_get_status(struct spinand_device *spinand,
>
>  static const struct mtd_ooblayout_ops gd5fxgqxxexxg_ooblayout = {
>         .ecc = gd5fxgqxxexxg_ooblayout_ecc,
> -       .rfree = gd5fxgqxxexxg_ooblayout_free,
> +       .free = gd5fxgqxxexxg_ooblayout_free,
>  };
>
>  static const struct spinand_info gigadevice_spinand_table[] = {
> diff --git a/drivers/mtd/nand/spi/macronix.c b/drivers/mtd/nand/spi/macronix.c
> index 6d643a8000..6a1d6a1793 100644
> --- a/drivers/mtd/nand/spi/macronix.c
> +++ b/drivers/mtd/nand/spi/macronix.c
> @@ -51,7 +51,7 @@ static int mx35lfxge4ab_ooblayout_free(struct mtd_info *mtd, int section,
>
>  static const struct mtd_ooblayout_ops mx35lfxge4ab_ooblayout = {
>         .ecc = mx35lfxge4ab_ooblayout_ecc,
> -       .rfree = mx35lfxge4ab_ooblayout_free,
> +       .free = mx35lfxge4ab_ooblayout_free,
>  };
>
>  static int mx35lf1ge4ab_get_eccsr(struct spinand_device *spinand, u8 *eccsr)
> diff --git a/drivers/mtd/nand/spi/micron.c b/drivers/mtd/nand/spi/micron.c
> index 6bacf14aaf..3f5848aacd 100644
> --- a/drivers/mtd/nand/spi/micron.c
> +++ b/drivers/mtd/nand/spi/micron.c
> @@ -75,7 +75,7 @@ static int micron_8_ooblayout_free(struct mtd_info *mtd, int section,
>
>  static const struct mtd_ooblayout_ops micron_8_ooblayout = {
>         .ecc = micron_8_ooblayout_ecc,
> -       .rfree = micron_8_ooblayout_free,
> +       .free = micron_8_ooblayout_free,
>  };
>
>  static int micron_select_target(struct spinand_device *spinand,
> diff --git a/drivers/mtd/nand/spi/toshiba.c b/drivers/mtd/nand/spi/toshiba.c
> index c2cd3b426b..2a7b201bb1 100644
> --- a/drivers/mtd/nand/spi/toshiba.c
> +++ b/drivers/mtd/nand/spi/toshiba.c
> @@ -68,7 +68,7 @@ static int tx58cxgxsxraix_ooblayout_free(struct mtd_info *mtd, int section,
>
>  static const struct mtd_ooblayout_ops tx58cxgxsxraix_ooblayout = {
>         .ecc = tx58cxgxsxraix_ooblayout_ecc,
> -       .rfree = tx58cxgxsxraix_ooblayout_free,
> +       .free = tx58cxgxsxraix_ooblayout_free,
>  };
>
>  static int tx58cxgxsxraix_ecc_get_status(struct spinand_device *spinand,
> diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
> index c119486efb..119fa135b1 100644
> --- a/drivers/mtd/nand/spi/winbond.c
> +++ b/drivers/mtd/nand/spi/winbond.c
> @@ -61,7 +61,7 @@ static int w25m02gv_ooblayout_free(struct mtd_info *mtd, int section,
>
>  static const struct mtd_ooblayout_ops w25m02gv_ooblayout = {
>         .ecc = w25m02gv_ooblayout_ecc,
> -       .rfree = w25m02gv_ooblayout_free,
> +       .free = w25m02gv_ooblayout_free,
>  };
>
>  static int w25m02gv_select_target(struct spinand_device *spinand,
> diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
> index ff635bd716..03ccf28b06 100644
> --- a/include/linux/mtd/mtd.h
> +++ b/include/linux/mtd/mtd.h
> @@ -129,8 +129,8 @@ struct mtd_oob_region {
>  struct mtd_ooblayout_ops {
>         int (*ecc)(struct mtd_info *mtd, int section,
>                    struct mtd_oob_region *oobecc);
> -       int (*rfree)(struct mtd_info *mtd, int section,
> -                    struct mtd_oob_region *oobfree);
> +       int (*free)(struct mtd_info *mtd, int section,
> +                   struct mtd_oob_region *oobfree);
>  };
>
>  /*
> --
> 2.35.1
>


-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael at amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info at amarulasolutions.com
www.amarulasolutions.com


More information about the U-Boot mailing list