[alsa-devel] [PATCH v4 05/13] soundwire: Add helpers for ports operations

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Sat Apr 21 15:39:13 CEST 2018


> +static int sdw_enable_disable_mstr_ports(struct sdw_master_runtime *m_rt,
> +			struct sdw_port_runtime *p_rt, bool en)
> +{
> +	struct sdw_transport_params *t_params = &p_rt->transport_params;
> +	struct sdw_bus *bus = m_rt->bus;
> +	struct sdw_enable_ch enable_ch;
> +	int ret = 0;
> +
> +	enable_ch.port_num = p_rt->num;
> +	enable_ch.ch_mask = p_rt->ch_mask;
> +	enable_ch.enable = en;
> +
> +	/* Perform Master port channel(s) enable/disable */
> +	if (bus->port_ops->dpn_port_enable_ch) {
> +		ret = bus->port_ops->dpn_port_enable_ch(bus,
> +				&enable_ch, bus->params.next_bank);
> +		if (ret < 0) {
> +			dev_err(bus->dev,
> +				"Master chn_en write failed:%d port:%d",
> +				ret, t_params->port_num);
> +			return ret;
> +		}
> +	} else {
> +		dev_err(bus->dev,
> +			"dpn_port_enable_ch not supported, trying %s\n",
> +			en ? "enable" : "disable");

the error message is a bit confusing, you are not trying anything here.
Should it be
"dpn_port_enable_ch not supported, %s failed\n", en ? "enable" : "disable"



More information about the Alsa-devel mailing list