summaryrefslogtreecommitdiff
path: root/drivers/net/mdio
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-06-09 12:26:16 -0600
committerDavid S. Miller <davem@davemloft.net>2023-06-12 10:56:01 +0100
commitb30a1f305b7bfde19c2ddbb053b51705eef65553 (patch)
tree73d06e0afb1de8e47aa081abb3e69ece5b56f02b /drivers/net/mdio
parent61ab5a060a57d7aa77cfbc860c84a25d7d1ac3cf (diff)
mdio: mdio-mux-mmioreg: 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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mdio')
-rw-r--r--drivers/net/mdio/mdio-mux-mmioreg.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/mdio/mdio-mux-mmioreg.c b/drivers/net/mdio/mdio-mux-mmioreg.c
index c02c9c660016..09af150ed774 100644
--- a/drivers/net/mdio/mdio-mux-mmioreg.c
+++ b/drivers/net/mdio/mdio-mux-mmioreg.c
@@ -140,14 +140,15 @@ static int mdio_mux_mmioreg_probe(struct platform_device *pdev)
* set any bits outside of the 'mask'.
*/
for_each_available_child_of_node(np, np2) {
- iprop = of_get_property(np2, "reg", &len);
- if (!iprop || len != sizeof(uint32_t)) {
+ u64 reg;
+
+ if (of_property_read_reg(np2, 0, &reg, NULL)) {
dev_err(&pdev->dev, "mdio-mux child node %pOF is "
"missing a 'reg' property\n", np2);
of_node_put(np2);
return -ENODEV;
}
- if (be32_to_cpup(iprop) & ~s->mask) {
+ if ((u32)reg & ~s->mask) {
dev_err(&pdev->dev, "mdio-mux child node %pOF has "
"a 'reg' value with unmasked bits\n",
np2);