summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2020-04-24 21:27:29 -0700
committerFurquan Shaikh <furquan@google.com>2020-04-28 19:35:31 +0000
commitd14d03a6a8518ac3b4e24e8e35d60ce5e9d726aa (patch)
tree0c3441939ad48d198ef3e370e10a10894ee455c4 /src/arch
parent0f007d8ceb7e5c852c645cf773df5c5c37cbf411 (diff)
downloadcoreboot-d14d03a6a8518ac3b4e24e8e35d60ce5e9d726aa.tar.xz
arch/x86/acpi_device: Constify struct device * parameter to UID functions
acpi_device_uid() and acpi_device_write_uid() do not need to make changes to the device structure. Thus, this change marks struct device * parameter to these functions as const. Change-Id: I3755223766c78f93c57ac80caf392985cfd5c5e5 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/40702 Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/acpi_device.c4
-rw-r--r--src/arch/x86/include/arch/acpi_device.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/arch/x86/acpi_device.c b/src/arch/x86/acpi_device.c
index 2c461558a2..1dc471c54f 100644
--- a/src/arch/x86/acpi_device.c
+++ b/src/arch/x86/acpi_device.c
@@ -95,7 +95,7 @@ const char *acpi_device_hid(const struct device *dev)
* Generate unique ID based on the ACPI path.
* Collisions on the same _HID are possible but very unlikely.
*/
-uint32_t acpi_device_uid(struct device *dev)
+uint32_t acpi_device_uid(const struct device *dev)
{
const char *path = acpi_device_path(dev);
if (!path)
@@ -200,7 +200,7 @@ int acpi_device_status(const struct device *dev)
/* Write the unique _UID based on ACPI device path. */
-void acpi_device_write_uid(struct device *dev)
+void acpi_device_write_uid(const struct device *dev)
{
acpigen_write_name_integer("_UID", acpi_device_uid(dev));
}
diff --git a/src/arch/x86/include/arch/acpi_device.h b/src/arch/x86/include/arch/acpi_device.h
index 362efc4a62..80dab0b1ba 100644
--- a/src/arch/x86/include/arch/acpi_device.h
+++ b/src/arch/x86/include/arch/acpi_device.h
@@ -52,12 +52,12 @@ struct acpi_dp {
struct device;
const char *acpi_device_name(const struct device *dev);
const char *acpi_device_hid(const struct device *dev);
-uint32_t acpi_device_uid(struct device *dev);
+uint32_t acpi_device_uid(const struct device *dev);
const char *acpi_device_path(const struct device *dev);
const char *acpi_device_scope(const struct device *dev);
const char *acpi_device_path_join(const struct device *dev, const char *name);
int acpi_device_status(const struct device *dev);
-void acpi_device_write_uid(struct device *dev);
+void acpi_device_write_uid(const struct device *dev);
/*
* ACPI Descriptor for extended Interrupt()