/* At present only a single emulator is supported on the bus, since we do not support chip selects, despite there being a chipsel field. It cannot be implemented until we have a GPIO emulator. */
static struct spi_emul* spi_emul_find(const struct device *dev, unsigned int chipsel)
/* At present only a single emulator is supported on the bus, since we do not support chip selects, despite there being a chipsel field. It cannot be implemented until we have a GPIO emulator. */
static struct spi_emul* spi_emul_find(const struct device *dev, unsigned int chipsel)
{
	struct spi_emul_data *data = dev->data;
	sys_snode_t *node;
	SYS_SLIST_FOR_EACH_NODE(&data->emuls, node) {
		struct spi_emul *emul;
		emul = CONTAINER_OF(node, struct spi_emul, node);
		if (emul->chipsel == chipsel) {
			return emul;
		}
	}
	return NULL;
}