SANDBOX_CMDLINE_OPT(spi_sf, 1, "connect a SPI flash: <bus>:<cs>:<id>:<file>");
int sandbox_sf_bind_emul(struct sandbox_state *state, int busnum, int cs,
- struct udevice *bus, int of_offset, const char *spec)
+ struct udevice *bus, ofnode node, const char *spec)
{
struct udevice *emul;
char name[20], *str;
str = strdup(name);
if (!str)
return -ENOMEM;
- ret = device_bind(bus, drv, str, NULL, of_offset, &emul);
+ ret = device_bind_ofnode(bus, drv, str, NULL, node, &emul);
if (ret) {
free(str);
printf("Cannot create emul device for spec '%s' (err=%d)\n",
if (ret)
return ret;
- return sandbox_sf_bind_emul(state, busnum, cs, bus, -1, spec);
+ return sandbox_sf_bind_emul(state, busnum, cs, bus, ofnode_null(),
+ spec);
}
int sandbox_spi_get_emul(struct sandbox_state *state,
debug("%s: busnum=%u, cs=%u: binding SPI flash emulation: ",
__func__, busnum, cs);
ret = sandbox_sf_bind_emul(state, busnum, cs, bus,
- dev_of_offset(slave), slave->name);
+ dev_ofnode(slave), slave->name);
if (ret) {
debug("failed (err=%d)\n", ret);
return ret;