int most_set_cfg_direction()

in core.c [635:654]


int most_set_cfg_direction(char *mdev, char *mdev_ch, char *buf)
{
	struct most_channel *c = get_channel(mdev, mdev_ch);

	if (!c)
		return -ENODEV;
	if (!strcmp(buf, "dir_rx")) {
		c->cfg.direction = MOST_CH_RX;
	} else if (!strcmp(buf, "rx")) {
		c->cfg.direction = MOST_CH_RX;
	} else if (!strcmp(buf, "dir_tx")) {
		c->cfg.direction = MOST_CH_TX;
	} else if (!strcmp(buf, "tx")) {
		c->cfg.direction = MOST_CH_TX;
	} else {
		dev_err(&c->dev, "Invalid direction\n");
		return -ENODATA;
	}
	return 0;
}