summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2023-11-07 11:01:34 +0100
committerFelix Held <felix-coreboot@felixheld.de>2023-11-08 11:23:41 +0000
commit0a0945c6a211b51fada3c89f2ed1989356540bbb (patch)
tree15a1630077740a3c02040d6d492772d8fe8daccc
parent9eb0b19861652f20d5f9153785ab307e70222a36 (diff)
sio/nuvoton/npcd378: Use acpi_device_path_join
This achieves the same without the strconcat & free dance. Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Change-Id: I4d8e9bae6085a6e05847b01497fb4b51041ca7b8 Reviewed-on: https://review.coreboot.org/c/coreboot/+/78946 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
-rw-r--r--src/superio/nuvoton/npcd378/superio.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/superio/nuvoton/npcd378/superio.c b/src/superio/nuvoton/npcd378/superio.c
index f1db50934a..73c814fd28 100644
--- a/src/superio/nuvoton/npcd378/superio.c
+++ b/src/superio/nuvoton/npcd378/superio.c
@@ -150,7 +150,6 @@ static void npcd378_ssdt_pwr(const struct device *dev)
{
const char *name = acpi_device_path(dev);
const char *scope = acpi_device_scope(dev);
- char *tmp_name;
/* Scope */
acpigen_write_scope(name);
@@ -337,9 +336,7 @@ static void npcd378_ssdt_pwr(const struct device *dev)
/* Method (SIOW, 1, NotSerialized) */
acpigen_write_method("SIOW", 1);
acpigen_emit_byte(RETURN_OP);
- tmp_name = strconcat(name, ".SIOW");
- acpigen_emit_namestring(tmp_name);
- free(tmp_name);
+ acpigen_emit_namestring(acpi_device_path_join(dev, "SIOW"));
acpigen_emit_byte(ARG0_OP);
acpigen_pop_len();
@@ -348,9 +345,7 @@ static void npcd378_ssdt_pwr(const struct device *dev)
/* Method (SIOS, 1, NotSerialized) */
acpigen_write_method("SIOS", 1);
acpigen_emit_byte(RETURN_OP);
- tmp_name = strconcat(name, ".SIOS");
- acpigen_emit_namestring(tmp_name);
- free(tmp_name);
+ acpigen_emit_namestring(acpi_device_path_join(dev, "SIOS"));
acpigen_emit_byte(ARG0_OP);
acpigen_pop_len(); /* Pop Method */
@@ -361,9 +356,7 @@ static void npcd378_ssdt_pwr(const struct device *dev)
/* Method (SIOH, 0, NotSerialized) */
acpigen_write_method("_L08", 0);
acpigen_emit_byte(AND_OP);
- tmp_name = strconcat(scope, ".PMFG");
- acpigen_emit_namestring(tmp_name);
- free(tmp_name);
+ acpigen_emit_namestring(acpi_device_path_join(dev, "RMFG"));
acpigen_write_integer(0xE8);
acpigen_emit_byte(LOCAL0_OP);
@@ -373,17 +366,13 @@ static void npcd378_ssdt_pwr(const struct device *dev)
acpigen_emit_byte(ZERO_OP);
acpigen_emit_byte(NOTIFY_OP);
- tmp_name = strconcat(scope, ".L060");
- acpigen_emit_namestring(tmp_name);
- free(tmp_name);
+ acpigen_emit_namestring(acpi_device_path_join(dev, "L060"));
acpigen_write_integer(2);
acpigen_pop_len(); /* Pop If */
acpigen_emit_byte(AND_OP);
- tmp_name = strconcat(scope, ".PMFG");
- acpigen_emit_namestring(tmp_name);
- free(tmp_name);
+ acpigen_emit_namestring(acpi_device_path_join(dev, "PMFG"));
acpigen_write_integer(0x10);
acpigen_emit_byte(LOCAL0_OP);
@@ -393,9 +382,7 @@ static void npcd378_ssdt_pwr(const struct device *dev)
acpigen_emit_byte(ZERO_OP);
acpigen_emit_byte(NOTIFY_OP);
- tmp_name = strconcat(scope, ".L050");
- acpigen_emit_namestring(tmp_name);
- free(tmp_name);
+ acpigen_emit_namestring(acpi_device_path_join(dev, "L050"));
acpigen_write_integer(2);
acpigen_pop_len(); /* Pop If */