Unverified Commit f892e66f authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown
Browse files

ASoC: rt-sdw*: add __func__ to all error logs



The drivers for Realtek SoundWire codecs use similar logs, which is
problematic to analyze problems reported by CI tools, e.g. "Failed to
get private value: 752001 => 0000 ret=-5". It's not uncommon to have
several Realtek devices on the same platform, having the same log
thrown makes support difficult.

This patch adds __func__ to all error logs which didn't already
include it.

No functionality change, only error logs are modified.

Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Link: https://msgid.link/r/20240325221817.206465-7-pierre-louis.bossart@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent adb354bb
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -537,7 +537,7 @@ static int rt1316_sdw_hw_params(struct snd_pcm_substream *substream,
	retval = sdw_stream_add_slave(rt1316->sdw_slave, &stream_config,
				&port_config, 1, sdw_stream);
	if (retval) {
		dev_err(dai->dev, "Unable to configure port\n");
		dev_err(dai->dev, "%s: Unable to configure port\n", __func__);
		return retval;
	}

@@ -577,12 +577,12 @@ static int rt1316_sdw_parse_dt(struct rt1316_sdw_priv *rt1316, struct device *de
	if (rt1316->bq_params_cnt) {
		rt1316->bq_params = devm_kzalloc(dev, rt1316->bq_params_cnt, GFP_KERNEL);
		if (!rt1316->bq_params) {
			dev_err(dev, "Could not allocate bq_params memory\n");
			dev_err(dev, "%s: Could not allocate bq_params memory\n", __func__);
			ret = -ENOMEM;
		} else {
			ret = device_property_read_u8_array(dev, "realtek,bq-params", rt1316->bq_params, rt1316->bq_params_cnt);
			if (ret < 0)
				dev_err(dev, "Could not read list of realtek,bq-params\n");
				dev_err(dev, "%s: Could not read list of realtek,bq-params\n", __func__);
		}
	}

@@ -759,7 +759,7 @@ static int __maybe_unused rt1316_dev_resume(struct device *dev)
	time = wait_for_completion_timeout(&slave->initialization_complete,
				msecs_to_jiffies(RT1316_PROBE_TIMEOUT));
	if (!time) {
		dev_err(&slave->dev, "Initialization not complete, timed out\n");
		dev_err(&slave->dev, "%s: Initialization not complete, timed out\n", __func__);
		sdw_show_ping_status(slave->bus, true);

		return -ETIMEDOUT;
+4 −4
Original line number Diff line number Diff line
@@ -606,7 +606,7 @@ static int rt1318_sdw_hw_params(struct snd_pcm_substream *substream,
	retval = sdw_stream_add_slave(rt1318->sdw_slave, &stream_config,
				&port_config, 1, sdw_stream);
	if (retval) {
		dev_err(dai->dev, "Unable to configure port\n");
		dev_err(dai->dev, "%s: Unable to configure port\n", __func__);
		return retval;
	}

@@ -631,8 +631,8 @@ static int rt1318_sdw_hw_params(struct snd_pcm_substream *substream,
		sampling_rate = RT1318_SDCA_RATE_192000HZ;
		break;
	default:
		dev_err(component->dev, "Rate %d is not supported\n",
			params_rate(params));
		dev_err(component->dev, "%s: Rate %d is not supported\n",
			__func__, params_rate(params));
		return -EINVAL;
	}

@@ -835,7 +835,7 @@ static int __maybe_unused rt1318_dev_resume(struct device *dev)
	time = wait_for_completion_timeout(&slave->initialization_complete,
				msecs_to_jiffies(RT1318_PROBE_TIMEOUT));
	if (!time) {
		dev_err(&slave->dev, "Initialization not complete, timed out\n");
		dev_err(&slave->dev, "%s: Initialization not complete, timed out\n", __func__);
		return -ETIMEDOUT;
	}

+6 −6
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ static int rt5682_sdw_hw_params(struct snd_pcm_substream *substream,
	retval = sdw_stream_add_slave(rt5682->slave, &stream_config,
				      &port_config, 1, sdw_stream);
	if (retval) {
		dev_err(dai->dev, "Unable to configure port\n");
		dev_err(dai->dev, "%s: Unable to configure port\n", __func__);
		return retval;
	}

@@ -315,8 +315,8 @@ static int rt5682_sdw_init(struct device *dev, struct regmap *regmap,
					  &rt5682_sdw_indirect_regmap);
	if (IS_ERR(rt5682->regmap)) {
		ret = PTR_ERR(rt5682->regmap);
		dev_err(dev, "Failed to allocate register map: %d\n",
			ret);
		dev_err(dev, "%s: Failed to allocate register map: %d\n",
			__func__, ret);
		return ret;
	}

@@ -400,7 +400,7 @@ static int rt5682_io_init(struct device *dev, struct sdw_slave *slave)
	}

	if (val != DEVICE_ID) {
		dev_err(dev, "Device with ID register %x is not rt5682\n", val);
		dev_err(dev, "%s: Device with ID register %x is not rt5682\n", __func__, val);
		ret = -ENODEV;
		goto err_nodev;
	}
@@ -648,7 +648,7 @@ static int rt5682_bus_config(struct sdw_slave *slave,

	ret = rt5682_clock_config(&slave->dev);
	if (ret < 0)
		dev_err(&slave->dev, "Invalid clk config");
		dev_err(&slave->dev, "%s: Invalid clk config", __func__);

	return ret;
}
@@ -775,7 +775,7 @@ static int __maybe_unused rt5682_dev_resume(struct device *dev)
	time = wait_for_completion_timeout(&slave->initialization_complete,
				msecs_to_jiffies(RT5682_PROBE_TIMEOUT));
	if (!time) {
		dev_err(&slave->dev, "Initialization not complete, timed out\n");
		dev_err(&slave->dev, "%s: Initialization not complete, timed out\n", __func__);
		sdw_show_ping_status(slave->bus, true);

		return -ETIMEDOUT;
+8 −8
Original line number Diff line number Diff line
@@ -37,8 +37,8 @@ static int rt700_index_write(struct regmap *regmap,

	ret = regmap_write(regmap, addr, value);
	if (ret < 0)
		pr_err("Failed to set private value: %06x <= %04x ret=%d\n",
			addr, value, ret);
		pr_err("%s: Failed to set private value: %06x <= %04x ret=%d\n",
		       __func__, addr, value, ret);

	return ret;
}
@@ -52,8 +52,8 @@ static int rt700_index_read(struct regmap *regmap,
	*value = 0;
	ret = regmap_read(regmap, addr, value);
	if (ret < 0)
		pr_err("Failed to get private value: %06x => %04x ret=%d\n",
			addr, *value, ret);
		pr_err("%s: Failed to get private value: %06x => %04x ret=%d\n",
		       __func__, addr, *value, ret);

	return ret;
}
@@ -930,14 +930,14 @@ static int rt700_pcm_hw_params(struct snd_pcm_substream *substream,
		port_config.num += 2;
		break;
	default:
		dev_err(component->dev, "Invalid DAI id %d\n", dai->id);
		dev_err(component->dev, "%s: Invalid DAI id %d\n", __func__, dai->id);
		return -EINVAL;
	}

	retval = sdw_stream_add_slave(rt700->slave, &stream_config,
					&port_config, 1, sdw_stream);
	if (retval) {
		dev_err(dai->dev, "Unable to configure port\n");
		dev_err(dai->dev, "%s: Unable to configure port\n", __func__);
		return retval;
	}

@@ -945,8 +945,8 @@ static int rt700_pcm_hw_params(struct snd_pcm_substream *substream,
		/* bit 3:0 Number of Channel */
		val |= (params_channels(params) - 1);
	} else {
		dev_err(component->dev, "Unsupported channels %d\n",
			params_channels(params));
		dev_err(component->dev, "%s: Unsupported channels %d\n",
			__func__, params_channels(params));
		return -EINVAL;
	}

+1 −1
Original line number Diff line number Diff line
@@ -451,7 +451,7 @@ static int __maybe_unused rt711_sdca_dev_resume(struct device *dev)
	time = wait_for_completion_timeout(&slave->initialization_complete,
				msecs_to_jiffies(RT711_PROBE_TIMEOUT));
	if (!time) {
		dev_err(&slave->dev, "Initialization not complete, timed out\n");
		dev_err(&slave->dev, "%s: Initialization not complete, timed out\n", __func__);
		sdw_show_ping_status(slave->bus, true);

		return -ETIMEDOUT;
Loading