From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: <broonie@kernel.org>
Cc: <lgirdwood@gmail.com>, <peter.ujfalusi@linux.intel.com>,
<yung-chuan.liao@linux.intel.com>,
<pierre-louis.bossart@linux.dev>, <linux-sound@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <patches@opensource.cirrus.com>
Subject: [PATCH 2/5] ASoC: SDCA: Clean up error messages
Date: Fri, 20 Dec 2024 17:35:13 +0000 [thread overview]
Message-ID: <20241220173516.907406-2-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20241220173516.907406-1-ckeepax@opensource.cirrus.com>
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>
---
sound/soc/sdca/sdca_functions.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/sound/soc/sdca/sdca_functions.c b/sound/soc/sdca/sdca_functions.c
index 1808e5e7dee2..46aa874bb0aa 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 <linux/acpi.h>
#include <linux/device.h>
#include <linux/module.h>
@@ -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 @@ static int patch_sdca_function_type(struct device *dev,
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;
}
--
2.39.5
next prev parent reply other threads:[~2024-12-20 17:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-20 17:35 [PATCH 1/5] ASoC: SDCA: Add missing header includes Charles Keepax
2024-12-20 17:35 ` Charles Keepax [this message]
2024-12-20 17:35 ` [PATCH 3/5] ASoC: SDCA: Add bounds check for function address Charles Keepax
2024-12-20 17:35 ` [PATCH 4/5] ASoC: SDCA: Add missing function type names Charles Keepax
2025-01-02 22:01 ` Pierre-Louis Bossart
2025-01-06 12:20 ` Charles Keepax
2024-12-20 17:35 ` [PATCH 5/5] ASoC: SDCA: Split function type patching and function naming Charles Keepax
2024-12-25 1:23 ` [PATCH 1/5] ASoC: SDCA: Add missing header includes Mark Brown
2025-01-06 12:07 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241220173516.907406-2-ckeepax@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox