From: Charles Keepax Date: Fri, 20 Dec 2024 17:35:13 +0000 (+0000) Subject: ASoC: SDCA: Clean up error messages X-Git-Tag: v6.14-rc1~111^2~7^2~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=935cd06bfad4b715195befaf527a2d4fd36361d9;p=thirdparty%2Fkernel%2Flinux.git ASoC: SDCA: Clean up error messages All the error messages in the SDCA code manually print the function in the output, update these to use dev_fmt instead. Whilst making the changes tweak a couple of the error messages to make them a little shorter. Signed-off-by: Charles Keepax Link: https://patch.msgid.link/20241220173516.907406-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/sdca/sdca_functions.c b/sound/soc/sdca/sdca_functions.c index 1808e5e7dee28..46aa874bb0aaa 100644 --- a/sound/soc/sdca/sdca_functions.c +++ b/sound/soc/sdca/sdca_functions.c @@ -6,6 +6,8 @@ * https://www.mipi.org/mipi-sdca-v1-0-download */ +#define dev_fmt(fmt) "%s: " fmt, __func__ + #include #include #include @@ -49,8 +51,8 @@ static int patch_sdca_function_type(struct device *dev, function_type_patch = SDCA_FUNCTION_TYPE_HID; break; default: - dev_warn(dev, "%s: SDCA version %#x unsupported function type %d, skipped\n", - __func__, interface_revision, *function_type); + dev_warn(dev, "SDCA version %#x invalid function type %d\n", + interface_revision, *function_type); return -EINVAL; } @@ -77,17 +79,14 @@ skip_early_draft_order: case SDCA_FUNCTION_TYPE_SPEAKER_MIC: case SDCA_FUNCTION_TYPE_RJ: case SDCA_FUNCTION_TYPE_IMP_DEF: - dev_warn(dev, "%s: found unsupported SDCA function type %d, skipped\n", - __func__, *function_type); + dev_warn(dev, "unsupported SDCA function type %d\n", *function_type); return -EINVAL; default: - dev_err(dev, "%s: found invalid SDCA function type %d, skipped\n", - __func__, *function_type); + dev_err(dev, "invalid SDCA function type %d\n", *function_type); return -EINVAL; } - dev_info(dev, "%s: found SDCA function %s (type %d)\n", - __func__, *function_name, *function_type); + dev_info(dev, "SDCA function %s (type %d)\n", *function_name, *function_type); return 0; } @@ -105,7 +104,7 @@ static int find_sdca_function(struct acpi_device *adev, void *data) int ret; if (sdca_data->num_functions >= SDCA_MAX_FUNCTION_COUNT) { - dev_err(dev, "%s: maximum number of functions exceeded\n", __func__); + dev_err(dev, "maximum number of functions exceeded\n"); return -EINVAL; } @@ -119,7 +118,7 @@ static int find_sdca_function(struct acpi_device *adev, void *data) return ret; if (!addr) { - dev_err(dev, "%s: no addr\n", __func__); + dev_err(dev, "no addr\n"); return -ENODEV; } @@ -144,8 +143,7 @@ static int find_sdca_function(struct acpi_device *adev, void *data) fwnode_handle_put(control5); if (ret < 0) { - dev_err(dev, "%s: the function type can only be determined from ACPI information\n", - __func__); + dev_err(dev, "function type only supported as DisCo constant\n"); return ret; }