summaryrefslogtreecommitdiff
path: root/drivers/peci/internal.h
diff options
context:
space:
mode:
authorRicardo B. Marliere <ricardo@marliere.net>2024-02-19 09:36:35 -0300
committerIwona Winiarska <iwona.winiarska@intel.com>2024-04-16 00:14:43 +0200
commite6faf2b750ebf3837a63ebe465e7b7933502bdc4 (patch)
tree22dedecca37b35c9320a2f3d80dea056c535ff38 /drivers/peci/internal.h
parented8c2dad25eb2fbaa61f2e32385ecc1aa34c2355 (diff)
downloadlwn-e6faf2b750ebf3837a63ebe465e7b7933502bdc4.tar.gz
lwn-e6faf2b750ebf3837a63ebe465e7b7933502bdc4.zip
peci: constify the struct device_type usage
Since commit aed65af1cc2f ("drivers: make device_type const"), the driver core can properly handle constant struct device_type. Move the peci_controller_type and peci_device_type variables to be constant structures as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net> Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com> Link: https://lore.kernel.org/r/20240219-device_cleanup-peci-v1-1-0727662616f7@marliere.net Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
Diffstat (limited to 'drivers/peci/internal.h')
-rw-r--r--drivers/peci/internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/peci/internal.h b/drivers/peci/internal.h
index 8a896c256c5f..506bafcccbbf 100644
--- a/drivers/peci/internal.h
+++ b/drivers/peci/internal.h
@@ -75,7 +75,7 @@ struct peci_device_id {
u8 model;
};
-extern struct device_type peci_device_type;
+extern const struct device_type peci_device_type;
extern const struct attribute_group *peci_device_groups[];
int peci_device_create(struct peci_controller *controller, u8 addr);
@@ -129,7 +129,7 @@ void peci_driver_unregister(struct peci_driver *driver);
#define module_peci_driver(__peci_driver) \
module_driver(__peci_driver, peci_driver_register, peci_driver_unregister)
-extern struct device_type peci_controller_type;
+extern const struct device_type peci_controller_type;
int peci_controller_scan_devices(struct peci_controller *controller);