[PATCH 18/21] driver core: bus: constify bus_register/unregister_notifier()

Greg Kroah-Hartman
2023-02-08T11:15:07Z

The bus_register_notifier() and bus_unregister_notifier() functions
should be taking a const * to bus_type, not just a * so fix that up.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/base/bus.c | 4 ++--
include/linux/device/bus.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 76cfe9cbf3bd..e6043a2d9feb 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -949,7 +949,7 @@ void bus_unregister(struct bus_type *bus)
}
EXPORT_SYMBOL_GPL(bus_unregister);

-int bus_register_notifier(struct bus_type *bus, struct notifier_block *nb)
+int bus_register_notifier(const struct bus_type *bus, struct notifier_block *nb)
{
struct subsys_private *sp = bus_to_subsys(bus);
int retval;
@@ -963,7 +963,7 @@ int bus_register_notifier(struct bus_type *bus, struct notifier_block *nb)
}
EXPORT_SYMBOL_GPL(bus_register_notifier);

-int bus_unregister_notifier(struct bus_type *bus, struct notifier_block *nb)
+int bus_unregister_notifier(const struct bus_type *bus, struct notifier_block *nb)
{
struct subsys_private *sp = bus_to_subsys(bus);
int retval;
diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h
index 22bf63469275..c0a034ff59b7 100644
--- a/include/linux/device/bus.h
+++ b/include/linux/device/bus.h
@@ -246,9 +246,9 @@ void bus_sort_breadthfirst(struct bus_type *bus,
*/
struct notifier_block;

-extern int bus_register_notifier(struct bus_type *bus,
+extern int bus_register_notifier(const struct bus_type *bus,
struct notifier_block *nb);
-extern int bus_unregister_notifier(struct bus_type *bus,
+extern int bus_unregister_notifier(const struct bus_type *bus,
struct notifier_block *nb);

/**
--
2.39.1