Skip to content

Commit 592190b

Browse files
rbmarliererafaeljw
authored andcommitted
ACPI: bus: make acpi_bus_type const
Now that the driver core can properly handle constant struct bus_type, move the acpi_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 841c351 commit 592190b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/acpi/bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ static void acpi_device_remove(struct device *dev)
10971097
put_device(dev);
10981098
}
10991099

1100-
struct bus_type acpi_bus_type = {
1100+
const struct bus_type acpi_bus_type = {
11011101
.name = "acpi",
11021102
.match = acpi_bus_match,
11031103
.probe = acpi_device_probe,

include/acpi/acpi_bus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ void acpi_initialize_hp_context(struct acpi_device *adev,
582582
void (*uevent)(struct acpi_device *, u32));
583583

584584
/* acpi_device.dev.bus == &acpi_bus_type */
585-
extern struct bus_type acpi_bus_type;
585+
extern const struct bus_type acpi_bus_type;
586586

587587
int acpi_bus_for_each_dev(int (*fn)(struct device *, void *), void *data);
588588
int acpi_dev_for_each_child(struct acpi_device *adev,

0 commit comments

Comments
 (0)