Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PM: clk: make pm_clk_add_notifier() take a const pointer

The driver core wants to work with const struct bus_type, so there's no
reason that pm_clk_add_notifier() should not also do the same thing,
considering that it just passes the pointer off to the driver core which
is expecting a const *.

Cc: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/2023121922-triumph-exploit-f545@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+3 -3
+1 -1
drivers/base/power/clock_ops.c
··· 793 793 * the remaining members of @clknb should be populated prior to calling this 794 794 * routine. 795 795 */ 796 - void pm_clk_add_notifier(struct bus_type *bus, 796 + void pm_clk_add_notifier(const struct bus_type *bus, 797 797 struct pm_clk_notifier_block *clknb) 798 798 { 799 799 if (!bus || !clknb)
+2 -2
include/linux/pm_clock.h
··· 91 91 #endif 92 92 93 93 #ifdef CONFIG_HAVE_CLK 94 - extern void pm_clk_add_notifier(struct bus_type *bus, 94 + extern void pm_clk_add_notifier(const struct bus_type *bus, 95 95 struct pm_clk_notifier_block *clknb); 96 96 #else 97 - static inline void pm_clk_add_notifier(struct bus_type *bus, 97 + static inline void pm_clk_add_notifier(const struct bus_type *bus, 98 98 struct pm_clk_notifier_block *clknb) 99 99 { 100 100 }