public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch v2 1/3] firmware: google: Release devices before unregistering the bus
@ 2019-11-18  8:38 patrick.rudolph
  2019-11-18  8:38 ` [Patch v2 2/3] firmware: google: Unregister driver_info on failure and exit in gsmi patrick.rudolph
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: patrick.rudolph @ 2019-11-18  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: coreboot, Patrick Rudolph, Greg Kroah-Hartman, Alexios Zavras,
	Allison Randal, Thomas Gleixner, Arthur Heymans

From: Patrick Rudolph <patrick.rudolph@9elements.com>

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>
---
 drivers/firmware/google/coreboot_table.c | 7 +++++++
 1 file changed, 7 insertions(+)

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;
 }
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-18  8:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-18  8:38 [Patch v2 1/3] firmware: google: Release devices before unregistering the bus patrick.rudolph
2019-11-18  8:38 ` [Patch v2 2/3] firmware: google: Unregister driver_info on failure and exit in gsmi patrick.rudolph
2019-11-18  8:39 ` [Patch v2 3/3] firmware: google: Probe for a GSMI handler in firmware patrick.rudolph
2019-11-18  8:59 ` [Patch v2 1/3] firmware: google: Release devices before unregistering the bus Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox