Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1713364rdd; Thu, 11 Jan 2024 07:15:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEeHLltoM5KW5ZTu4BefCK3EIhEQZS6qsesJIt4GAJTKRB2kt2ggno7S0J3v/2RyQ5HoxY6 X-Received: by 2002:a2e:b0ca:0:b0:2cd:7f01:a24a with SMTP id g10-20020a2eb0ca000000b002cd7f01a24amr566862ljl.87.1704986105138; Thu, 11 Jan 2024 07:15:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704986105; cv=none; d=google.com; s=arc-20160816; b=Gud8nJQjwAY99zE2ys6LgVetnttGufcgQmCdhGmPt92a8LawNt/avBvMdScgKjAn8L XPnvIKejbnx2sSlZmcCi5B6154NKnnmCULmHH5EY3JlBAUMWAMBFnot6lRB50ksJnTnB uKbJBg2hTl9KVY6Ij3GB6rDNtNuTjYiY5cGS55S7X0DePKDfqz4jr08N8G7hnbLDi2K5 UvWMvwSqfWyM7BUNhz1RYUgXii5oLg/Eu3OWTGT3bQjiQ2zqOBc5F+89eRp64dLm9AG3 dMT3kXjph3cwlIOfoZU3H4QTrWnZq8MRANnMlyhiAmJgmPKff4+k9BvWw2hJuIUHyQO8 ekdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=1SV53LjP2j3rZa7ofkO7/q/lSaM/GAjghiXo5dgaiLY=; fh=H0kbwUruoBXq1bqKu/NFiE7mK9MAh4+V9Tzc3DeEtw4=; b=KiBUmKA6gT9GERiN0DV5/skifcFSx83tJ5UKh9ncKKHfz0+0zp/5YQ17V9dH2LxYcB rFnulvq8ZpAG4ZU/LN6CQVnXklGxXGHI30XnjDIp4UcI2xiBKiF0cLaZOwRdgnvINKKK hqVfonriAthah/pbfzUrwRxM8A5ZqqPZwHYTIOYA0+VPUUhkgl8wyXEc7QEYwc5R4azf RRufs2VyQ+Me01jVz+WhzbT8wUaqIERuTaO5+sUhfDSoUgRbq+fkgmaAgDU81Ii8lbDu keadOoee8khU2qOOWmc9dScXAHuuaLwNcB7LTlDQK+Cxm0d9jwokGDZU0en39tYzf7QC H8+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=OPbNb62l; spf=pass (google.com: domain of linux-kernel+bounces-23774-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23774-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q25-20020aa7da99000000b005535915b925si603671eds.417.2024.01.11.07.15.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 07:15:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23774-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=OPbNb62l; spf=pass (google.com: domain of linux-kernel+bounces-23774-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23774-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D498F1F21FD8 for ; Thu, 11 Jan 2024 15:15:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 219A64CE12; Thu, 11 Jan 2024 15:14:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="OPbNb62l" 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 AA43B4CB34 for ; Thu, 11 Jan 2024 15:14:43 +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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1704986082; bh=Eo8gKt5JYCXR+AsI/6kbMVWmmQfxzbA30c+2Y+wtasI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OPbNb62lsPmHpn+uJjiQTn32fEbP2pUl6LEOUIj9oVJDYpu4q8a9mIICL2fmSmALk l0pjWEowxCQHL6O8TcfCS35h93qxxkljzl1oqUiuqKu+l7UjjH+/HPhxlp2aV5b8eI ge+3+VLDBvZP3UVEgwxvXYf4CIHM6bqxjKeuJZWBa8xaCC27nYMgLxnVqx3qaNO2mP oCm0d4D8G3d4mYonBDfdhv5on+J1lwjzHQr8wh2vJWA5TjzumbhJpbM7cr++uF38Xj ywKX4t7m7XtddBgcpojViv0XaovXjDeVArpi/vZd7Hu+WgkAiuonpb1rhqQuRFflRq eKtov3UjpgOfw== 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 4AC063781F80; Thu, 11 Jan 2024 15:14:39 +0000 (UTC) From: =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= To: Tzung-Bi Shih Cc: kernel@collabora.com, AngeloGioacchino Del Regno , =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= , Brian Norris , Julius Werner , 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 Message-ID: <20240111151226.842603-2-nfraprado@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240111151226.842603-1-nfraprado@collabora.com> References: <20240111151226.842603-1-nfraprado@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- 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