disp: msm: dsi: adding prefix for logs
Adding debug, info and error prefix for log messages in dsi files. To enable debug logs run "echo 0x1 > /sys/module/drm/parameters/debug" Change-Id: I438ac16954bd1d39450f8adeb7fb17f9ea6f8140 Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) "[dsi-parser] %s: " fmt, __func__
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
@@ -14,6 +12,7 @@
|
||||
#include <linux/device.h>
|
||||
|
||||
#include "dsi_parser.h"
|
||||
#include "dsi_defs.h"
|
||||
|
||||
#define DSI_PARSER_MAX_NODES 20
|
||||
|
||||
@@ -106,7 +105,7 @@ static bool dsi_parser_get_tuples_data(
|
||||
bool middle_of_tx = false;
|
||||
|
||||
if (!str) {
|
||||
pr_err("Invalid input\n");
|
||||
DSI_ERR("Invalid input\n");
|
||||
return middle_of_tx;
|
||||
}
|
||||
|
||||
@@ -131,7 +130,7 @@ static bool dsi_parser_get_strings(struct device *dev,
|
||||
int count = 0;
|
||||
|
||||
if (!str) {
|
||||
pr_err("Invalid input\n");
|
||||
DSI_ERR("Invalid input\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -139,7 +138,7 @@ static bool dsi_parser_get_strings(struct device *dev,
|
||||
goto end;
|
||||
|
||||
count = dsi_parser_count(str, ',');
|
||||
pr_debug("count=%d\n", count);
|
||||
DSI_DEBUG("count=%d\n", count);
|
||||
|
||||
if (!count) {
|
||||
prop->value = dsi_parser_get_data("\"", "\"", str);
|
||||
@@ -179,7 +178,7 @@ static bool dsi_parser_get_tuples(struct device *dev,
|
||||
char *data = NULL;
|
||||
|
||||
if (!str) {
|
||||
pr_err("Invalid input\n");
|
||||
DSI_ERR("Invalid input\n");
|
||||
return middle_of_tx;
|
||||
}
|
||||
|
||||
@@ -225,7 +224,7 @@ static void dsi_parser_get_int_value(struct dsi_parser_prop *prop,
|
||||
}
|
||||
|
||||
if (kstrtoint(tmp, base, &val)) {
|
||||
pr_err("error converting %s at %d\n",
|
||||
DSI_ERR("error converting %s at %d\n",
|
||||
tmp, i);
|
||||
|
||||
continue;
|
||||
@@ -253,7 +252,7 @@ static bool dsi_parser_parse_prop(struct device *dev,
|
||||
found = true;
|
||||
|
||||
prop->name = dsi_parser_strim(out);
|
||||
pr_debug("RAW: %s: %s\n", prop->name, prop->raw);
|
||||
DSI_DEBUG("RAW: %s: %s\n", prop->name, prop->raw);
|
||||
|
||||
prop->len = 0;
|
||||
|
||||
@@ -323,7 +322,7 @@ static char *dsi_parser_clean_name(char *name)
|
||||
char *clean_name = name;
|
||||
|
||||
if (!name) {
|
||||
pr_err("Invalid input\n");
|
||||
DSI_ERR("Invalid input\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -375,7 +374,7 @@ static struct dsi_parser_node *dsi_parser_find_nodes(struct device *dev,
|
||||
|
||||
data = strpbrk(*buf, "{}");
|
||||
if (!data) {
|
||||
pr_debug("{} not found\n");
|
||||
DSI_DEBUG("{} not found\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -493,7 +492,7 @@ struct property *dsi_parser_find_property(const struct device_node *np,
|
||||
|
||||
prop = dsi_parser_search_property(node, name);
|
||||
if (!prop) {
|
||||
pr_debug("%s not found\n", name);
|
||||
DSI_DEBUG("%s not found\n", name);
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -506,7 +505,7 @@ struct property *dsi_parser_find_property(const struct device_node *np,
|
||||
else
|
||||
*lenp = strlen(prop->raw) + 1;
|
||||
|
||||
pr_debug("%s len=%d\n", name, *lenp);
|
||||
DSI_DEBUG("%s len=%d\n", name, *lenp);
|
||||
}
|
||||
end:
|
||||
return (struct property *)prop;
|
||||
@@ -520,7 +519,7 @@ bool dsi_parser_read_bool(const struct device_node *np,
|
||||
|
||||
prop_set = dsi_parser_search_property(node, propname) ? true : false;
|
||||
|
||||
pr_debug("%s=%s\n", propname, prop_set ? "set" : "not set");
|
||||
DSI_DEBUG("%s=%s\n", propname, prop_set ? "set" : "not set");
|
||||
|
||||
return prop_set;
|
||||
}
|
||||
@@ -535,7 +534,7 @@ int dsi_parser_read_string(const struct device_node *np,
|
||||
|
||||
prop = dsi_parser_search_property(node, propname);
|
||||
if (!prop) {
|
||||
pr_debug("%s not found\n", propname);
|
||||
DSI_DEBUG("%s not found\n", propname);
|
||||
rc = -EINVAL;
|
||||
} else {
|
||||
property = prop->value;
|
||||
@@ -543,7 +542,7 @@ int dsi_parser_read_string(const struct device_node *np,
|
||||
|
||||
*out_string = property;
|
||||
|
||||
pr_debug("%s=%s\n", propname, *out_string);
|
||||
DSI_DEBUG("%s=%s\n", propname, *out_string);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -563,7 +562,7 @@ int dsi_parser_read_u32(const struct device_node *np,
|
||||
|
||||
prop = dsi_parser_search_property(node, propname);
|
||||
if (!prop) {
|
||||
pr_debug("%s not found\n", propname);
|
||||
DSI_DEBUG("%s not found\n", propname);
|
||||
rc = -EINVAL;
|
||||
goto end;
|
||||
}
|
||||
@@ -584,12 +583,12 @@ int dsi_parser_read_u32(const struct device_node *np,
|
||||
|
||||
rc = kstrtoint(property, base, out_value);
|
||||
if (rc) {
|
||||
pr_err("prop=%s error(%d) converting %s, base=%d\n",
|
||||
DSI_ERR("prop=%s error(%d) converting %s, base=%d\n",
|
||||
propname, rc, property, base);
|
||||
goto end;
|
||||
}
|
||||
|
||||
pr_debug("%s=%d\n", propname, *out_value);
|
||||
DSI_DEBUG("%s=%d\n", propname, *out_value);
|
||||
end:
|
||||
return rc;
|
||||
}
|
||||
@@ -604,7 +603,7 @@ int dsi_parser_read_u32_array(const struct device_node *np,
|
||||
|
||||
prop = dsi_parser_search_property(node, propname);
|
||||
if (!prop) {
|
||||
pr_debug("%s not found\n", propname);
|
||||
DSI_DEBUG("%s not found\n", propname);
|
||||
rc = -EINVAL;
|
||||
goto end;
|
||||
}
|
||||
@@ -629,14 +628,14 @@ int dsi_parser_read_u32_array(const struct device_node *np,
|
||||
|
||||
rc = kstrtoint(tmp, base, &val);
|
||||
if (rc) {
|
||||
pr_err("prop=%s error(%d) converting %s(%d), base=%d\n",
|
||||
DSI_ERR("prop=%s error(%d) converting %s(%d), base=%d\n",
|
||||
propname, rc, tmp, i, base);
|
||||
continue;
|
||||
}
|
||||
|
||||
*out_values++ = val;
|
||||
|
||||
pr_debug("%s: [%d]=%d\n", propname, i, *(out_values - 1));
|
||||
DSI_DEBUG("%s: [%d]=%d\n", propname, i, *(out_values - 1));
|
||||
}
|
||||
end:
|
||||
return rc;
|
||||
@@ -651,14 +650,14 @@ const void *dsi_parser_get_property(const struct device_node *np,
|
||||
|
||||
prop = dsi_parser_search_property(node, name);
|
||||
if (!prop) {
|
||||
pr_debug("%s not found\n", name);
|
||||
DSI_DEBUG("%s not found\n", name);
|
||||
goto end;
|
||||
}
|
||||
|
||||
property = prop->value;
|
||||
|
||||
if (prop->type == DSI_PROP_TYPE_STR)
|
||||
pr_debug("%s=%s\n", name, property);
|
||||
DSI_DEBUG("%s=%s\n", name, property);
|
||||
|
||||
if (lenp) {
|
||||
if (prop->type == DSI_PROP_TYPE_INT_ARRAY)
|
||||
@@ -669,7 +668,7 @@ const void *dsi_parser_get_property(const struct device_node *np,
|
||||
else
|
||||
*lenp = strlen(prop->raw) + 1;
|
||||
|
||||
pr_debug("%s len=%d\n", name, *lenp);
|
||||
DSI_DEBUG("%s len=%d\n", name, *lenp);
|
||||
}
|
||||
end:
|
||||
return property;
|
||||
@@ -697,7 +696,7 @@ struct device_node *dsi_parser_get_child_by_name(const struct device_node *np,
|
||||
}
|
||||
} while (index < node->children_count);
|
||||
end:
|
||||
pr_debug("%s: %s\n", name, matched_node ? "found" : "not found");
|
||||
DSI_DEBUG("%s: %s\n", name, matched_node ? "found" : "not found");
|
||||
|
||||
return (struct device_node *)matched_node;
|
||||
}
|
||||
@@ -710,7 +709,7 @@ struct dsi_parser_node *dsi_parser_get_node_by_name(
|
||||
struct dsi_parser_node *matched_node = NULL;
|
||||
|
||||
if (!node) {
|
||||
pr_err("node is null\n");
|
||||
DSI_ERR("node is null\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -726,7 +725,7 @@ struct dsi_parser_node *dsi_parser_get_node_by_name(
|
||||
break;
|
||||
}
|
||||
end:
|
||||
pr_debug("%s: %s\n", name, matched_node ? "found" : "not found");
|
||||
DSI_DEBUG("%s: %s\n", name, matched_node ? "found" : "not found");
|
||||
|
||||
return matched_node;
|
||||
}
|
||||
@@ -738,7 +737,7 @@ int dsi_parser_get_child_count(const struct device_node *np)
|
||||
|
||||
if (node) {
|
||||
count = node->children_count;
|
||||
pr_debug("node %s child count=%d\n", node->name, count);
|
||||
DSI_DEBUG("node %s child count=%d\n", node->name, count);
|
||||
}
|
||||
|
||||
return count;
|
||||
@@ -774,7 +773,7 @@ struct device_node *dsi_parser_get_next_child(const struct device_node *np,
|
||||
} while (index < parent->children_count);
|
||||
end:
|
||||
if (matched_node)
|
||||
pr_debug("next child: %s\n", matched_node->name);
|
||||
DSI_DEBUG("next child: %s\n", matched_node->name);
|
||||
|
||||
return (struct device_node *)matched_node;
|
||||
}
|
||||
@@ -788,13 +787,13 @@ int dsi_parser_count_u32_elems(const struct device_node *np,
|
||||
|
||||
prop = dsi_parser_search_property(node, propname);
|
||||
if (!prop) {
|
||||
pr_debug("%s not found\n", propname);
|
||||
DSI_DEBUG("%s not found\n", propname);
|
||||
goto end;
|
||||
}
|
||||
|
||||
count = prop->len;
|
||||
|
||||
pr_debug("prop %s has %d items\n", prop->name, count);
|
||||
DSI_DEBUG("prop %s has %d items\n", prop->name, count);
|
||||
end:
|
||||
return count;
|
||||
}
|
||||
@@ -808,7 +807,7 @@ int dsi_parser_count_strings(const struct device_node *np,
|
||||
|
||||
prop = dsi_parser_search_property(node, propname);
|
||||
if (!prop) {
|
||||
pr_debug("%s not found\n", propname);
|
||||
DSI_DEBUG("%s not found\n", propname);
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -817,7 +816,7 @@ int dsi_parser_count_strings(const struct device_node *np,
|
||||
else if (prop->type == DSI_PROP_TYPE_STR)
|
||||
count = 1;
|
||||
|
||||
pr_debug("prop %s has %d items\n", prop->name, count);
|
||||
DSI_DEBUG("prop %s has %d items\n", prop->name, count);
|
||||
end:
|
||||
return count;
|
||||
}
|
||||
@@ -831,17 +830,17 @@ int dsi_parser_read_string_index(const struct device_node *np,
|
||||
|
||||
prop = dsi_parser_search_property(node, propname);
|
||||
if (!prop) {
|
||||
pr_debug("%s not found\n", propname);
|
||||
DSI_DEBUG("%s not found\n", propname);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (prop->type != DSI_PROP_TYPE_STR_ARRAY) {
|
||||
pr_err("not a string array property\n");
|
||||
DSI_ERR("not a string array property\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (index >= prop->len) {
|
||||
pr_err("out of bond index %d\n", index);
|
||||
DSI_ERR("out of bond index %d\n", index);
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -869,7 +868,7 @@ void *dsi_parser_get_head_node(void *in,
|
||||
char *buf;
|
||||
|
||||
if (!parser || !data || !size) {
|
||||
pr_err("invalid input\n");
|
||||
DSI_ERR("invalid input\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -886,7 +885,7 @@ void *dsi_parser_get_head_node(void *in,
|
||||
|
||||
parser->head_node = dsi_parser_find_nodes(parser->dev, &buf);
|
||||
if (!parser->head_node) {
|
||||
pr_err("could not get head node\n");
|
||||
DSI_ERR("could not get head node\n");
|
||||
devm_kfree(parser->dev, parser->buf);
|
||||
goto err;
|
||||
}
|
||||
@@ -910,14 +909,14 @@ static int dsi_parser_read_file(struct dsi_parser *parser,
|
||||
|
||||
rc = request_firmware(&parser->fw, parser->file_name, parser->dev);
|
||||
if (rc || !parser->fw) {
|
||||
pr_err("couldn't read firmware\n");
|
||||
DSI_ERR("couldn't read firmware\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
*buf = parser->fw->data;
|
||||
*size = parser->fw->size;
|
||||
|
||||
pr_debug("file %s: size %zd\n",
|
||||
DSI_DEBUG("file %s: size %zd\n",
|
||||
parser->file_name, parser->fw->size);
|
||||
end:
|
||||
return rc;
|
||||
@@ -931,7 +930,7 @@ static void dsi_parser_free_mem(struct device *dev,
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
pr_debug("node=%s, prop_count=%d\n", node->name, node->prop_count);
|
||||
DSI_DEBUG("node=%s, prop_count=%d\n", node->name, node->prop_count);
|
||||
|
||||
for (i = 0; i < node->prop_count; i++) {
|
||||
struct dsi_parser_prop *prop = &node->prop[i];
|
||||
@@ -939,7 +938,7 @@ static void dsi_parser_free_mem(struct device *dev,
|
||||
if (!prop)
|
||||
continue;
|
||||
|
||||
pr_debug("deleting prop=%s\n", prop->name);
|
||||
DSI_DEBUG("deleting prop=%s\n", prop->name);
|
||||
|
||||
if (prop->items)
|
||||
devm_kfree(dev, prop->items);
|
||||
@@ -985,12 +984,12 @@ static ssize_t dsi_parser_write_init(struct file *file,
|
||||
buf[len] = '\0';
|
||||
|
||||
if (sscanf(buf, "%31s", parser->file_name) != 1) {
|
||||
pr_err("failed to get val\n");
|
||||
DSI_ERR("failed to get val\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (dsi_parser_read_file(parser, &data, &size)) {
|
||||
pr_err("failed to read file\n");
|
||||
DSI_ERR("failed to read file\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -1003,7 +1002,7 @@ static ssize_t dsi_parser_write_init(struct file *file,
|
||||
|
||||
parser->head_node = dsi_parser_get_head_node(parser, data, size);
|
||||
if (!parser->head_node) {
|
||||
pr_err("failed to parse data\n");
|
||||
DSI_ERR("failed to parse data\n");
|
||||
goto end;
|
||||
}
|
||||
end:
|
||||
@@ -1169,7 +1168,7 @@ int dsi_parser_dbg_init(void *parser, struct dentry *parent_dir)
|
||||
struct dentry *dir, *file;
|
||||
|
||||
if (!parser || !parent_dir) {
|
||||
pr_err("invalid input\n");
|
||||
DSI_ERR("invalid input\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -1177,7 +1176,7 @@ int dsi_parser_dbg_init(void *parser, struct dentry *parent_dir)
|
||||
if (IS_ERR_OR_NULL(dir)) {
|
||||
rc = PTR_ERR(dir);
|
||||
|
||||
pr_err("failed to create parser debugfs\n");
|
||||
DSI_ERR("failed to create parser debugfs\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -1186,7 +1185,7 @@ int dsi_parser_dbg_init(void *parser, struct dentry *parent_dir)
|
||||
if (IS_ERR_OR_NULL(file)) {
|
||||
rc = PTR_ERR(file);
|
||||
|
||||
pr_err("failed to create init debugfs\n");
|
||||
DSI_ERR("failed to create init debugfs\n");
|
||||
goto dbg;
|
||||
}
|
||||
|
||||
@@ -1195,11 +1194,11 @@ int dsi_parser_dbg_init(void *parser, struct dentry *parent_dir)
|
||||
if (IS_ERR_OR_NULL(file)) {
|
||||
rc = PTR_ERR(file);
|
||||
|
||||
pr_err("failed to create init debugfs\n");
|
||||
DSI_ERR("failed to create init debugfs\n");
|
||||
goto dbg;
|
||||
}
|
||||
|
||||
pr_debug("success\n");
|
||||
DSI_DEBUG("success\n");
|
||||
return 0;
|
||||
dbg:
|
||||
debugfs_remove_recursive(dir);
|
||||
@@ -1213,7 +1212,7 @@ void *dsi_parser_get(struct device *dev)
|
||||
struct dsi_parser *parser = NULL;
|
||||
|
||||
if (!dev) {
|
||||
pr_err("invalid data\n");
|
||||
DSI_ERR("invalid data\n");
|
||||
rc = -EINVAL;
|
||||
goto end;
|
||||
}
|
||||
|
مرجع در شماره جدید
Block a user