summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-06-09 20:30:44 +0200
committerWolfram Sang <wsa@kernel.org>2023-06-14 10:36:33 +0200
commit9d178e00583ee803dd48ec60916c64b87f5449e7 (patch)
treeda3362d42a93da4b0bb134ec1cf50d1dc05fcbfe /drivers/i2c
parenti2c: imx-lpi2c: Don't open-code DIV_ROUND_UP (diff)
downloadlinux-9d178e00583ee803dd48ec60916c64b87f5449e7.tar.xz
linux-9d178e00583ee803dd48ec60916c64b87f5449e7.zip
i2c: mpc: Use of_property_read_reg() to parse "reg"
Use the recently added of_property_read_reg() helper to get the untranslated "reg" address value. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-mpc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index a308afb3cca5..fb1b640f33b7 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -316,9 +316,10 @@ static void mpc_i2c_setup_512x(struct device_node *node,
if (node_ctrl) {
ctrl = of_iomap(node_ctrl, 0);
if (ctrl) {
+ u64 addr;
/* Interrupt enable bits for i2c-0/1/2: bit 24/26/28 */
- pval = of_get_property(node, "reg", NULL);
- idx = (*pval & 0xff) / 0x20;
+ of_property_read_reg(node, 0, &addr, NULL);
+ idx = (addr & 0xff) / 0x20;
setbits32(ctrl, 1 << (24 + idx * 2));
iounmap(ctrl);
}