[PATCH] mtd: rawnand: fsl_elbc: Fix reading address pointer from DT
Pali Rohár
pali at kernel.org
Fri Aug 19 11:20:01 CEST 2022
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 at kernel.org>
---
drivers/mtd/nand/raw/fsl_elbc_nand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/fsl_elbc_nand.c b/drivers/mtd/nand/raw/fsl_elbc_nand.c
index 48a3687f2728..4a07cf854fff 100644
--- a/drivers/mtd/nand/raw/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/raw/fsl_elbc_nand.c
@@ -839,7 +839,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[] = {
--
2.20.1
More information about the U-Boot
mailing list