Input: synaptics-rmi4 - make rmi_bus_type const

Now that the driver core can properly handle constant struct bus_type,
move the variable rmi_bus_type 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 <[email protected]>
Signed-off-by: Ricardo B. Marliere <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
This commit is contained in:
Ricardo B. Marliere
2024-03-03 15:06:58 -08:00
committed by Dmitry Torokhov
parent d49193be63
commit d1278c91fe
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -344,7 +344,7 @@ static int rmi_bus_match(struct device *dev, struct device_driver *drv)
return physical || rmi_function_match(dev, drv);
}
struct bus_type rmi_bus_type = {
const struct bus_type rmi_bus_type = {
.match = rmi_bus_match,
.name = "rmi4",
};
+1 -1
View File
@@ -185,7 +185,7 @@ static inline int rmi_write_block(struct rmi_device *d, u16 addr,
int rmi_for_each_dev(void *data, int (*func)(struct device *dev, void *data));
extern struct bus_type rmi_bus_type;
extern const struct bus_type rmi_bus_type;
int rmi_of_property_read_u32(struct device *dev, u32 *result,
const char *prop, bool optional);