aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2019-11-18 11:19:29 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-14 21:46:48 +0100
commitcae0970ee9c4527f189aac378c50e2f0ed020418 (patch)
treeab25ca88b3f367551626822dd858f9cc8819c0a7 /drivers/firmware
parentslimbus: qcom: add missed clk_disable_unprepare in remove (diff)
downloadlinux-dev-cae0970ee9c4527f189aac378c50e2f0ed020418.tar.xz
linux-dev-cae0970ee9c4527f189aac378c50e2f0ed020418.zip
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: Patrick Rudolph <patrick.rudolph@9elements.com> Link: https://lore.kernel.org/r/20191118101934.22526-2-patrick.rudolph@9elements.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/google/coreboot_table.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/google/coreboot_table.c
index 8d132e4f008a..0205987a4fd4 100644
--- a/drivers/firmware/google/coreboot_table.c
+++ b/drivers/firmware/google/coreboot_table.c
@@ -163,8 +163,15 @@ static int coreboot_table_probe(struct platform_device *pdev)
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)
{
+ bus_for_each_dev(&coreboot_bus_type, NULL, NULL, __cb_dev_unregister);
bus_unregister(&coreboot_bus_type);
return 0;
}