device: Constify struct device * parameter to acpi_fill_ssdt()
.acpi_fill_ssdt() does not need to modify the device structure. This
change makes the struct device * parameter to acpi_fill_ssdt() as
const.
Change-Id: I110f4c67c3b6671c9ac0a82e02609902a8ee5d5c
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40710
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/drivers/crb/tis.c b/src/drivers/crb/tis.c
index bd54bb6..0e97a07 100644
--- a/src/drivers/crb/tis.c
+++ b/src/drivers/crb/tis.c
@@ -93,7 +93,7 @@
return 0;
}
-static void crb_tpm_fill_ssdt(struct device *dev)
+static void crb_tpm_fill_ssdt(const struct device *dev)
{
const char *path = acpi_device_path(dev);
if (!path) {
diff --git a/src/drivers/generic/adau7002/adau7002.c b/src/drivers/generic/adau7002/adau7002.c
index aa47ae6..bf2f03d 100644
--- a/src/drivers/generic/adau7002/adau7002.c
+++ b/src/drivers/generic/adau7002/adau7002.c
@@ -14,7 +14,7 @@
#define ADAU7002_ACPI_NAME "ADAU"
#define ADAU7002_ACPI_HID "ADAU7002"
-static void adau7002_fill_ssdt(struct device *dev)
+static void adau7002_fill_ssdt(const struct device *dev)
{
struct drivers_generic_adau7002_config *config;
struct acpi_dp *dp;
diff --git a/src/drivers/generic/generic/generic.c b/src/drivers/generic/generic/generic.c
index cee41a5..eed824d 100644
--- a/src/drivers/generic/generic/generic.c
+++ b/src/drivers/generic/generic/generic.c
@@ -10,7 +10,7 @@
#include <string.h>
#include "chip.h"
-static void generic_dev_fill_ssdt_generator(struct device *dev)
+static void generic_dev_fill_ssdt_generator(const struct device *dev)
{
struct acpi_dp *dsd;
struct drivers_generic_generic_config *config = dev->chip_info;
diff --git a/src/drivers/generic/gpio_keys/gpio_keys.c b/src/drivers/generic/gpio_keys/gpio_keys.c
index b8e72bf..1017f7a 100644
--- a/src/drivers/generic/gpio_keys/gpio_keys.c
+++ b/src/drivers/generic/gpio_keys/gpio_keys.c
@@ -46,7 +46,7 @@
return dsd;
}
-static void gpio_keys_fill_ssdt_generator(struct device *dev)
+static void gpio_keys_fill_ssdt_generator(const struct device *dev)
{
struct drivers_generic_gpio_keys_config *config = dev->chip_info;
const char *scope = acpi_device_scope(dev);
diff --git a/src/drivers/generic/gpio_regulator/gpio_regulator.c b/src/drivers/generic/gpio_regulator/gpio_regulator.c
index 0f39910..0ec1626 100644
--- a/src/drivers/generic/gpio_regulator/gpio_regulator.c
+++ b/src/drivers/generic/gpio_regulator/gpio_regulator.c
@@ -9,7 +9,7 @@
#include "chip.h"
-static void gpio_regulator_fill_ssdt_generator(struct device *dev)
+static void gpio_regulator_fill_ssdt_generator(const struct device *dev)
{
struct drivers_generic_gpio_regulator_config *config = dev->chip_info;
const char *scope = acpi_device_scope(dev);
diff --git a/src/drivers/generic/max98357a/max98357a.c b/src/drivers/generic/max98357a/max98357a.c
index 599acb5..b9c270b 100644
--- a/src/drivers/generic/max98357a/max98357a.c
+++ b/src/drivers/generic/max98357a/max98357a.c
@@ -14,7 +14,7 @@
#define MAX98357A_ACPI_NAME "MAXM"
-static void max98357a_fill_ssdt(struct device *dev)
+static void max98357a_fill_ssdt(const struct device *dev)
{
struct drivers_generic_max98357a_config *config = dev->chip_info;
const char *path;
diff --git a/src/drivers/gfx/generic/generic.c b/src/drivers/gfx/generic/generic.c
index aa8d756..4670b4d 100644
--- a/src/drivers/gfx/generic/generic.c
+++ b/src/drivers/gfx/generic/generic.c
@@ -101,7 +101,7 @@
privacy);
}
-static void gfx_fill_ssdt_generator(struct device *dev)
+static void gfx_fill_ssdt_generator(const struct device *dev)
{
size_t i;
struct drivers_gfx_generic_config *config = dev->chip_info;
diff --git a/src/drivers/i2c/da7219/da7219.c b/src/drivers/i2c/da7219/da7219.c
index 4cfeb9f..931c437 100644
--- a/src/drivers/i2c/da7219/da7219.c
+++ b/src/drivers/i2c/da7219/da7219.c
@@ -17,7 +17,7 @@
#define DA7219_ACPI_NAME "DLG7"
#define DA7219_ACPI_HID "DLGS7219"
-static void da7219_fill_ssdt(struct device *dev)
+static void da7219_fill_ssdt(const struct device *dev)
{
struct drivers_i2c_da7219_config *config = dev->chip_info;
const char *scope = acpi_device_scope(dev);
diff --git a/src/drivers/i2c/designware/dw_i2c.c b/src/drivers/i2c/designware/dw_i2c.c
index 309dfee..74e24c7 100644
--- a/src/drivers/i2c/designware/dw_i2c.c
+++ b/src/drivers/i2c/designware/dw_i2c.c
@@ -805,7 +805,7 @@
* Generate I2C timing information into the SSDT for the OS driver to consume,
* optionally applying override values provided by the caller.
*/
-void dw_i2c_acpi_fill_ssdt(struct device *dev)
+void dw_i2c_acpi_fill_ssdt(const struct device *dev)
{
const struct dw_i2c_bus_config *bcfg;
uintptr_t dw_i2c_addr;
diff --git a/src/drivers/i2c/designware/dw_i2c.h b/src/drivers/i2c/designware/dw_i2c.h
index e309bc12a..75df475 100644
--- a/src/drivers/i2c/designware/dw_i2c.h
+++ b/src/drivers/i2c/designware/dw_i2c.h
@@ -141,7 +141,7 @@
* Common device_operations implementation to fill ACPI SSDT table for i2c
* host controller.
*/
-void dw_i2c_acpi_fill_ssdt(struct device *dev);
+void dw_i2c_acpi_fill_ssdt(const struct device *dev);
/*
* Common device_operations implementation for i2c host controller ops.
diff --git a/src/drivers/i2c/generic/chip.h b/src/drivers/i2c/generic/chip.h
index b167b71..e1f4472 100644
--- a/src/drivers/i2c/generic/chip.h
+++ b/src/drivers/i2c/generic/chip.h
@@ -76,7 +76,7 @@
* callback: Callback to fill in device-specific information
* config: Pointer to drivers_i2c_generic_config structure
*/
-void i2c_generic_fill_ssdt(struct device *dev,
+void i2c_generic_fill_ssdt(const struct device *dev,
void (*callback)(const struct device *dev),
struct drivers_i2c_generic_config *config);
diff --git a/src/drivers/i2c/generic/generic.c b/src/drivers/i2c/generic/generic.c
index 38fcfdc..7e709d6 100644
--- a/src/drivers/i2c/generic/generic.c
+++ b/src/drivers/i2c/generic/generic.c
@@ -43,7 +43,7 @@
return ret;
}
-void i2c_generic_fill_ssdt(struct device *dev,
+void i2c_generic_fill_ssdt(const struct device *dev,
void (*callback)(const struct device *dev),
struct drivers_i2c_generic_config *config)
{
@@ -159,7 +159,7 @@
config->desc ? : dev->chip_ops->name, dev_path(dev));
}
-static void i2c_generic_fill_ssdt_generator(struct device *dev)
+static void i2c_generic_fill_ssdt_generator(const struct device *dev)
{
i2c_generic_fill_ssdt(dev, NULL, dev->chip_info);
}
diff --git a/src/drivers/i2c/hid/hid.c b/src/drivers/i2c/hid/hid.c
index 0cb28bb..4fac858 100644
--- a/src/drivers/i2c/hid/hid.c
+++ b/src/drivers/i2c/hid/hid.c
@@ -20,7 +20,7 @@
acpigen_write_dsm_i2c_hid(&dsm_config);
}
-static void i2c_hid_fill_ssdt_generator(struct device *dev)
+static void i2c_hid_fill_ssdt_generator(const struct device *dev)
{
struct drivers_i2c_hid_config *config = dev->chip_info;
config->generic.cid = I2C_HID_CID;
diff --git a/src/drivers/i2c/max98373/max98373.c b/src/drivers/i2c/max98373/max98373.c
index a7df56b..0675638 100644
--- a/src/drivers/i2c/max98373/max98373.c
+++ b/src/drivers/i2c/max98373/max98373.c
@@ -14,7 +14,7 @@
#define MAX98373_ACPI_NAME "MAXI"
#define MAX98373_ACPI_HID "MX98373"
-static void max98373_fill_ssdt(struct device *dev)
+static void max98373_fill_ssdt(const struct device *dev)
{
struct drivers_i2c_max98373_config *config = dev->chip_info;
const char *scope = acpi_device_scope(dev);
diff --git a/src/drivers/i2c/max98927/max98927.c b/src/drivers/i2c/max98927/max98927.c
index 0cb80ae..ddd9d15 100644
--- a/src/drivers/i2c/max98927/max98927.c
+++ b/src/drivers/i2c/max98927/max98927.c
@@ -14,7 +14,7 @@
#define MAX98927_ACPI_NAME "MAXI"
#define MAX98927_ACPI_HID "MX98927"
-static void max98927_fill_ssdt(struct device *dev)
+static void max98927_fill_ssdt(const struct device *dev)
{
struct drivers_i2c_max98927_config *config = dev->chip_info;
const char *scope = acpi_device_scope(dev);
diff --git a/src/drivers/i2c/nau8825/nau8825.c b/src/drivers/i2c/nau8825/nau8825.c
index c3e95e7..fd9cfc9 100644
--- a/src/drivers/i2c/nau8825/nau8825.c
+++ b/src/drivers/i2c/nau8825/nau8825.c
@@ -19,7 +19,7 @@
#define NAU8825_DP_INT(key,val) \
acpi_dp_add_integer(dp, "nuvoton," key, (val))
-static void nau8825_fill_ssdt(struct device *dev)
+static void nau8825_fill_ssdt(const struct device *dev)
{
struct drivers_i2c_nau8825_config *config = dev->chip_info;
const char *scope = acpi_device_scope(dev);
diff --git a/src/drivers/i2c/rt1011/rt1011.c b/src/drivers/i2c/rt1011/rt1011.c
index 68681ef..ec018cc 100644
--- a/src/drivers/i2c/rt1011/rt1011.c
+++ b/src/drivers/i2c/rt1011/rt1011.c
@@ -16,7 +16,7 @@
#define RT1011_DP_INT(key, val) acpi_dp_add_integer(dp, "realtek," key, (val))
-static void rt1011_fill_ssdt(struct device *dev)
+static void rt1011_fill_ssdt(const struct device *dev)
{
struct drivers_i2c_rt1011_config *config = dev->chip_info;
const char *scope = acpi_device_scope(dev);
diff --git a/src/drivers/i2c/rt5663/rt5663.c b/src/drivers/i2c/rt5663/rt5663.c
index 70c14ef..67d8dea 100644
--- a/src/drivers/i2c/rt5663/rt5663.c
+++ b/src/drivers/i2c/rt5663/rt5663.c
@@ -17,7 +17,7 @@
#define RT5663_DP_INT(key, val) \
acpi_dp_add_integer(dp, "realtek," key, (val))
-static void rt5663_fill_ssdt(struct device *dev)
+static void rt5663_fill_ssdt(const struct device *dev)
{
struct drivers_i2c_rt5663_config *config = dev->chip_info;
const char *scope = acpi_device_scope(dev);
diff --git a/src/drivers/i2c/sx9310/sx9310.c b/src/drivers/i2c/sx9310/sx9310.c
index a4fac10..44cb883 100644
--- a/src/drivers/i2c/sx9310/sx9310.c
+++ b/src/drivers/i2c/sx9310/sx9310.c
@@ -18,7 +18,7 @@
I2C_SX9310_ACPI_ID "," #NAME, \
config->NAME)
-static void i2c_sx9310_fill_ssdt(struct device *dev)
+static void i2c_sx9310_fill_ssdt(const struct device *dev)
{
struct drivers_i2c_sx9310_config *config = dev->chip_info;
const char *scope = acpi_device_scope(dev);
diff --git a/src/drivers/i2c/tpm/chip.c b/src/drivers/i2c/tpm/chip.c
index b81b0d1..fbf9ffa 100644
--- a/src/drivers/i2c/tpm/chip.c
+++ b/src/drivers/i2c/tpm/chip.c
@@ -11,7 +11,7 @@
#include "tpm.h"
#include "chip.h"
-static void i2c_tpm_fill_ssdt(struct device *dev)
+static void i2c_tpm_fill_ssdt(const struct device *dev)
{
struct drivers_i2c_tpm_config *config = dev->chip_info;
const char *scope = acpi_device_scope(dev);
diff --git a/src/drivers/intel/ish/ish.c b/src/drivers/intel/ish/ish.c
index 3daf491..5840286 100644
--- a/src/drivers/intel/ish/ish.c
+++ b/src/drivers/intel/ish/ish.c
@@ -8,7 +8,7 @@
#include <device/pci_ids.h>
#include "chip.h"
-static void ish_fill_ssdt_generator(struct device *dev)
+static void ish_fill_ssdt_generator(const struct device *dev)
{
struct drivers_intel_ish_config *config = dev->chip_info;
struct device *root = dev->bus->dev;
diff --git a/src/drivers/intel/mipi_camera/camera.c b/src/drivers/intel/mipi_camera/camera.c
index aabf2ba..b8e1076 100644
--- a/src/drivers/intel/mipi_camera/camera.c
+++ b/src/drivers/intel/mipi_camera/camera.c
@@ -10,7 +10,7 @@
#include <device/path.h>
#include "chip.h"
-static void camera_fill_ssdt(struct device *dev)
+static void camera_fill_ssdt(const struct device *dev)
{
struct drivers_intel_mipi_camera_config *config = dev->chip_info;
const char *scope = acpi_device_scope(dev);
diff --git a/src/drivers/intel/wifi/wifi.c b/src/drivers/intel/wifi/wifi.c
index c3e551a..ffbab4d 100644
--- a/src/drivers/intel/wifi/wifi.c
+++ b/src/drivers/intel/wifi/wifi.c
@@ -59,7 +59,7 @@
#endif
#if CONFIG(HAVE_ACPI_TABLES)
-static void intel_wifi_fill_ssdt(struct device *dev)
+static void intel_wifi_fill_ssdt(const struct device *dev)
{
struct drivers_intel_wifi_config *config = dev->chip_info;
struct generic_wifi_config generic_config;
diff --git a/src/drivers/ipmi/ipmi_kcs_ops.c b/src/drivers/ipmi/ipmi_kcs_ops.c
index 349abbc..145313a 100644
--- a/src/drivers/ipmi/ipmi_kcs_ops.c
+++ b/src/drivers/ipmi/ipmi_kcs_ops.c
@@ -221,7 +221,7 @@
return current;
}
-static void ipmi_ssdt(struct device *dev)
+static void ipmi_ssdt(const struct device *dev)
{
const char *scope = acpi_device_scope(dev);
struct drivers_ipmi_config *conf = NULL;
diff --git a/src/drivers/net/r8168.c b/src/drivers/net/r8168.c
index c547f17..b904586 100644
--- a/src/drivers/net/r8168.c
+++ b/src/drivers/net/r8168.c
@@ -306,7 +306,7 @@
#if CONFIG(HAVE_ACPI_TABLES)
#define R8168_ACPI_HID "R8168"
-static void r8168_net_fill_ssdt(struct device *dev)
+static void r8168_net_fill_ssdt(const struct device *dev)
{
struct drivers_net_config *config = dev->chip_info;
const char *path = acpi_device_path(dev->bus->dev);
diff --git a/src/drivers/pc80/tpm/tis.c b/src/drivers/pc80/tpm/tis.c
index 1081410..3d4c6b6 100644
--- a/src/drivers/pc80/tpm/tis.c
+++ b/src/drivers/pc80/tpm/tis.c
@@ -872,7 +872,7 @@
tpm_mci_func1_cb,
};
-static void lpc_tpm_fill_ssdt(struct device *dev)
+static void lpc_tpm_fill_ssdt(const struct device *dev)
{
const char *path = acpi_device_path(dev->bus->dev);
u32 arg;
diff --git a/src/drivers/spi/acpi/acpi.c b/src/drivers/spi/acpi/acpi.c
index 76bddbd..0eeaffb 100644
--- a/src/drivers/spi/acpi/acpi.c
+++ b/src/drivers/spi/acpi/acpi.c
@@ -59,7 +59,7 @@
return ret;
}
-static void spi_acpi_fill_ssdt_generator(struct device *dev)
+static void spi_acpi_fill_ssdt_generator(const struct device *dev)
{
struct drivers_spi_acpi_config *config = dev->chip_info;
const char *scope = acpi_device_scope(dev);
diff --git a/src/drivers/usb/acpi/usb_acpi.c b/src/drivers/usb/acpi/usb_acpi.c
index a6a004f..916d373 100644
--- a/src/drivers/usb/acpi/usb_acpi.c
+++ b/src/drivers/usb/acpi/usb_acpi.c
@@ -21,7 +21,7 @@
return true;
}
-static void usb_acpi_fill_ssdt_generator(struct device *dev)
+static void usb_acpi_fill_ssdt_generator(const struct device *dev)
{
struct drivers_usb_acpi_config *config = dev->chip_info;
const char *path = acpi_device_path(dev);
diff --git a/src/drivers/wifi/generic.c b/src/drivers/wifi/generic.c
index fe2e39d..b864094 100644
--- a/src/drivers/wifi/generic.c
+++ b/src/drivers/wifi/generic.c
@@ -171,7 +171,7 @@
acpigen_pop_len();
}
-void generic_wifi_fill_ssdt(struct device *dev,
+void generic_wifi_fill_ssdt(const struct device *dev,
const struct generic_wifi_config *config)
{
const char *path;
diff --git a/src/drivers/wifi/generic_wifi.h b/src/drivers/wifi/generic_wifi.h
index 1c90bc6..b863ef4 100644
--- a/src/drivers/wifi/generic_wifi.h
+++ b/src/drivers/wifi/generic_wifi.h
@@ -22,7 +22,7 @@
* This function implements common device operation to help fill ACPI SSDT
* table for WiFi controller.
*/
-void generic_wifi_fill_ssdt(struct device *dev,
+void generic_wifi_fill_ssdt(const struct device *dev,
const struct generic_wifi_config *config);
/**