From 2f8ba69b0ee5deafa9bad20c2a7b2b4785fcb565 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Sun, 5 Apr 2020 14:05:24 +0200 Subject: Replace DEVICE_NOOP with noop_(set|read)_resources `.read_resources` and `.set_resources` are the only two device operations that are considered mandatory. Other function pointers can be left NULL. Having dedicated no-op implementations for the two mandatory fields should stop the leaking of no-op pointers to other fields. Change-Id: I6469a7568dc24317c95e238749d878e798b0a362 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/coreboot/+/40207 Reviewed-by: Angel Pons Reviewed-by: Paul Menzel Reviewed-by: HAOUAS Elyes Reviewed-by: Edward O'Callaghan Tested-by: build bot (Jenkins) --- src/soc/amd/common/block/smbus/sm.c | 4 ++-- src/soc/amd/picasso/chip.c | 4 ++-- src/soc/amd/picasso/i2c.c | 4 ++-- src/soc/amd/stoneyridge/chip.c | 4 ++-- src/soc/amd/stoneyridge/i2c.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/soc/amd') diff --git a/src/soc/amd/common/block/smbus/sm.c b/src/soc/amd/common/block/smbus/sm.c index 2863d22326..cef5bbaa23 100644 --- a/src/soc/amd/common/block/smbus/sm.c +++ b/src/soc/amd/common/block/smbus/sm.c @@ -75,8 +75,8 @@ static struct pci_operations lops_pci = { .set_subsystem = pci_dev_set_subsystem, }; static struct device_operations smbus_ops = { - .read_resources = DEVICE_NOOP, - .set_resources = DEVICE_NOOP, + .read_resources = noop_read_resources, + .set_resources = noop_set_resources, .enable_resources = pci_dev_enable_resources, .init = sm_init, .scan_bus = scan_smbus, diff --git a/src/soc/amd/picasso/chip.c b/src/soc/amd/picasso/chip.c index 865dad875a..7b3e7fba59 100644 --- a/src/soc/amd/picasso/chip.c +++ b/src/soc/amd/picasso/chip.c @@ -19,8 +19,8 @@ extern struct device_operations picasso_i2c_mmio_ops; extern const char *i2c_acpi_name(const struct device *dev); struct device_operations cpu_bus_ops = { - .read_resources = DEVICE_NOOP, - .set_resources = DEVICE_NOOP, + .read_resources = noop_read_resources, + .set_resources = noop_set_resources, .init = picasso_init_cpus, .acpi_fill_ssdt = generate_cpu_entries, }; diff --git a/src/soc/amd/picasso/i2c.c b/src/soc/amd/picasso/i2c.c index f17eccd487..22c62161f1 100644 --- a/src/soc/amd/picasso/i2c.c +++ b/src/soc/amd/picasso/i2c.c @@ -126,8 +126,8 @@ void i2c_soc_init(void) struct device_operations picasso_i2c_mmio_ops = { /* TODO(teravest): Move I2C resource info here. */ - .read_resources = DEVICE_NOOP, - .set_resources = DEVICE_NOOP, + .read_resources = noop_read_resources, + .set_resources = noop_set_resources, .scan_bus = scan_smbus, .acpi_name = i2c_acpi_name, .acpi_fill_ssdt = dw_i2c_acpi_fill_ssdt, diff --git a/src/soc/amd/stoneyridge/chip.c b/src/soc/amd/stoneyridge/chip.c index b27683a6dc..189f48e8e9 100644 --- a/src/soc/amd/stoneyridge/chip.c +++ b/src/soc/amd/stoneyridge/chip.c @@ -24,8 +24,8 @@ extern struct device_operations stoneyridge_i2c_mmio_ops; extern const char *i2c_acpi_name(const struct device *dev); struct device_operations cpu_bus_ops = { - .read_resources = DEVICE_NOOP, - .set_resources = DEVICE_NOOP, + .read_resources = noop_read_resources, + .set_resources = noop_set_resources, .init = stoney_init_cpus, .acpi_fill_ssdt = generate_cpu_entries, }; diff --git a/src/soc/amd/stoneyridge/i2c.c b/src/soc/amd/stoneyridge/i2c.c index 8ec3555c17..1fdb41691c 100644 --- a/src/soc/amd/stoneyridge/i2c.c +++ b/src/soc/amd/stoneyridge/i2c.c @@ -110,8 +110,8 @@ void i2c_soc_init(void) struct device_operations stoneyridge_i2c_mmio_ops = { /* TODO(teravest): Move I2C resource info here. */ - .read_resources = DEVICE_NOOP, - .set_resources = DEVICE_NOOP, + .read_resources = noop_read_resources, + .set_resources = noop_set_resources, .scan_bus = scan_smbus, .acpi_name = i2c_acpi_name, .acpi_fill_ssdt = dw_i2c_acpi_fill_ssdt, -- cgit v1.2.3