summaryrefslogtreecommitdiffstats
path: root/configfs.c
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-08 11:42:14 +1100
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-26 17:27:39 +1100
commit470fdcb5f773ab45f715a665af6cb35a79ef38ce (patch)
treeec86f3f7f11c71b30ad7828e2d769a3ae3504ca5 /configfs.c
parent931ac3b329c106c9058250b994e6a150c977b606 (diff)
Refactor to use new DINFO macros
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'configfs.c')
-rw-r--r--configfs.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/configfs.c b/configfs.c
index 7e820c6..6a82b0b 100644
--- a/configfs.c
+++ b/configfs.c
@@ -10,6 +10,12 @@
#include <sound/core.h>
#include "core_internal.h"
+#define D_LOGNAME "configfs"
+
+#define D_INFOK(fmt, args...) DINFO(D_LOGNAME, fmt, ##args)
+#define D_PRINTK(fmt, args...) DDEBUG(D_LOGNAME, fmt, ##args)
+#define D_ERRORK(fmt, args...) DERROR(D_LOGNAME, fmt, ##args)
+
static ssize_t cfg_avirt_stream_direction_show(struct config_item *item,
char *page)
{
@@ -70,7 +76,7 @@ static ssize_t cfg_avirt_stream_channels_store(struct config_item *item,
stream->channels = tmp;
- pr_info("%s [ARGS] channels: %d\n", __func__, stream->channels);
+ D_INFOK("channels: %d", stream->channels);
return count;
}
@@ -85,7 +91,7 @@ static struct configfs_attribute *cfg_avirt_stream_attrs[] = {
static void cfg_avirt_stream_release(struct config_item *item)
{
- pr_info("%s [ARGS] item->name:%s\n", __func__, item->ci_namebuf);
+ D_INFOK("item->name:%s", item->ci_namebuf);
kfree(avirt_stream_from_config_item(item));
}
@@ -109,8 +115,8 @@ cfg_avirt_stream_make_item(struct config_group *group, const char *name)
// Get prefix (playback_ or capture_)
split = strsep((char **)&name, "_");
if (!split) {
- pr_err("Stream name: '%s' invalid!\n", split);
- pr_err("Must begin with playback_ * or capture_ *\n");
+ D_ERRORK("Stream name: '%s' invalid!", split);
+ D_ERRORK("Must begin with playback_ * or capture_ *");
return ERR_PTR(-EINVAL);
}
if (!strcmp(split, "playback")) {
@@ -118,8 +124,8 @@ cfg_avirt_stream_make_item(struct config_group *group, const char *name)
} else if (!strcmp(split, "capture")) {
direction = SNDRV_PCM_STREAM_CAPTURE;
} else {
- pr_err("Stream name: '%s' invalid!\n", split);
- pr_err("Must begin with playback_ * or capture_ *\n");
+ D_ERRORK("Stream name: '%s' invalid!", split);
+ D_ERRORK("Must begin with playback_ * or capture_ ");
return ERR_PTR(-EINVAL);
}
@@ -155,7 +161,7 @@ static ssize_t cfg_avirt_stream_group_sealed_store(struct config_item *item,
CHK_ERR(kstrtoul(p, 10, &tmp));
if (tmp != 1) {
- pr_err("AVIRT streams can only be sealed, not unsealed!\n");
+ D_ERRORK("streams can only be sealed, not unsealed!");
return -ERANGE;
}
@@ -203,14 +209,14 @@ int __init __avirt_configfs_init(struct avirt_core *core)
mutex_init(&cfg_subsys.su_mutex);
err = configfs_register_subsystem(&cfg_subsys);
if (err) {
- pr_err("Cannot register configfs subsys!\n");
+ D_ERRORK("Cannot register configfs subsys!");
return err;
}
core->stream_group = configfs_register_default_group(
&cfg_subsys.su_group, "streams", &cfg_stream_group_type);
if (IS_ERR(core->stream_group)) {
err = PTR_ERR(core->stream_group);
- pr_err("Cannot register configfs default group 'streams'!\n");
+ D_ERRORK("Cannot register configfs default group 'streams'!");
goto exit_configfs;
}