aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/spi
diff options
context:
space:
mode:
authorSimon Glass2017-05-18 20:09:58 -0600
committerSimon Glass2017-06-01 07:03:16 -0600
commita11817999f0416ca024c3b36ef93cdb13d63d7e4 (patch)
tree9db106c526cf46fae0888392c55b7f4ce71b593b /drivers/mtd/spi
parent656f29d1ca02aa3a784c9498529376aca401e0fa (diff)
dm: sandbox: spi: Convert driver to support livetree
Update this driver to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/mtd/spi')
-rw-r--r--drivers/mtd/spi/sandbox.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c
index a53f4ebc68d..1ba68152322 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);