Skip to content

Commit d1278c9

Browse files
rbmarlieredtor
authored andcommitted
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 <gregkh@linuxfoundation.org> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> Link: https://lore.kernel.org/r/20240210-bus_cleanup-input2-v1-1-0daef7e034e0@marliere.net Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent d49193b commit d1278c9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/input/rmi4/rmi_bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ static int rmi_bus_match(struct device *dev, struct device_driver *drv)
344344
return physical || rmi_function_match(dev, drv);
345345
}
346346

347-
struct bus_type rmi_bus_type = {
347+
const struct bus_type rmi_bus_type = {
348348
.match = rmi_bus_match,
349349
.name = "rmi4",
350350
};

drivers/input/rmi4/rmi_bus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static inline int rmi_write_block(struct rmi_device *d, u16 addr,
185185

186186
int rmi_for_each_dev(void *data, int (*func)(struct device *dev, void *data));
187187

188-
extern struct bus_type rmi_bus_type;
188+
extern const struct bus_type rmi_bus_type;
189189

190190
int rmi_of_property_read_u32(struct device *dev, u32 *result,
191191
const char *prop, bool optional);

0 commit comments

Comments
 (0)