From nobody Thu Apr 21 17:30:03 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 3189B199081A; Thu, 21 Apr 2022 17:30:04 +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 4Kkl0q3R1kz4WbK; Thu, 21 Apr 2022 17:30:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650562203; 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=O/YNZ9W3y4VZUL1wqyejW5Myy1IFgja421HRYieEKM0=; b=XoqzTiap1SQ/qvGJAIJ5IA70PZ5NRKR1WpkgEcG6+RqB8eBze2/BXZurTVj2NAqmo/gUmF OEjTbv8TFeUkZl+hR0DYOQ9DenJ7BfU2l75G9YYKEkCgJWWg9FuRyzW3aiUUY6h3LDFMHv HEgeKZokU6SjqIo9mt2GdE/Jy2+h2RBKnZk8DWWi7gxbgn267pzDt8qW+tLBn1lVw0YYU6 FkHbA1XgKWau3KgsRuVBXx/PZd6bxxHhn3h7ele1GwCb8fyqNH9HG6DoTPxQqapNYOyNKi uxLg0Mr7IgTu0jcbsw6+OcuyMKhlEtQ7ldkT6OlWlJ0s2SpGAzPLJ4srIkuHDA== 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 3F93250F7; Thu, 21 Apr 2022 17:30:03 +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 23LHU3tJ001681; Thu, 21 Apr 2022 17:30:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23LHU3Si001678; Thu, 21 Apr 2022 17:30:03 GMT (envelope-from git) Date: Thu, 21 Apr 2022 17:30:03 GMT Message-Id: <202204211730.23LHU3Si001678@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: 517a8a715a8a - main - hptiop: Store softc pointer in si_drv1 of cdev. 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: 517a8a715a8aa94071c058491d22c464a7962f74 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650562203; 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=O/YNZ9W3y4VZUL1wqyejW5Myy1IFgja421HRYieEKM0=; b=RpHOaHl+eoaMWYHi5eiHS7WMYA0Z6XDDiKPUJmG2TsUrHOgaVxxEv8/FbTEieOyjKpOItN rTOtnjb2kLBuT6y5BaToSETQRQqT5bzn0Bp9pbliN2Be2GjeANBgt51XNiCJJvPMmw1k1m t1FCdI736Anofxnb4EteSYIhGvI4+vOACwzOYg2C0BezrvulIccsgVwTgkE5Qfor/7HSTN NZQydh1iJ3DQBrO2XsB52Iokn71p2e/JTPIaON1BRxYfrgB+yctXeTaN40/3AFTFSk6lUm NpMP3Lh+ovAaHncqMLtvyu61hPLFXVJ4uQ2TXbeeQZZeiYyb/lcnciUmJylxvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650562203; a=rsa-sha256; cv=none; b=Vr8BV+mhMkKKTwkGXt3QT4O3A6MDUTJpjbRQeTfUuXs0B8AfklrV6OtFhVO6m3479tF826 HRNrIfyLX9szmCa88va0kao3RIg4H256mYXYneGyG/LMt9sIpnMBEsnpyLNlYVOCzayvRK WaiiMfug0983HpN/je+YqfdY0DK3DS/xLi1GHqqW37ajrrh5K3IHVwfjh1uUyW9Ln3ULJp p3Zi5LCkR0OlrMMMjdUkeP/7pvlGiMl3B9W15qYv1s1R4RTzoG4pgHZHixX2shKV6EWoB8 aBlvbFR9Zv2nuWyG8Iy9AbAqRoY73w3Uf7Tuh4wmz73bVjAJTcBBakD/nTWY/g== 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=517a8a715a8aa94071c058491d22c464a7962f74 commit 517a8a715a8aa94071c058491d22c464a7962f74 Author: John Baldwin AuthorDate: 2022-04-21 17:29:13 +0000 Commit: John Baldwin CommitDate: 2022-04-21 17:29:13 +0000 hptiop: Store softc pointer in si_drv1 of cdev. Rather than fetching the softc using the controller's unit number as an index into the devclass. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D34993 --- sys/dev/hptiop/hptiop.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/dev/hptiop/hptiop.c b/sys/dev/hptiop/hptiop.c index 773b30948ed9..9b25f59bc883 100644 --- a/sys/dev/hptiop/hptiop.c +++ b/sys/dev/hptiop/hptiop.c @@ -166,7 +166,7 @@ static struct cdevsw hptiop_cdevsw = { }; #define hba_from_dev(dev) \ - ((struct hpt_iop_hba *)devclass_get_softc(hptiop_devclass, dev2unit(dev))) + ((struct hpt_iop_hba *)((dev)->si_drv1)) #define BUS_SPACE_WRT4_ITL(offset, value) bus_space_write_4(hba->bar0t,\ hba->bar0h, offsetof(struct hpt_iopmu_itl, offset), (value)) @@ -1870,6 +1870,7 @@ static int hptiop_probe(device_t dev) static int hptiop_attach(device_t dev) { + struct make_dev_args args; struct hpt_iop_hba *hba = (struct hpt_iop_hba *)device_get_softc(dev); struct hpt_iop_request_get_config iop_config; struct hpt_iop_request_set_config set_config; @@ -2068,10 +2069,14 @@ static int hptiop_attach(device_t dev) hba->ops->enable_intr(hba); hba->initialized = 1; - hba->ioctl_dev = make_dev(&hptiop_cdevsw, unit, - UID_ROOT, GID_WHEEL /*GID_OPERATOR*/, - S_IRUSR | S_IWUSR, "%s%d", driver_name, unit); + make_dev_args_init(&args); + args.mda_devsw = &hptiop_cdevsw; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_WHEEL /*GID_OPERATOR*/; + args.mda_mode = S_IRUSR | S_IWUSR; + args.mda_si_drv1 = hba; + make_dev_s(&args, &hba->ioctl_dev, "%s%d", driver_name, unit); return 0;