Skip to content

Commit 28cbfe0

Browse files
mad-jrodriguezgregkh
authored andcommitted
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 <jorge.sanjuangarcia@duagon.com> Signed-off-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@duagon.com> Signed-off-by: Jose Javier Rodriguez Barbarin <JoseJavier.Rodriguez@duagon.com> Link: https://lore.kernel.org/r/20231020124324.54692-2-JoseJavier.Rodriguez@duagon.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0720219 commit 28cbfe0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/mcb/mcb-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static int __mcb_devices_unregister(struct device *dev, void *data)
311311

312312
static void mcb_devices_unregister(struct mcb_bus *bus)
313313
{
314-
bus_for_each_dev(&mcb_bus_type, NULL, NULL, __mcb_devices_unregister);
314+
bus_for_each_dev(bus->dev.bus, NULL, NULL, __mcb_devices_unregister);
315315
}
316316
/**
317317
* mcb_release_bus() - Free a @mcb_bus
@@ -406,7 +406,7 @@ static int __mcb_bus_add_devices(struct device *dev, void *data)
406406
*/
407407
void mcb_bus_add_devices(const struct mcb_bus *bus)
408408
{
409-
bus_for_each_dev(&mcb_bus_type, NULL, NULL, __mcb_bus_add_devices);
409+
bus_for_each_dev(bus->dev.bus, NULL, NULL, __mcb_bus_add_devices);
410410
}
411411
EXPORT_SYMBOL_NS_GPL(mcb_bus_add_devices, MCB);
412412

0 commit comments

Comments
 (0)