summaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2026-06-12 04:05:38 +0200
committerTom Rini <[email protected]>2026-06-29 15:29:44 -0600
commitd5046398433e48e7b0b664c1ee3e4e2af6f861a8 (patch)
tree571f8cf78a888d523b597261385e62aadb88ad68 /drivers/core
parent4a0990218aa9185c2ccd7986dc1ad14b24aaaa9d (diff)
treewide: Staticize and constify acpi ops
Set the acpi_ops structure as static const where applicable. The The structure is not accessible from outside of drivers and is not going to be modified at runtime. The structure may be unused in a couple of drivers depending on their configuration, mark those sites with __maybe_unused . Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/acpi.c4
-rw-r--r--drivers/core/root.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/core/acpi.c b/drivers/core/acpi.c
index 6a431171c8d..284fb70b036 100644
--- a/drivers/core/acpi.c
+++ b/drivers/core/acpi.c
@@ -87,7 +87,7 @@ int acpi_copy_name(char *out_name, const char *name)
int acpi_get_name(const struct udevice *dev, char *out_name)
{
- struct acpi_ops *aops;
+ const struct acpi_ops *aops;
const char *name;
int ret;
@@ -275,7 +275,7 @@ static int sort_acpi_item_type(struct acpi_ctx *ctx, void *start,
acpi_method acpi_get_method(struct udevice *dev, enum method_t method)
{
- struct acpi_ops *aops;
+ const struct acpi_ops *aops;
aops = device_get_acpi_ops(dev);
if (aops) {
diff --git a/drivers/core/root.c b/drivers/core/root.c
index 1f32f33b295..2aa16d59b69 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -459,7 +459,7 @@ static int root_acpi_get_name(const struct udevice *dev, char *out_name)
return acpi_copy_name(out_name, "\\_SB");
}
-struct acpi_ops root_acpi_ops = {
+static const struct acpi_ops root_acpi_ops = {
.get_name = root_acpi_get_name,
};
#endif