X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fpower%2Fpmic%2Flp873x.c;h=f5054683139a0a523f15ac71800bb977ad1dccca;hb=b375d84135e26d5ec5034a515af4df5981785f37;hp=307f96bad1b8fefce8961ceaf1e83a840c2b2aa1;hpb=ca1de0b5456e630522c0afe5a556e6851b8afe1e;p=oweals%2Fu-boot.git diff --git a/drivers/power/pmic/lp873x.c b/drivers/power/pmic/lp873x.c index 307f96bad1..f505468313 100644 --- a/drivers/power/pmic/lp873x.c +++ b/drivers/power/pmic/lp873x.c @@ -46,15 +46,13 @@ static int lp873x_read(struct udevice *dev, uint reg, uint8_t *buff, int len) static int lp873x_bind(struct udevice *dev) { - int regulators_node; - const void *blob = gd->fdt_blob; + ofnode regulators_node; int children; - int node = dev->of_offset; - regulators_node = fdt_subnode_offset(blob, node, "regulators"); - - if (regulators_node <= 0) { - printf("%s: %s reg subnode not found!", __func__, dev->name); + regulators_node = dev_read_subnode(dev, "regulators"); + if (!ofnode_valid(regulators_node)) { + debug("%s: %s regulators subnode not found!", __func__, + dev->name); return -ENXIO; }