mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: kernel@collabora.com,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
	"Brian Norris" <briannorris@chromium.org>,
	"Julius Werner" <jwerner@chromium.org>,
	chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH 1/4] firmware: coreboot: Generate modalias uevent for devices
Date: Thu, 11 Jan 2024 12:11:46 -0300	[thread overview]
Message-ID: <20240111151226.842603-2-nfraprado@collabora.com> (raw)
In-Reply-To: <20240111151226.842603-1-nfraprado@collabora.com>

Generate a modalias uevent for devices in the coreboot bus to allow
userspace to automatically load the corresponding modules.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---

 drivers/firmware/google/coreboot_table.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/google/coreboot_table.c
index 2a4469bf1b81..c1b9a9e8e8ed 100644
--- a/drivers/firmware/google/coreboot_table.c
+++ b/drivers/firmware/google/coreboot_table.c
@@ -53,11 +53,20 @@ static void coreboot_bus_remove(struct device *dev)
 		driver->remove(device);
 }
 
+static int coreboot_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
+{
+	struct coreboot_device *device = CB_DEV(dev);
+	u32 tag = device->entry.tag;
+
+	return add_uevent_var(env, "MODALIAS=coreboot:t%08X", tag);
+}
+
 static struct bus_type coreboot_bus_type = {
 	.name		= "coreboot",
 	.match		= coreboot_bus_match,
 	.probe		= coreboot_bus_probe,
 	.remove		= coreboot_bus_remove,
+	.uevent		= coreboot_bus_uevent,
 };
 
 static void coreboot_device_release(struct device *dev)
-- 
2.43.0


  reply	other threads:[~2024-01-11 15:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-11 15:11 [PATCH 0/4] Allow coreboot modules to autoload and enable cbmem in the arm64 defconfig Nícolas F. R. A. Prado
2024-01-11 15:11 ` Nícolas F. R. A. Prado [this message]
2024-01-12  0:37   ` [PATCH 1/4] firmware: coreboot: Generate modalias uevent for devices Brian Norris
2024-01-12 12:24     ` Nícolas F. R. A. Prado
2024-01-11 15:11 ` [PATCH 2/4] firmware: coreboot: Generate aliases for coreboot modules Nícolas F. R. A. Prado
2024-01-14 17:08   ` Andy Shevchenko
2024-01-17 12:53     ` Nícolas F. R. A. Prado
2024-01-21 12:41       ` Andy Shevchenko
2024-01-22 18:24         ` Nícolas F. R. A. Prado
2024-01-11 15:11 ` [PATCH 3/4] firmware: google: cbmem: Add to module device table Nícolas F. R. A. Prado
2024-01-12  0:38   ` Brian Norris
2024-01-12 12:26     ` Nícolas F. R. A. Prado
2024-01-15  2:53   ` kernel test robot
2024-01-16 17:40     ` Brian Norris
2024-01-11 15:11 ` [PATCH 4/4] arm64: defconfig: Enable support for cbmem entries in the coreboot table Nícolas F. R. A. Prado

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=20240111151226.842603-2-nfraprado@collabora.com \
    --to=nfraprado@collabora.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=briannorris@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=jwerner@chromium.org \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tzungbi@kernel.org \
    /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

all inboxes | Powered by JetHome®