Skip to content

Commit ea1a839

Browse files
akanisetticfriedt
authored andcommitted
soc: intel: common: Replace printk with LOG_ERR
Replace printk with LOG_ERR by adding a log module. Signed-off-by: Anisetti Avinash Krishna <[email protected]>
1 parent 709f453 commit ea1a839

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

soc/intel/common/soc_gpio.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#include <zephyr/acpi/acpi.h>
99
#include "soc.h"
1010
#include "soc_gpio.h"
11+
#include <zephyr/logging/log.h>
12+
13+
LOG_MODULE_REGISTER(soc_gpio, CONFIG_SOC_LOG_LEVEL);
1114

1215
#define GET_GPIO_BASE_NUM ("\\_SB.GINF")
1316

@@ -72,23 +75,23 @@ int soc_acpi_gpio_resource_get(int bank_idx, char *hid, char *uid, struct gpio_a
7275

7376
acpi_child = acpi_device_get(hid, uid);
7477
if (!acpi_child) {
75-
printk("acpi_device_get failed\n");
78+
LOG_ERR("acpi_device_get failed");
7679
return -EIO;
7780
}
7881

7982
mmio_res.mmio_max = ARRAY_SIZE(reg_base);
8083
mmio_res.reg_base = reg_base;
8184
ret = acpi_device_mmio_get(acpi_child, &mmio_res);
8285
if (ret) {
83-
printk("acpi_device_mmio_get failed\n");
86+
LOG_ERR("acpi_device_mmio_get failed");
8487
return ret;
8588
}
8689

8790
irq_res.irq_vector_max = ARRAY_SIZE(irqs);
8891
irq_res.irqs = irqs;
8992
ret = acpi_device_irq_get(acpi_child, &irq_res);
9093
if (ret) {
91-
printk("acpi_device_irq_get failed\n");
94+
LOG_ERR("acpi_device_irq_get failed");
9295
return ret;
9396
}
9497

@@ -105,7 +108,7 @@ int soc_acpi_gpio_resource_get(int bank_idx, char *hid, char *uid, struct gpio_a
105108
for (int i = 0; i < num_fields; i++) {
106109
ret = gpio_info_acpi_get(uid_int, bank_idx, i, &field_val[i], ginf);
107110
if (ret) {
108-
printk("gpio_info_acpi_get failed\n");
111+
LOG_ERR("gpio_info_acpi_get failed");
109112
return ret;
110113
}
111114
}
@@ -139,7 +142,7 @@ int soc_acpi_gpio_resource_get(int bank_idx, char *hid, char *uid, struct gpio_a
139142
res->base_num = field_val[6];
140143
}
141144
} else {
142-
printk("ACPI_RES_TYPE_MEM failed\n");
145+
LOG_ERR("ACPI_RES_TYPE_MEM failed");
143146
return -ENODEV;
144147
}
145148

0 commit comments

Comments
 (0)