summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2020-08-04 14:14:43 +0900
committerSimon Glass <sjg@chromium.org>2020-08-22 08:53:37 -0600
commit702e57e113d85fef60ebe9e5c87194414666cfac (patch)
tree58d9823923bb1af7b116e3b47b537769f0719cd7 /drivers/i2c
parent1450bff3e4719d1b34189bf62ad19d0e3c10a548 (diff)
treewide: convert devfdt_get_addr_ptr() to dev_read_addr_ptr()
When you enable CONFIG_OF_LIVE, you will end up with a lot of conversions. To help this tedious work, this commit converts devfdt_get_addr_ptr() to dev_read_addr_ptr() by coccinelle. I also removed redundant casts because dev_read_addr_ptr() returns an opaque pointer. To generate this commit, I ran the following semantic patch excluding include/dm/. <smpl> @@ type T; expression dev; @@ -(T *)devfdt_get_addr_ptr(dev) +dev_read_addr_ptr(dev) @@ expression dev; @@ -devfdt_get_addr_ptr(dev) +dev_read_addr_ptr(dev) </smpl> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/ast_i2c.c2
-rw-r--r--drivers/i2c/designware_i2c.c2
-rw-r--r--drivers/i2c/mv_i2c.c2
-rw-r--r--drivers/i2c/mvtwsi.c4
4 files changed, 5 insertions, 5 deletions
diff --git a/drivers/i2c/ast_i2c.c b/drivers/i2c/ast_i2c.c
index 253e653666..2cdfb5561b 100644
--- a/drivers/i2c/ast_i2c.c
+++ b/drivers/i2c/ast_i2c.c
@@ -92,7 +92,7 @@ static int ast_i2c_ofdata_to_platdata(struct udevice *dev)
struct ast_i2c_priv *priv = dev_get_priv(dev);
int ret;
- priv->regs = devfdt_get_addr_ptr(dev);
+ priv->regs = dev_read_addr_ptr(dev);
if (!priv->regs)
return -EINVAL;
diff --git a/drivers/i2c/designware_i2c.c b/drivers/i2c/designware_i2c.c
index cf892c69d9..569a5d39b4 100644
--- a/drivers/i2c/designware_i2c.c
+++ b/drivers/i2c/designware_i2c.c
@@ -768,7 +768,7 @@ int designware_i2c_ofdata_to_platdata(struct udevice *bus)
int ret;
if (!priv->regs)
- priv->regs = (struct i2c_regs *)devfdt_get_addr_ptr(bus);
+ priv->regs = dev_read_addr_ptr(bus);
dev_read_u32(bus, "i2c-scl-rising-time-ns", &priv->scl_rise_time_ns);
dev_read_u32(bus, "i2c-scl-falling-time-ns", &priv->scl_fall_time_ns);
dev_read_u32(bus, "i2c-sda-hold-time-ns", &priv->sda_hold_time_ns);
diff --git a/drivers/i2c/mv_i2c.c b/drivers/i2c/mv_i2c.c
index 59675d8d57..82e8fdac41 100644
--- a/drivers/i2c/mv_i2c.c
+++ b/drivers/i2c/mv_i2c.c
@@ -580,7 +580,7 @@ static int mv_i2c_probe(struct udevice *bus)
{
struct mv_i2c_priv *priv = dev_get_priv(bus);
- priv->base = (void *)devfdt_get_addr_ptr(bus);
+ priv->base = dev_read_addr_ptr(bus);
return 0;
}
diff --git a/drivers/i2c/mvtwsi.c b/drivers/i2c/mvtwsi.c
index d3cc9b9d83..fdb8fd42e5 100644
--- a/drivers/i2c/mvtwsi.c
+++ b/drivers/i2c/mvtwsi.c
@@ -798,7 +798,7 @@ static int mvtwsi_i2c_ofdata_to_platdata(struct udevice *bus)
{
struct mvtwsi_i2c_dev *dev = dev_get_priv(bus);
- dev->base = devfdt_get_addr_ptr(bus);
+ dev->base = dev_read_addr_ptr(bus);
if (!dev->base)
return -ENOMEM;
@@ -820,7 +820,7 @@ static void twsi_disable_i2c_slave(struct mvtwsi_registers *twsi)
static int mvtwsi_i2c_bind(struct udevice *bus)
{
- struct mvtwsi_registers *twsi = devfdt_get_addr_ptr(bus);
+ struct mvtwsi_registers *twsi = dev_read_addr_ptr(bus);
/* Disable the hidden slave in i2c0 of these platforms */
if ((IS_ENABLED(CONFIG_ARMADA_38X) || IS_ENABLED(CONFIG_ARCH_KIRKWOOD))