1

peci: Make peci_bus_type const

Now that the driver core can properly handle constant struct bus_type,
move the peci_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240210-bus_cleanup-peci-v1-1-1e64bef6efc0@marliere.net
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
This commit is contained in:
Ricardo B. Marliere 2024-02-10 12:10:14 -03:00 committed by Iwona Winiarska
parent 0bbac3facb
commit ed8c2dad25
2 changed files with 2 additions and 2 deletions

View File

@ -201,7 +201,7 @@ static void peci_bus_device_remove(struct device *dev)
driver->remove(device);
}
struct bus_type peci_bus_type = {
const struct bus_type peci_bus_type = {
.name = "peci",
.match = peci_bus_device_match,
.probe = peci_bus_device_probe,

View File

@ -81,7 +81,7 @@ extern const struct attribute_group *peci_device_groups[];
int peci_device_create(struct peci_controller *controller, u8 addr);
void peci_device_destroy(struct peci_device *device);
extern struct bus_type peci_bus_type;
extern const struct bus_type peci_bus_type;
extern const struct attribute_group *peci_bus_groups[];
/**