Commit d3e773613b6d159204de4894a4e0d191717ce318

Authored by Simon Glass
Committed by Bin Meng
1 parent bdeb2bccbf

dm: core: Use U-Boot logging instead of pr_debug()

The pr_debug() functions do not response to setting the log level and in
fact have their own separate log level. Use U-Boot logging instead.

Perhaps we should make these options redirect to log_debug(), etc.?

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Showing 1 changed file with 12 additions and 8 deletions Side-by-side Diff

drivers/core/lists.c
... ... @@ -6,6 +6,8 @@
6 6 * Marek Vasut <marex@denx.de>
7 7 */
8 8  
  9 +#define LOG_CATEGORY LOGC_DM
  10 +
9 11 #include <common.h>
10 12 #include <errno.h>
11 13 #include <dm/device.h>
12 14  
... ... @@ -139,13 +141,13 @@
139 141 if (devp)
140 142 *devp = NULL;
141 143 name = ofnode_get_name(node);
142   - pr_debug("bind node %s\n", name);
  144 + log_debug("bind node %s\n", name);
143 145  
144 146 compat_list = ofnode_get_property(node, "compatible", &compat_length);
145 147 if (!compat_list) {
146 148 if (compat_length == -FDT_ERR_NOTFOUND) {
147   - pr_debug("Device '%s' has no compatible string\n",
148   - name);
  149 + log_debug("Device '%s' has no compatible string\n",
  150 + name);
149 151 return 0;
150 152 }
151 153  
... ... @@ -160,8 +162,8 @@
160 162 */
161 163 for (i = 0; i < compat_length; i += strlen(compat) + 1) {
162 164 compat = compat_list + i;
163   - pr_debug(" - attempt to match compatible string '%s'\n",
164   - compat);
  165 + log_debug(" - attempt to match compatible string '%s'\n",
  166 + compat);
165 167  
166 168 for (entry = driver; entry != driver + n_ents; entry++) {
167 169 ret = driver_check_compatible(entry->of_match, &id,
168 170  
... ... @@ -178,11 +180,13 @@
178 180 return 0;
179 181 }
180 182  
181   - pr_debug(" - found match at '%s'\n", entry->name);
  183 + log_debug(" - found match at '%s': '%s' matches '%s'\n",
  184 + entry->name, entry->of_match->compatible,
  185 + id->compatible);
182 186 ret = device_bind_with_driver_data(parent, entry, name,
183 187 id->data, node, &dev);
184 188 if (ret == -ENODEV) {
185   - pr_debug("Driver '%s' refuses to bind\n", entry->name);
  189 + log_debug("Driver '%s' refuses to bind\n", entry->name);
186 190 continue;
187 191 }
188 192 if (ret) {
... ... @@ -198,7 +202,7 @@
198 202 }
199 203  
200 204 if (!found && !result && ret != -ENODEV)
201   - pr_debug("No match for node '%s'\n", name);
  205 + log_debug("No match for node '%s'\n", name);
202 206  
203 207 return result;
204 208 }