driver core: bus: convert bus_create/remove_file to be constant
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Feb 2023 11:13:13 +0000 (12:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 09:43:12 +0000 (10:43 +0100)
commit0396f2863f7af3c588033d270f7d979d11cd4708
tree205ffa763fbf9ce03ac55073f9f194d1de4af184
parente0766ea4c8f8f94a605e291aa3672a703dc1d2e4
driver core: bus: convert bus_create/remove_file to be constant

bus_create_file() and bus_remove_file() can be made to take a constant
bus pointer, as it should not be modifying anything in the bus
structure.  Make this change and move the functions to use the internal
subsys_get/put() logic as well, to prevent the use of the back-pointer
in struct bus_type.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Link: https://lore.kernel.org/r/20230208111330.439504-5-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/bus.c
include/linux/device/bus.h