From e5822ecba2d73e64ca55c26fc4762d9e80b1f1b5 Mon Sep 17 00:00:00 2001 From: Johan Jonker Date: Mon, 13 Mar 2023 01:31:49 +0100 Subject: drivers: use dev_read_addr_index_ptr when cast to pointer The fdt_addr_t and phys_addr_t size have been decoupled. A 32bit CPU can expect 64-bit data from the device tree parser, so use dev_read_addr_index_ptr instead of the dev_read_addr_index function in the various files in the drivers directory that cast to a pointer. As we are there also streamline the error response to -EINVAL on return. Signed-off-by: Johan Jonker Reviewed-by: Michael Trimarchi Reviewed-by: Simon Glass --- drivers/watchdog/sbsa_gwdt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/watchdog') diff --git a/drivers/watchdog/sbsa_gwdt.c b/drivers/watchdog/sbsa_gwdt.c index f43cd3f..96d0466 100644 --- a/drivers/watchdog/sbsa_gwdt.c +++ b/drivers/watchdog/sbsa_gwdt.c @@ -98,13 +98,13 @@ static int sbsa_gwdt_of_to_plat(struct udevice *dev) { 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; } -- cgit v1.1