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 <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/40207 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
a461b694a6
commit
2f8ba69b0e
80 changed files with 150 additions and 150 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ static void soc_final(struct device *dev)
|
|||
|
||||
static struct device_operations soc_ops = {
|
||||
.read_resources = soc_read_resources,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.set_resources = noop_set_resources,
|
||||
.init = soc_init,
|
||||
.final = soc_final,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -219,8 +219,8 @@ static struct device_operations pci_domain_ops = {
|
|||
};
|
||||
|
||||
static 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 = apollolake_init_cpus,
|
||||
.acpi_fill_ssdt = generate_cpu_entries,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ static struct device_operations pci_domain_ops = {
|
|||
};
|
||||
|
||||
static 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 = baytrail_init_cpus,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ static struct device_operations pci_domain_ops = {
|
|||
};
|
||||
|
||||
static 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 = soc_init_cpus
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ static struct device_operations pci_domain_ops = {
|
|||
};
|
||||
|
||||
static 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 = &broadwell_init_cpus,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -184,8 +184,8 @@ static struct device_operations pci_domain_ops = {
|
|||
};
|
||||
|
||||
static struct device_operations cpu_bus_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.acpi_fill_ssdt = generate_cpu_entries,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ static void read_resources(struct device *dev)
|
|||
|
||||
static const struct device_operations device_ops = {
|
||||
.read_resources = read_resources,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.set_resources = noop_set_resources,
|
||||
.ops_pci = &pci_dev_ops_pci,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ static struct device_operations pci_domain_ops = {
|
|||
};
|
||||
|
||||
static 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 = denverton_init_cpus,
|
||||
#if CONFIG(HAVE_ACPI_TABLES)
|
||||
.acpi_fill_ssdt = generate_cpu_entries,
|
||||
|
|
|
|||
|
|
@ -140,8 +140,8 @@ static struct device_operations pci_domain_ops = {
|
|||
};
|
||||
|
||||
static struct device_operations cpu_bus_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.acpi_fill_ssdt = generate_cpu_entries,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -147,8 +147,8 @@ static struct device_operations pci_domain_ops = {
|
|||
};
|
||||
|
||||
static struct device_operations cpu_bus_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
#if CONFIG(HAVE_ACPI_TABLES)
|
||||
.acpi_fill_ssdt = generate_cpu_entries,
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -95,8 +95,8 @@ static struct device_operations pci_domain_ops = {
|
|||
};
|
||||
|
||||
static struct device_operations cpu_bus_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
#if CONFIG(HAVE_ACPI_TABLES)
|
||||
.acpi_fill_ssdt = generate_cpu_entries,
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -147,8 +147,8 @@ static struct device_operations pci_domain_ops = {
|
|||
};
|
||||
|
||||
static struct device_operations cpu_bus_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
#if CONFIG(HAVE_ACPI_TABLES)
|
||||
.acpi_fill_ssdt = generate_cpu_entries,
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ static struct device_operations pci_domain_ops = {
|
|||
};
|
||||
|
||||
static 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 = cpx_init_cpus,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -482,8 +482,8 @@ static struct device_operations pci_domain_ops = {
|
|||
};
|
||||
|
||||
static 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 = xeon_sp_init_cpus,
|
||||
#if CONFIG(HAVE_ACPI_TABLES)
|
||||
/* defined in src/soc/intel/common/block/acpi/acpi.c */
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ static void soc_init(struct device *dev)
|
|||
}
|
||||
|
||||
static struct device_operations soc_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.enable_resources = soc_enable,
|
||||
.init = soc_init,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ static void soc_read_resources(struct device *dev)
|
|||
|
||||
static struct device_operations soc_ops = {
|
||||
.read_resources = soc_read_resources,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.set_resources = noop_set_resources,
|
||||
};
|
||||
|
||||
static void enable_tegra210_dev(struct device *dev)
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ static void soc_init(struct device *dev)
|
|||
}
|
||||
|
||||
static struct device_operations soc_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.init = soc_init,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -112,8 +112,8 @@ static void cpu_init(struct device *dev)
|
|||
}
|
||||
|
||||
static struct device_operations cpu_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.enable_resources = cpu_enable,
|
||||
.init = cpu_init,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -142,8 +142,8 @@ static void cpu_init(struct device *dev)
|
|||
}
|
||||
|
||||
static struct device_operations cpu_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.enable_resources = cpu_enable,
|
||||
.init = cpu_init,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue