Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot
[oweals/u-boot.git] / drivers / power / pmic / max77686.c
index 8295fab3f02d4c162f3a60d0338614be6d170e62..ceca9f96a7f3c237ecd96a8bb24029aad79a9ef9 100644 (file)
@@ -50,13 +50,11 @@ static int max77686_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
 
 static int max77686_bind(struct udevice *dev)
 {
-       int regulators_node;
-       const void *blob = gd->fdt_blob;
+       ofnode regulators_node;
        int children;
 
-       regulators_node = fdt_subnode_offset(blob, dev_of_offset(dev),
-                                            "voltage-regulators");
-       if (regulators_node <= 0) {
+       regulators_node = dev_read_subnode(dev, "voltage-regulators");
+       if (!ofnode_valid(regulators_node)) {
                debug("%s: %s regulators subnode not found!", __func__,
                                                             dev->name);
                return -ENXIO;