#include <linux/export.h>
 #include <linux/mutex.h>
 #include <linux/err.h>
-#include <linux/of.h>
+#include <linux/property.h>
 #include <linux/rbtree.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
                                         const struct regmap_bus *bus,
                                         const struct regmap_config *config)
 {
-       struct device_node *np;
+       struct fwnode_handle *fwnode = dev ? dev_fwnode(dev) : NULL;
        enum regmap_endian endian;
 
        /* Retrieve the endianness specification from the regmap config */
        if (endian != REGMAP_ENDIAN_DEFAULT)
                return endian;
 
-       /* If the dev and dev->of_node exist try to get endianness from DT */
-       if (dev && dev->of_node) {
-               np = dev->of_node;
-
-               /* Parse the device's DT node for an endianness specification */
-               if (of_property_read_bool(np, "big-endian"))
-                       endian = REGMAP_ENDIAN_BIG;
-               else if (of_property_read_bool(np, "little-endian"))
-                       endian = REGMAP_ENDIAN_LITTLE;
-               else if (of_property_read_bool(np, "native-endian"))
-                       endian = REGMAP_ENDIAN_NATIVE;
-
-               /* If the endianness was specified in DT, use that */
-               if (endian != REGMAP_ENDIAN_DEFAULT)
-                       return endian;
-       }
+       /* If the firmware node exist try to get endianness from it */
+       if (fwnode_property_read_bool(fwnode, "big-endian"))
+               endian = REGMAP_ENDIAN_BIG;
+       else if (fwnode_property_read_bool(fwnode, "little-endian"))
+               endian = REGMAP_ENDIAN_LITTLE;
+       else if (fwnode_property_read_bool(fwnode, "native-endian"))
+               endian = REGMAP_ENDIAN_NATIVE;
+
+       /* If the endianness was specified in fwnode, use that */
+       if (endian != REGMAP_ENDIAN_DEFAULT)
+               return endian;
 
        /* Retrieve the endianness specification from the bus config */
        if (bus && bus->val_format_endian_default)