int ecc_strength;
info->reg = (struct nand_ctlr *)dev_read_addr(dev);
- info->dma_glb = (struct dma_global *)dev_read_addr_index(dev, 1);
- info->dma_nand = (struct dma_ssp *)dev_read_addr_index(dev, 2);
+ info->dma_glb = dev_read_addr_index_ptr(dev, 1);
+ info->dma_nand = dev_read_addr_index_ptr(dev, 2);
info->config.enabled = dev_read_enabled(dev);
ecc_strength = dev_read_u32_default(dev, "nand-ecc-strength", 16);
info->flash_base =
pdata->iobase = dev_read_addr_index(dev, 0);
db->base_io = (void __iomem *)pdata->iobase;
- db->base_data = (void __iomem *)dev_read_addr_index(dev, 1);
+ db->base_data = dev_read_addr_index_ptr(dev, 1);
return 0;
}
{
struct dwmac_meson8b_plat *pdata = dev_get_plat(dev);
- pdata->regs = (void *)dev_read_addr_index(dev, 1);
- if ((fdt_addr_t)pdata->regs == FDT_ADDR_T_NONE)
+ pdata->regs = dev_read_addr_index_ptr(dev, 1);
+ if (!pdata->regs)
return -EINVAL;
pdata->dwmac_setup = (void *)dev_get_driver_data(dev);
struct meson_pcie *priv = dev_get_priv(dev);
int ret;
- priv->dw.dbi_base = (void *)dev_read_addr_index(dev, 0);
+ priv->dw.dbi_base = dev_read_addr_index_ptr(dev, 0);
if (!priv->dw.dbi_base)
- return -ENODEV;
+ return -EINVAL;
dev_dbg(dev, "ELBI address is 0x%p\n", priv->dw.dbi_base);
- priv->meson_cfg_base = (void *)dev_read_addr_index(dev, 1);
+ priv->meson_cfg_base = dev_read_addr_index_ptr(dev, 1);
if (!priv->meson_cfg_base)
- return -ENODEV;
+ return -EINVAL;
dev_dbg(dev, "CFG address is 0x%p\n", priv->meson_cfg_base);
struct rk_pcie *priv = dev_get_priv(dev);
int ret;
- priv->dw.dbi_base = (void *)dev_read_addr_index(dev, 0);
+ priv->dw.dbi_base = dev_read_addr_index_ptr(dev, 0);
if (!priv->dw.dbi_base)
- return -ENODEV;
+ return -EINVAL;
dev_dbg(dev, "DBI address is 0x%p\n", priv->dw.dbi_base);
- priv->apb_base = (void *)dev_read_addr_index(dev, 1);
+ priv->apb_base = dev_read_addr_index_ptr(dev, 1);
if (!priv->apb_base)
- return -ENODEV;
+ return -EINVAL;
dev_dbg(dev, "APB address is 0x%p\n", priv->apb_base);
{
struct sbsa_gwdt_priv *priv = dev_get_priv(dev);
- priv->reg_control = (void __iomem *)dev_read_addr_index(dev, 0);
- if (IS_ERR(priv->reg_control))
- return PTR_ERR(priv->reg_control);
+ priv->reg_control = dev_read_addr_index_ptr(dev, 0);
+ if (!priv->reg_control)
+ return -EINVAL;
- priv->reg_refresh = (void __iomem *)dev_read_addr_index(dev, 1);
- if (IS_ERR(priv->reg_refresh))
- return PTR_ERR(priv->reg_refresh);
+ priv->reg_refresh = dev_read_addr_index_ptr(dev, 1);
+ if (!priv->reg_refresh)
+ return -EINVAL;
return 0;
}