From: Simon Glass Date: Wed, 10 May 2017 08:21:01 -0600 Subject: [U-Boot] [PATCH v2 22/71] dm: core: Update uclass_find_device_by_phandle() for livetree In-Reply-To: <20170510142150.30515-1-sjg@chromium.org> References: <20170510142150.30515-1-sjg@chromium.org> Message-ID: <20170510142150.30515-23-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Adjust this function to work with livetree. Signed-off-by: Simon Glass --- Changes in v2: None drivers/core/uclass.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 630b2e7336..21dc696da3 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -324,8 +324,7 @@ static int uclass_find_device_by_phandle(enum uclass_id id, int ret; *devp = NULL; - find_phandle = fdtdec_get_int(gd->fdt_blob, dev_of_offset(parent), name, - -1); + find_phandle = dev_read_u32_default(parent, name, -1); if (find_phandle <= 0) return -ENOENT; ret = uclass_get(id, &uc); @@ -335,7 +334,7 @@ static int uclass_find_device_by_phandle(enum uclass_id id, list_for_each_entry(dev, &uc->dev_head, uclass_node) { uint phandle; - phandle = fdt_get_phandle(gd->fdt_blob, dev_of_offset(dev)); + phandle = dev_read_phandle(dev); if (phandle == find_phandle) { *devp = dev; -- 2.13.0.rc2.291.g57267f2277-goog