Skip to content

Commit 935cd06

Browse files
charleskeepaxbroonie
authored andcommitted
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 <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20241220173516.907406-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent deb0152 commit 935cd06

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

sound/soc/sdca/sdca_functions.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* https://www.mipi.org/mipi-sdca-v1-0-download
77
*/
88

9+
#define dev_fmt(fmt) "%s: " fmt, __func__
10+
911
#include <linux/acpi.h>
1012
#include <linux/device.h>
1113
#include <linux/module.h>
@@ -49,8 +51,8 @@ static int patch_sdca_function_type(struct device *dev,
4951
function_type_patch = SDCA_FUNCTION_TYPE_HID;
5052
break;
5153
default:
52-
dev_warn(dev, "%s: SDCA version %#x unsupported function type %d, skipped\n",
53-
__func__, interface_revision, *function_type);
54+
dev_warn(dev, "SDCA version %#x invalid function type %d\n",
55+
interface_revision, *function_type);
5456
return -EINVAL;
5557
}
5658

@@ -77,17 +79,14 @@ static int patch_sdca_function_type(struct device *dev,
7779
case SDCA_FUNCTION_TYPE_SPEAKER_MIC:
7880
case SDCA_FUNCTION_TYPE_RJ:
7981
case SDCA_FUNCTION_TYPE_IMP_DEF:
80-
dev_warn(dev, "%s: found unsupported SDCA function type %d, skipped\n",
81-
__func__, *function_type);
82+
dev_warn(dev, "unsupported SDCA function type %d\n", *function_type);
8283
return -EINVAL;
8384
default:
84-
dev_err(dev, "%s: found invalid SDCA function type %d, skipped\n",
85-
__func__, *function_type);
85+
dev_err(dev, "invalid SDCA function type %d\n", *function_type);
8686
return -EINVAL;
8787
}
8888

89-
dev_info(dev, "%s: found SDCA function %s (type %d)\n",
90-
__func__, *function_name, *function_type);
89+
dev_info(dev, "SDCA function %s (type %d)\n", *function_name, *function_type);
9190

9291
return 0;
9392
}
@@ -105,7 +104,7 @@ static int find_sdca_function(struct acpi_device *adev, void *data)
105104
int ret;
106105

107106
if (sdca_data->num_functions >= SDCA_MAX_FUNCTION_COUNT) {
108-
dev_err(dev, "%s: maximum number of functions exceeded\n", __func__);
107+
dev_err(dev, "maximum number of functions exceeded\n");
109108
return -EINVAL;
110109
}
111110

@@ -119,7 +118,7 @@ static int find_sdca_function(struct acpi_device *adev, void *data)
119118
return ret;
120119

121120
if (!addr) {
122-
dev_err(dev, "%s: no addr\n", __func__);
121+
dev_err(dev, "no addr\n");
123122
return -ENODEV;
124123
}
125124

@@ -144,8 +143,7 @@ static int find_sdca_function(struct acpi_device *adev, void *data)
144143
fwnode_handle_put(control5);
145144

146145
if (ret < 0) {
147-
dev_err(dev, "%s: the function type can only be determined from ACPI information\n",
148-
__func__);
146+
dev_err(dev, "function type only supported as DisCo constant\n");
149147
return ret;
150148
}
151149

0 commit comments

Comments
 (0)