From: Rodríguez Barbarin, José Javier Date: Fri, 20 Oct 2023 12:44:32 +0000 (+0000) Subject: mcb: Use the actual bus passed to init and release functions X-Git-Tag: v6.7-rc1~78^2~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=28cbfe09ff20964d293cd7af10d2ec0782cf86cb;p=thirdparty%2Fkernel%2Flinux.git mcb: Use the actual bus passed to init and release functions The functions mcb_bus_add_devices() and mcb_devices_unregister() take a mcb_bus as argument that is never being used. This implies that there is only one bus. Do not ignore mcb_bus parameter and get the actual bus_type from the device related to this mcb_bus. Co-developed-by: Jorge Sanjuan Garcia Signed-off-by: Jorge Sanjuan Garcia Signed-off-by: Jose Javier Rodriguez Barbarin Link: https://lore.kernel.org/r/20231020124324.54692-2-JoseJavier.Rodriguez@duagon.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/mcb/mcb-core.c b/drivers/mcb/mcb-core.c index 5c6157b0db75b..2a4a5e71ad4e8 100644 --- a/drivers/mcb/mcb-core.c +++ b/drivers/mcb/mcb-core.c @@ -311,7 +311,7 @@ static int __mcb_devices_unregister(struct device *dev, void *data) static void mcb_devices_unregister(struct mcb_bus *bus) { - bus_for_each_dev(&mcb_bus_type, NULL, NULL, __mcb_devices_unregister); + bus_for_each_dev(bus->dev.bus, NULL, NULL, __mcb_devices_unregister); } /** * mcb_release_bus() - Free a @mcb_bus @@ -406,7 +406,7 @@ static int __mcb_bus_add_devices(struct device *dev, void *data) */ void mcb_bus_add_devices(const struct mcb_bus *bus) { - bus_for_each_dev(&mcb_bus_type, NULL, NULL, __mcb_bus_add_devices); + bus_for_each_dev(bus->dev.bus, NULL, NULL, __mcb_bus_add_devices); } EXPORT_SYMBOL_NS_GPL(mcb_bus_add_devices, MCB);