From d1c0f958d1986a94ac55ae1d196ba286c311b90f Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Mon, 2 Nov 2020 16:26:52 -0700 Subject: acpi: Call acpi_fill_ssdt() only for enabled devices Individual drivers check whether the concerned device is enabled before filling in the SSDT. Move the check before calling acpi_fill_ssdt() and remove the check in the individual drivers. BUG=None TEST=util/abuild/abuild Change-Id: Ib042bec7e8c68b38fafa60a8e965d781bddcd1f0 Signed-off-by: Karthikeyan Ramasubramanian Reviewed-on: https://review.coreboot.org/c/coreboot/+/47148 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Sumeet R Pawnikar Reviewed-by: Tim Wawrzynczak Reviewed-by: Angel Pons Reviewed-by: Christian Walter --- src/ec/google/chromeec/audio_codec/audio_codec.c | 2 +- src/ec/google/chromeec/ec_acpi.c | 3 --- src/ec/google/chromeec/i2c_tunnel/i2c_tunnel.c | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src/ec/google/chromeec') diff --git a/src/ec/google/chromeec/audio_codec/audio_codec.c b/src/ec/google/chromeec/audio_codec/audio_codec.c index 612b1f6995..53037eb01b 100644 --- a/src/ec/google/chromeec/audio_codec/audio_codec.c +++ b/src/ec/google/chromeec/audio_codec/audio_codec.c @@ -15,7 +15,7 @@ static void crosec_audio_codec_fill_ssdt(const struct device *dev) const char *scope = acpi_device_scope(dev); struct ec_google_chromeec_audio_codec_config *cfg = dev->chip_info; - if (!dev->enabled || !scope || !cfg) + if (!scope || !cfg) return; acpigen_write_scope(scope); diff --git a/src/ec/google/chromeec/ec_acpi.c b/src/ec/google/chromeec/ec_acpi.c index 448ea4dadd..fff395411c 100644 --- a/src/ec/google/chromeec/ec_acpi.c +++ b/src/ec/google/chromeec/ec_acpi.c @@ -223,9 +223,6 @@ void google_chromeec_fill_ssdt_generator(const struct device *dev) struct device_path path; struct device *ec; - if (!dev->enabled) - return; - /* Set up a minimal EC0 device to pass to the DPTF helpers */ path.type = DEVICE_PATH_GENERIC; path.generic.id = 0; diff --git a/src/ec/google/chromeec/i2c_tunnel/i2c_tunnel.c b/src/ec/google/chromeec/i2c_tunnel/i2c_tunnel.c index ec8bdfc2bf..e61ecfd8c1 100644 --- a/src/ec/google/chromeec/i2c_tunnel/i2c_tunnel.c +++ b/src/ec/google/chromeec/i2c_tunnel/i2c_tunnel.c @@ -17,7 +17,7 @@ static void crosec_i2c_tunnel_fill_ssdt(const struct device *dev) struct ec_google_chromeec_i2c_tunnel_config *cfg = dev->chip_info; struct acpi_dp *dsd; - if (!dev->enabled || !scope || !cfg) + if (!scope || !cfg) return; acpigen_write_scope(scope); -- cgit v1.2.3