[PATCH] mtd: rawnand: fsl_elbc: Fix reading address pointer from DT
Michael Nazzareno Trimarchi
michael at amarulasolutions.com
Mon Aug 22 11:55:00 CEST 2022
On Mon, Aug 22, 2022 at 11:06 AM Dario Binacchi
<dario.binacchi at amarulasolutions.com> wrote:
>
> Hi Pali
>
> On Fri, Aug 19, 2022 at 11:20 AM Pali Rohár <pali at kernel.org> wrote:
> >
> > 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
> >
>
> Reviewed-by: Dario Binacchi <dario.binacchi at amarulasolutions.com>
>
Applied thanks
> Thanks and regards,
> Dario
> --
>
> Dario Binacchi
>
> Embedded Linux Developer
>
> dario.binacchi at amarulasolutions.com
>
> __________________________________
>
>
> Amarula Solutions SRL
>
> Via Le Canevare 30, 31100 Treviso, Veneto, IT
>
> T. +39 042 243 5310
> info at amarulasolutions.com
>
> www.amarulasolutions.com
--
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