mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 15:41:40 +00:00
gpio: sifive: Fix -Wint-to-pointer-cast warning
dev_read_addr() returns a value of type fdt_addr_t which is a 64-bit address and plat->base is a pointer. In a 32-bit build, this causes the following warning seen when building sifive-gpio.c: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Change to use dev_read_addr_ptr(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
This commit is contained in:
parent
2edb02ead7
commit
d710c7e841
1 changed files with 2 additions and 4 deletions
|
@ -157,13 +157,11 @@ static const struct dm_gpio_ops sifive_gpio_ops = {
|
||||||
static int sifive_gpio_of_to_plat(struct udevice *dev)
|
static int sifive_gpio_of_to_plat(struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct sifive_gpio_plat *plat = dev_get_plat(dev);
|
struct sifive_gpio_plat *plat = dev_get_plat(dev);
|
||||||
fdt_addr_t addr;
|
|
||||||
|
|
||||||
addr = dev_read_addr(dev);
|
plat->base = dev_read_addr_ptr(dev);
|
||||||
if (addr == FDT_ADDR_T_NONE)
|
if (!plat->base)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
plat->base = (void *)addr;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue