summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/sandbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/spi/sandbox.c')
-rw-r--r--drivers/mtd/spi/sandbox.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c
index 0b602dc914..3c01e3b41c 100644
--- a/drivers/mtd/spi/sandbox.c
+++ b/drivers/mtd/spi/sandbox.c
@@ -122,23 +122,23 @@ static int sandbox_sf_probe(struct udevice *dev)
struct sandbox_spi_flash *sbsf = dev_get_priv(dev);
size_t len, idname_len;
const struct flash_info *data;
- struct sandbox_spi_flash_plat_data *pdata = dev_get_platdata(dev);
+ struct sandbox_spi_flash_plat_data *pdata = dev_get_plat(dev);
struct sandbox_state *state = state_get_current();
- struct dm_spi_slave_platdata *slave_plat;
+ struct dm_spi_slave_plat *slave_plat;
struct udevice *bus = dev->parent;
const char *spec = NULL;
struct udevice *emul;
int ret = 0;
int cs = -1;
- debug("%s: bus %d, looking for emul=%p: ", __func__, bus->seq, dev);
+ debug("%s: bus %d, looking for emul=%p: ", __func__, dev_seq(bus), dev);
ret = sandbox_spi_get_emul(state, bus, dev, &emul);
if (ret) {
printf("Error: Unknown chip select for device '%s'\n",
dev->name);
return ret;
}
- slave_plat = dev_get_parent_platdata(dev);
+ slave_plat = dev_get_parent_plat(dev);
cs = slave_plat->cs;
debug("found at cs %d\n", cs);
@@ -498,9 +498,9 @@ static int sandbox_sf_xfer(struct udevice *dev, unsigned int bitlen,
return pos == bytes ? 0 : -EIO;
}
-int sandbox_sf_ofdata_to_platdata(struct udevice *dev)
+int sandbox_sf_of_to_plat(struct udevice *dev)
{
- struct sandbox_spi_flash_plat_data *pdata = dev_get_platdata(dev);
+ struct sandbox_spi_flash_plat_data *pdata = dev_get_plat(dev);
pdata->filename = dev_read_string(dev, "sandbox,filename");
pdata->device_name = dev_read_string(dev, "compatible");
@@ -538,7 +538,7 @@ int sandbox_sf_bind_emul(struct sandbox_state *state, int busnum, int cs,
str = strdup(name);
if (!str)
return -ENOMEM;
- ret = device_bind_ofnode(bus, drv, str, NULL, node, &emul);
+ ret = device_bind(bus, drv, str, NULL, node, &emul);
if (ret) {
free(str);
printf("Cannot create emul device for spec '%s' (err=%d)\n",
@@ -565,7 +565,7 @@ int sandbox_spi_get_emul(struct sandbox_state *state,
struct udevice **emulp)
{
struct sandbox_spi_info *info;
- int busnum = bus->seq;
+ int busnum = dev_seq(bus);
int cs = spi_chip_select(slave);
int ret;
@@ -597,10 +597,10 @@ U_BOOT_DRIVER(sandbox_sf_emul) = {
.name = "sandbox_sf_emul",
.id = UCLASS_SPI_EMUL,
.of_match = sandbox_sf_ids,
- .ofdata_to_platdata = sandbox_sf_ofdata_to_platdata,
+ .of_to_plat = sandbox_sf_of_to_plat,
.probe = sandbox_sf_probe,
.remove = sandbox_sf_remove,
- .priv_auto_alloc_size = sizeof(struct sandbox_spi_flash),
- .platdata_auto_alloc_size = sizeof(struct sandbox_spi_flash_plat_data),
+ .priv_auto = sizeof(struct sandbox_spi_flash),
+ .plat_auto = sizeof(struct sandbox_spi_flash_plat_data),
.ops = &sandbox_sf_emul_ops,
};