linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: patrick.rudolph@9elements.com
To: linux-kernel@vger.kernel.org
Cc: coreboot@coreboot.org,
	Patrick Rudolph <patrick.rudolph@9elements.com>,
	Allison Randal <allison@lohutok.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alexios Zavras <alexios.zavras@intel.com>,
	Arthur Heymans <arthur@aheymans.xyz>
Subject: [PATCH v3 1/3] firmware: google: Release devices before unregistering the bus
Date: Mon, 18 Nov 2019 11:19:29 +0100	[thread overview]
Message-ID: <20191118101934.22526-2-patrick.rudolph@9elements.com> (raw)
In-Reply-To: <20191118101934.22526-1-patrick.rudolph@9elements.com>

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>
---
 -v2:
	Add missing return statement.
 -v3:
	Add missing patch changelog.
---
 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


  reply	other threads:[~2019-11-18 10:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 10:19 [PATCH v3 0/3] firmware: google: Fix minor bugs patrick.rudolph
2019-11-18 10:19 ` patrick.rudolph [this message]
2019-11-18 10:19 ` [PATCH v3 2/3] firmware: google: Unregister driver_info on failure and exit in gsmi patrick.rudolph
2019-11-18 10:19 ` [PATCH v3 3/3] firmware: google: Probe for a GSMI handler in firmware patrick.rudolph

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191118101934.22526-2-patrick.rudolph@9elements.com \
    --to=patrick.rudolph@9elements.com \
    --cc=alexios.zavras@intel.com \
    --cc=allison@lohutok.net \
    --cc=arthur@aheymans.xyz \
    --cc=coreboot@coreboot.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).