From patchwork Fri Jan 12 13:18:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 13518472 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32AF86D1A9 for ; Fri, 12 Jan 2024 13:21:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="nBq3PbDy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705065674; bh=L+28NgGOIiCoYRdT/O15SQx+OK5WNhSsQoOnP70V+rE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nBq3PbDy9JluN0ABov4e5gHyDfO1sVRroFlx7r4gUxjxDcW697MV7/glA4Gc5wekN aCyiXzLcivCObF0Hb6Ovw/30z2prfulK6/ACxJpSw6753CYzeEYC763Ds3xwaasjVs NYeux67OafiJt9ChjzFbcrJ8/ZjXMkiOG8PiU3eV6ZNXt8N25ou5EK7ej6WprCrR3e UMWv+QBiDFd9WwC6aOyjkmvIidjt5mVSzSNm3DJf2XJQscd8rUFg1PKfqxf+qyxavE nQ8pfuAXgicJP5jCBwDzXZvb1tbDNW0+F2UX0CIMT3DeRIR6rqgaDlx1LZenboqtUZ 5l/MEP1Gd0kkg== Received: from localhost.localdomain (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madrid.collaboradmins.com (Postfix) with ESMTPSA id B540E3782031; Fri, 12 Jan 2024 13:21:11 +0000 (UTC) From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Tzung-Bi Shih Cc: kernel@collabora.com, AngeloGioacchino Del Regno , chrome-platform@lists.linux.dev, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Brian Norris , Julius Werner , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/7] firmware: coreboot: Generate modalias uevent for devices Date: Fri, 12 Jan 2024 10:18:30 -0300 Message-ID: <20240112131857.900734-2-nfraprado@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240112131857.900734-1-nfraprado@collabora.com> References: <20240112131857.900734-1-nfraprado@collabora.com> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Generate a modalias uevent for devices in the coreboot bus to allow userspace to automatically load the corresponding modules. Acked-by: Brian Norris Signed-off-by: NĂ­colas F. R. A. Prado --- (no changes since v1) 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)