Commit cae0970e authored by Patrick Rudolph's avatar Patrick Rudolph Committed by Greg Kroah-Hartman

firmware: google: Release devices before unregistering the bus

Fix a bug where the kernel module can't be loaded after it has been
unloaded as the devices are still present and conflicting with the
to be created coreboot devices.
Signed-off-by: default avatarPatrick Rudolph <patrick.rudolph@9elements.com>
Link: https://lore.kernel.org/r/20191118101934.22526-2-patrick.rudolph@9elements.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 89d93c6d
...@@ -163,8 +163,15 @@ static int coreboot_table_probe(struct platform_device *pdev) ...@@ -163,8 +163,15 @@ static int coreboot_table_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int __cb_dev_unregister(struct device *dev, void *dummy)
{
device_unregister(dev);
return 0;
}
static int coreboot_table_remove(struct platform_device *pdev) static int coreboot_table_remove(struct platform_device *pdev)
{ {
bus_for_each_dev(&coreboot_bus_type, NULL, NULL, __cb_dev_unregister);
bus_unregister(&coreboot_bus_type); bus_unregister(&coreboot_bus_type);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment