From nobody Thu May 5 23:42:26 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4FAEC1AC1A14; Thu, 5 May 2022 23:42:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KvVc309DVz4XPc; Thu, 5 May 2022 23:42:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651794147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EvDxpnmX1h1DRzPkbhKlxnq+ofAVX/zwnNSbnf9eA3I=; b=HXK0Fdvmba+B6hgAL2Mk8AchRM1KvmWNLS5AvlmPdbxL42fM7ta0jxlhSobxrieUTIYz0o xUJ0rpX9ie8IB72yXLJ7FPNiHu+aW2MyTXp5bBVn9uttfAn5hYZhpULv27s5JJfZ4v77ay TiKierghFPc4gqYC8AyDV9Fy2kgVU/61B/FNxV/xqCvj4Wd6EhFJGqkDArMFJ5puxQ8+RT 9c8b7KK1LxJer4X3wXmOBvrf0rHelyR9EWsX6K4cHvxMM1FULnOlh1tR7s6M/R5ASCA2zE hYkGcef8wX0z+ikZWI98Ac8yzQ/V6UVI158Gg2NPRCYdfXX9gKEDsIlPZRX3iQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D40D510CEB; Thu, 5 May 2022 23:42:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 245NgQQ6055630; Thu, 5 May 2022 23:42:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 245NgQqv055629; Thu, 5 May 2022 23:42:26 GMT (envelope-from git) Date: Thu, 5 May 2022 23:42:26 GMT Message-Id: <202205052342.245NgQqv055629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: e4ec982c75e3 - main - tdfx: Initialize tdfx_devclass via a module event handler. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e4ec982c75e3b31758de11a103f0f6bcd4fda10e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651794147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EvDxpnmX1h1DRzPkbhKlxnq+ofAVX/zwnNSbnf9eA3I=; b=mF7L5JqMtOtGTp0lsAj9OsDf2nHOzMVBWmtU8t4Dgy5kl4HHzvo6iDvd2MERk9hFNbRCaw 48pvY6vwXEb/3cQtq6B1bOro9AddI/5YvO3uopnf/UFNfKOhB8G0ZczK7LiYaaLYeS7i/S lfqunMPhdEnVwZLWMQJiIUewvKaA4VbrQbXhoU9dA0FGS8DIb6bxBkdYXCnD7u1kY8Oqha Dolyzl+QNsR2wkJgWJBxtDioPVEGjgY/yCNCu4XtNuRHIAs9hYUlOWolzXpPeE2Mu6pM2e mtxXhI5GGz9Vx/FPDKQNmQNyYVQgXpqU4HN+6HZogcz73jRK2ZZhGynV29UoZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651794147; a=rsa-sha256; cv=none; b=eYMC46O71myEKjzonqN9RD1Hli+iqQtm+DMkBZHLpHUt1HGmGimwdkOHmwesCJUAsCzk8Z UDqoPLGVSfm5Oc96dH7zoGsiLHV77oJ48ohVb2rB2v0mvpXBgiGfmGzZhoCrKoxUTw8v0j /tDQx+bHMB+cjwR0V0vWBFqP8HFVDulBtWe6V1PPxSTQH0zW2Hojw0yjHbfny292me7Jgh 8Nb5jaWY3yed65NHRIaE7I+qj/t3wimWEyLkxneP3mHDbhXN+8Dn6Eh86dkUjgywKMzYqe +2WRsiLr7+QfPgYIyQGPWhMXWf6bg0K9ebQ2Kl+ST671d+rfNBeptdsmQfDIPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e4ec982c75e3b31758de11a103f0f6bcd4fda10e commit e4ec982c75e3b31758de11a103f0f6bcd4fda10e Author: John Baldwin AuthorDate: 2022-05-05 23:37:38 +0000 Commit: John Baldwin CommitDate: 2022-05-05 23:37:38 +0000 tdfx: Initialize tdfx_devclass via a module event handler. Differential Revision: https://reviews.freebsd.org/D35065 --- sys/dev/tdfx/tdfx_pci.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/sys/dev/tdfx/tdfx_pci.c b/sys/dev/tdfx/tdfx_pci.c index 79ecf112d169..ef95cd971a73 100644 --- a/sys/dev/tdfx/tdfx_pci.c +++ b/sys/dev/tdfx/tdfx_pci.c @@ -800,6 +800,26 @@ tdfx_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread * return 0; } +static int +tdfx_mod_event(module_t mod, int what, void *arg) +{ + int error; + + switch (what) { + case MOD_LOAD: + tdfx_devclass = devclass_create("tdfx"); + error = 0; + break; + case MOD_UNLOAD: + error = 0; + break; + default: + error = EOPNOTSUPP; + break; + } + return (error); +} + /* This is the device driver struct. This is sent to the driver subsystem to * register the method structure and the info strcut space for this particular * instance of the driver. @@ -811,6 +831,6 @@ static driver_t tdfx_driver = { }; /* Tell Mr. Kernel about us! */ -DRIVER_MODULE(tdfx, pci, tdfx_driver, tdfx_devclass, 0, 0); +DRIVER_MODULE(tdfx, pci, tdfx_driver, tdfx_mod_event, NULL); MODULE_DEPEND(tdfx, mem, 1, 1, 1); MODULE_VERSION(tdfx, 1);