From: Simon Glass Date: Thu, 18 May 2017 20:09:58 -0600 Subject: [U-Boot] [PATCH v3 68/72] dm: sandbox: spi: Convert driver to support livetree In-Reply-To: <20170519021002.1098-1-sjg@chromium.org> References: <20170519021002.1098-1-sjg@chromium.org> Message-ID: <20170519021002.1098-69-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 Update this driver to support a live device tree. Signed-off-by: Simon Glass --- Changes in v3: None Changes in v2: None drivers/mtd/spi/sandbox.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c index a53f4ebc68..1ba6815232 100644 --- a/drivers/mtd/spi/sandbox.c +++ b/drivers/mtd/spi/sandbox.c @@ -515,11 +515,9 @@ static int sandbox_sf_xfer(struct udevice *dev, unsigned int bitlen, int sandbox_sf_ofdata_to_platdata(struct udevice *dev) { struct sandbox_spi_flash_plat_data *pdata = dev_get_platdata(dev); - const void *blob = gd->fdt_blob; - int node = dev_of_offset(dev); - pdata->filename = fdt_getprop(blob, node, "sandbox,filename", NULL); - pdata->device_name = fdt_getprop(blob, node, "compatible", NULL); + pdata->filename = dev_read_string(dev, "sandbox,filename"); + pdata->device_name = dev_read_string(dev, "compatible"); if (!pdata->filename || !pdata->device_name) { debug("%s: Missing properties, filename=%s, device_name=%s\n", __func__, pdata->filename, pdata->device_name); -- 2.13.0.303.g4ebf302169-goog