Re: [PATCH v2 03/14] staging: most: core: add configfs interface functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 28, 2019 at 02:17:31PM +0100, Christian Gromm wrote:
> +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\n")) {
> +		c->cfg.direction = MOST_CH_RX;
> +	} else if (!strcmp(buf, "rx\n")) {
> +		c->cfg.direction = MOST_CH_RX;
> +	} else if (!strcmp(buf, "dir_tx\n")) {
> +		c->cfg.direction = MOST_CH_TX;
> +	} else if (!strcmp(buf, "tx\n")) {
> +		c->cfg.direction = MOST_CH_TX;
> +	} else {
> +		pr_info("Invalid direction\n");
> +		return -ENODATA;
> +	}

Please use sysfs_streq().

> +	return 0;
> +}

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux