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>
This commit is contained in:
Arthur Heymans 2023-11-07 11:01:34 +01:00 committed by Felix Held
parent 9eb0b19861
commit 0a0945c6a2
1 changed files with 6 additions and 19 deletions

View File

@ -150,7 +150,6 @@ static void npcd378_ssdt_pwr(const struct device *dev)
{ {
const char *name = acpi_device_path(dev); const char *name = acpi_device_path(dev);
const char *scope = acpi_device_scope(dev); const char *scope = acpi_device_scope(dev);
char *tmp_name;
/* Scope */ /* Scope */
acpigen_write_scope(name); acpigen_write_scope(name);
@ -337,9 +336,7 @@ static void npcd378_ssdt_pwr(const struct device *dev)
/* Method (SIOW, 1, NotSerialized) */ /* Method (SIOW, 1, NotSerialized) */
acpigen_write_method("SIOW", 1); acpigen_write_method("SIOW", 1);
acpigen_emit_byte(RETURN_OP); acpigen_emit_byte(RETURN_OP);
tmp_name = strconcat(name, ".SIOW"); acpigen_emit_namestring(acpi_device_path_join(dev, "SIOW"));
acpigen_emit_namestring(tmp_name);
free(tmp_name);
acpigen_emit_byte(ARG0_OP); acpigen_emit_byte(ARG0_OP);
acpigen_pop_len(); acpigen_pop_len();
@ -348,9 +345,7 @@ static void npcd378_ssdt_pwr(const struct device *dev)
/* Method (SIOS, 1, NotSerialized) */ /* Method (SIOS, 1, NotSerialized) */
acpigen_write_method("SIOS", 1); acpigen_write_method("SIOS", 1);
acpigen_emit_byte(RETURN_OP); acpigen_emit_byte(RETURN_OP);
tmp_name = strconcat(name, ".SIOS"); acpigen_emit_namestring(acpi_device_path_join(dev, "SIOS"));
acpigen_emit_namestring(tmp_name);
free(tmp_name);
acpigen_emit_byte(ARG0_OP); acpigen_emit_byte(ARG0_OP);
acpigen_pop_len(); /* Pop Method */ acpigen_pop_len(); /* Pop Method */
@ -361,9 +356,7 @@ static void npcd378_ssdt_pwr(const struct device *dev)
/* Method (SIOH, 0, NotSerialized) */ /* Method (SIOH, 0, NotSerialized) */
acpigen_write_method("_L08", 0); acpigen_write_method("_L08", 0);
acpigen_emit_byte(AND_OP); acpigen_emit_byte(AND_OP);
tmp_name = strconcat(scope, ".PMFG"); acpigen_emit_namestring(acpi_device_path_join(dev, "RMFG"));
acpigen_emit_namestring(tmp_name);
free(tmp_name);
acpigen_write_integer(0xE8); acpigen_write_integer(0xE8);
acpigen_emit_byte(LOCAL0_OP); 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(ZERO_OP);
acpigen_emit_byte(NOTIFY_OP); acpigen_emit_byte(NOTIFY_OP);
tmp_name = strconcat(scope, ".L060"); acpigen_emit_namestring(acpi_device_path_join(dev, "L060"));
acpigen_emit_namestring(tmp_name);
free(tmp_name);
acpigen_write_integer(2); acpigen_write_integer(2);
acpigen_pop_len(); /* Pop If */ acpigen_pop_len(); /* Pop If */
acpigen_emit_byte(AND_OP); acpigen_emit_byte(AND_OP);
tmp_name = strconcat(scope, ".PMFG"); acpigen_emit_namestring(acpi_device_path_join(dev, "PMFG"));
acpigen_emit_namestring(tmp_name);
free(tmp_name);
acpigen_write_integer(0x10); acpigen_write_integer(0x10);
acpigen_emit_byte(LOCAL0_OP); 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(ZERO_OP);
acpigen_emit_byte(NOTIFY_OP); acpigen_emit_byte(NOTIFY_OP);
tmp_name = strconcat(scope, ".L050"); acpigen_emit_namestring(acpi_device_path_join(dev, "L050"));
acpigen_emit_namestring(tmp_name);
free(tmp_name);
acpigen_write_integer(2); acpigen_write_integer(2);
acpigen_pop_len(); /* Pop If */ acpigen_pop_len(); /* Pop If */