diff options
Diffstat (limited to 'configfs.c')
-rw-r--r-- | configfs.c | 24 |
1 files changed, 15 insertions, 9 deletions
@@ -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; } |