[v4,05/14] mtd: nand: Fix MediaTek MT7621 SoC build

Message ID 20220722161009.2686504-6-dario.binacchi@amarulasolutions.com
State New
Headers show
Series
  • Port manufacturer specific initialization
Related show

Commit Message

Dario Binacchi July 22, 2022, 4:09 p.m. UTC
From: Michael Trimarchi <michael@amarulasolutions.com>

nand_get_flash_type was reworked in commit 1ca6f9483e9ab5. This change
break the Mediatek MT721. Fix it adjust the function call parameters

+include/linux/mtd/rawnand.h:32:62: note: expected 'struct nand_chip *' but argument is of type 'struct mtd_info *'
+   32 | struct nand_flash_dev *nand_get_flash_type(struct nand_chip *chip,
+      |                                            ~~~~~~~~~~~~~~~~~~^~~~
+drivers/mtd/nand/raw/mt7621_nand.c:1189:48: error: passing argument 2 of 'nand_get_flash_type' from incompatible pointer type [-Werror=incompatible-pointer-types]
+      |                                                ^~~~
+      |                                                |
+      |                                                struct nand_chip *
+include/linux/mtd/rawnand.h:33:49: note: expected 'int *' but argument is of type 'struct nand_chip *'
+   33 |                                            int *maf_id, int *dev_id,

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Changes in v4:
- Add the patch to the series.

 drivers/mtd/nand/raw/mt7621_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

'Jan Kiszka' via Amarula Linux July 26, 2022, 12:53 a.m. UTC | #1
On Fri, 2022-07-22 at 18:09 +0200, Dario Binacchi wrote:
> From: Michael Trimarchi <michael@amarulasolutions.com>
> 
> nand_get_flash_type was reworked in commit 1ca6f9483e9ab5. This
> change
> break the Mediatek MT721. Fix it adjust the function call parameters
> 
> +include/linux/mtd/rawnand.h:32:62: note: expected 'struct nand_chip
> *' but argument is of type 'struct mtd_info *'
> +   32 | struct nand_flash_dev *nand_get_flash_type(struct nand_chip
> *chip,
> +      |                                            ~~~~~~~~~~~~~~~~~
> ~^~~~
> +drivers/mtd/nand/raw/mt7621_nand.c:1189:48: error: passing argument
> 2 of 'nand_get_flash_type' from incompatible pointer type [-
> Werror=incompatible-pointer-types]
> +      |                                                ^~~~
> +      |                                                |
> +      |                                                struct
> nand_chip *
> +include/linux/mtd/rawnand.h:33:49: note: expected 'int *' but
> argument is of type 'struct nand_chip *'
> +   33 |                                            int *maf_id, int
> *dev_id,
> 
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> Changes in v4:
> - Add the patch to the series.
> 
>  drivers/mtd/nand/raw/mt7621_nand.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/raw/mt7621_nand.c
> b/drivers/mtd/nand/raw/mt7621_nand.c
> index 2fd89349392b..9763ae6dc51a 100644
> --- a/drivers/mtd/nand/raw/mt7621_nand.c
> +++ b/drivers/mtd/nand/raw/mt7621_nand.c
> @@ -1186,7 +1186,7 @@ int mt7621_nfc_spl_post_init(struct mt7621_nfc
> *nfc)
>  	int nand_maf_id, nand_dev_id;
>  	struct nand_flash_dev *type;
>  
> -	type = nand_get_flash_type(&nand->mtd, nand, &nand_maf_id,
> +	type = nand_get_flash_type(nand, &nand_maf_id,
>  				   &nand_dev_id, NULL);
>  
>  	if (IS_ERR(type))

Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>

Best Regards,
Weijie

Patch

diff --git a/drivers/mtd/nand/raw/mt7621_nand.c b/drivers/mtd/nand/raw/mt7621_nand.c
index 2fd89349392b..9763ae6dc51a 100644
--- a/drivers/mtd/nand/raw/mt7621_nand.c
+++ b/drivers/mtd/nand/raw/mt7621_nand.c
@@ -1186,7 +1186,7 @@  int mt7621_nfc_spl_post_init(struct mt7621_nfc *nfc)
 	int nand_maf_id, nand_dev_id;
 	struct nand_flash_dev *type;
 
-	type = nand_get_flash_type(&nand->mtd, nand, &nand_maf_id,
+	type = nand_get_flash_type(nand, &nand_maf_id,
 				   &nand_dev_id, NULL);
 
 	if (IS_ERR(type))