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:
@@ -78,8 +78,8 @@ static void adt7463_init(struct device *adt7463)
|
||||
}
|
||||
|
||||
static struct device_operations adt7463_operations = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.init = adt7463_init,
|
||||
};
|
||||
|
||||
|
@@ -33,8 +33,8 @@ static void at24rf08c_init(struct device *dev)
|
||||
}
|
||||
|
||||
static struct device_operations at24rf08c_operations = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.init = at24rf08c_init,
|
||||
};
|
||||
|
||||
|
@@ -46,8 +46,8 @@ static void ck505_init(struct device *dev)
|
||||
}
|
||||
|
||||
static struct device_operations ck505_operations = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.init = ck505_init,
|
||||
};
|
||||
|
||||
|
@@ -98,8 +98,8 @@ static const char *da7219_acpi_name(const struct device *dev)
|
||||
#endif
|
||||
|
||||
static struct device_operations da7219_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_name = da7219_acpi_name,
|
||||
.acpi_fill_ssdt = da7219_fill_ssdt,
|
||||
|
@@ -180,8 +180,8 @@ static const char *i2c_generic_acpi_name(const struct device *dev)
|
||||
#endif
|
||||
|
||||
static struct device_operations i2c_generic_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_name = i2c_generic_acpi_name,
|
||||
.acpi_fill_ssdt = i2c_generic_fill_ssdt_generator,
|
||||
|
@@ -37,8 +37,8 @@ static const char *i2c_hid_acpi_name(const struct device *dev)
|
||||
#endif
|
||||
|
||||
static struct device_operations i2c_hid_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_name = i2c_hid_acpi_name,
|
||||
.acpi_fill_ssdt = i2c_hid_fill_ssdt_generator,
|
||||
|
@@ -205,8 +205,8 @@ static void lm96000_init(struct device *const dev)
|
||||
}
|
||||
|
||||
static struct device_operations lm96000_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.init = lm96000_init,
|
||||
};
|
||||
|
||||
|
@@ -75,8 +75,8 @@ static const char *max98373_acpi_name(const struct device *dev)
|
||||
}
|
||||
|
||||
static struct device_operations max98373_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.acpi_name = max98373_acpi_name,
|
||||
.acpi_fill_ssdt = max98373_fill_ssdt,
|
||||
};
|
||||
|
@@ -71,8 +71,8 @@ static const char *max98927_acpi_name(const struct device *dev)
|
||||
}
|
||||
|
||||
static struct device_operations max98927_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.acpi_name = max98927_acpi_name,
|
||||
.acpi_fill_ssdt = max98927_fill_ssdt,
|
||||
};
|
||||
|
@@ -86,8 +86,8 @@ static const char *nau8825_acpi_name(const struct device *dev)
|
||||
#endif
|
||||
|
||||
static struct device_operations nau8825_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_name = nau8825_acpi_name,
|
||||
.acpi_fill_ssdt = nau8825_fill_ssdt,
|
||||
|
@@ -20,8 +20,8 @@ static void nct7802y_init(struct device *const dev)
|
||||
}
|
||||
|
||||
static struct device_operations nct7802y_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.init = nct7802y_init,
|
||||
};
|
||||
|
||||
|
@@ -39,8 +39,8 @@ static void pca9538_init(struct device *dev)
|
||||
}
|
||||
|
||||
static struct device_operations pca9538_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.init = pca9538_init,
|
||||
};
|
||||
|
||||
|
@@ -118,8 +118,8 @@ static void pcf8523_init(struct device *dev)
|
||||
}
|
||||
|
||||
static struct device_operations pcf8523c_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.init = pcf8523_init,
|
||||
.final = pcf8523_final
|
||||
};
|
||||
|
@@ -127,8 +127,8 @@ __weak int mb_adjust_cfg(struct ptn_3460_config *cfg_ptr)
|
||||
}
|
||||
|
||||
static struct device_operations ptn3460_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.init = ptn3460_init,
|
||||
};
|
||||
|
||||
|
@@ -84,8 +84,8 @@ static const char *rt1011_acpi_name(const struct device *dev)
|
||||
}
|
||||
|
||||
static struct device_operations rt1011_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.acpi_name = rt1011_acpi_name,
|
||||
.acpi_fill_ssdt = rt1011_fill_ssdt,
|
||||
};
|
||||
|
@@ -75,8 +75,8 @@ static const char *rt5663_acpi_name(const struct device *dev)
|
||||
}
|
||||
|
||||
static struct device_operations rt5663_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.acpi_name = rt5663_acpi_name,
|
||||
.acpi_fill_ssdt = rt5663_fill_ssdt,
|
||||
};
|
||||
|
@@ -225,8 +225,8 @@ static void rtd2132_init(struct device *dev)
|
||||
}
|
||||
|
||||
static struct device_operations rtd2132_operations = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.init = rtd2132_init,
|
||||
};
|
||||
|
||||
|
@@ -165,8 +165,8 @@ static void rx6110sa_init(struct device *dev)
|
||||
}
|
||||
|
||||
static struct device_operations rx6110sa_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.init = rx6110sa_init,
|
||||
.final = rx6110sa_final
|
||||
};
|
||||
|
@@ -79,8 +79,8 @@ static const char *i2c_sx9310_acpi_name(const struct device *dev)
|
||||
}
|
||||
|
||||
static struct device_operations i2c_sx9310_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.acpi_name = i2c_sx9310_acpi_name,
|
||||
.acpi_fill_ssdt = i2c_sx9310_fill_ssdt,
|
||||
};
|
||||
|
@@ -62,8 +62,8 @@ static const char *i2c_tpm_acpi_name(const struct device *dev)
|
||||
}
|
||||
|
||||
static struct device_operations i2c_tpm_ops = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.acpi_name = i2c_tpm_acpi_name,
|
||||
.acpi_fill_ssdt = i2c_tpm_fill_ssdt,
|
||||
};
|
||||
|
@@ -292,8 +292,8 @@ static void w83793_init(struct device *dev)
|
||||
}
|
||||
|
||||
static struct device_operations w83793_operations = {
|
||||
.read_resources = DEVICE_NOOP,
|
||||
.set_resources = DEVICE_NOOP,
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
.init = w83793_init,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user