Skip to content

Commit 2fb7e4d

Browse files
gregkhrafaeljw
authored andcommitted
PNP: make pnp_bus_type const
Now that the driver core can properly handle constant struct bus_type, move the pnp_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent ba3f505 commit 2fb7e4d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/pnp/driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ static const struct dev_pm_ops pnp_bus_dev_pm_ops = {
256256
.restore = pnp_bus_resume,
257257
};
258258

259-
struct bus_type pnp_bus_type = {
259+
const struct bus_type pnp_bus_type = {
260260
.name = "pnp",
261261
.match = pnp_bus_match,
262262
.probe = pnp_device_probe,

include/linux/pnp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ struct pnp_protocol {
435435
#define protocol_for_each_dev(protocol, dev) \
436436
list_for_each_entry(dev, &(protocol)->devices, protocol_list)
437437

438-
extern struct bus_type pnp_bus_type;
438+
extern const struct bus_type pnp_bus_type;
439439

440440
#if defined(CONFIG_PNP)
441441

0 commit comments

Comments
 (0)