]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtd: rawnand: fsl_elbc: Fix reading address pointer from DT
authorPali Rohár <pali@kernel.org>
Fri, 19 Aug 2022 09:20:01 +0000 (11:20 +0200)
committerMichael Trimarchi <michael@amarulasolutions.com>
Mon, 22 Aug 2022 09:15:57 +0000 (11:15 +0200)
During compilation gcc throws warning:

    drivers/mtd/nand/raw/fsl_elbc_nand.c: In function ‘fsl_elbc_nand_probe’:
    drivers/mtd/nand/raw/fsl_elbc_nand.c:841:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      return fsl_elbc_chip_init(0, (void *)dev_read_addr(dev), dev);
                                   ^

Fix it by using dev_read_addr_ptr() function which returns pointer instead
of dev_read_addr() which returns integer type.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
drivers/mtd/nand/raw/fsl_elbc_nand.c

index e28670a4724a8918d710b6265875f517f5b910a4..4f0acd7c89bbb8ffb29ed0d6c270cb0b6b12be59 100644 (file)
@@ -838,7 +838,7 @@ void board_nand_init(void)
 
 static int fsl_elbc_nand_probe(struct udevice *dev)
 {
-       return fsl_elbc_chip_init(0, (void *)dev_read_addr(dev), dev);
+       return fsl_elbc_chip_init(0, dev_read_addr_ptr(dev), dev);
 }
 
 static const struct udevice_id fsl_elbc_nand_dt_ids[] = {