From nobody Fri May 20 00:20:54 2022 X-Original-To: dev-commits-src-branches@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 3561D1B403FD; Fri, 20 May 2022 00:20:55 +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 4L46nz0z8Qz3klN; Fri, 20 May 2022 00:20:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653006055; 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=+PXI6ms9nPbd2agQtunwAjIgpqNblUOZhYMPRNyUpYE=; b=yLGu8uQHk7H8x+CwkiCXCEEB/oZ9T+55PnSctFP5Bblw1d/eRTTX2JAWp3FCIQ9X+4EJ0n o45CLXRQ7CMHjOIdrpwD5mQwZ6YhMoedgqL4ut86zhwr8NWulcrbrjpWb64pPeJHd7AONi NYliSyjbLsivJwRzApbtnAv6PtgJHw8LPSmjRf+sj2+xC+wSB0FurSfLYf5YfTuEHOwngZ 0sSziKBZrDI21+GXkg7FR7IfYqI2g5aUady3V0pnpMVCfbzlQpj9PKAJvjvQwPCHmDUh8v h1g2+z3aSGbVykOxp0f9yWZWaMjGIHFaynMpPpG9gERJ4xgE+Sd4Yu4gfc3Icg== 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 021D427C8C; Fri, 20 May 2022 00:20:55 +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 24K0KsMG071731; Fri, 20 May 2022 00:20:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24K0Ks8W071730; Fri, 20 May 2022 00:20:54 GMT (envelope-from git) Date: Fri, 20 May 2022 00:20:54 GMT Message-Id: <202205200020.24K0Ks8W071730@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b4600b137808 - stable/13 - hptiop: Store softc pointer in si_drv1 of cdev. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: b4600b13780847f8c9e4369ee1fa2bf7b8913399 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653006055; 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=+PXI6ms9nPbd2agQtunwAjIgpqNblUOZhYMPRNyUpYE=; b=RMXC2/nPW5nvZblA7m1OsIbcujVEjPl67anhkNJf2z/PwCgqKuwCLi0oCE5iY4yGbjQgbG EURGPp4atMDdLH6JHB6wcMakut6GrG4ZlwCKuz/gafTHpaE7pnlwEBAtGTRSXYwfaVXTqB iTI1oP19CZqIi5ALazIdo/wUF9c+8oZwWxyo6qX5bu4pfzCAL12+POrEvptPChucyFLr/3 a1JktZGOKm0Xzyzj/2frmT8KvtTcsu3mhAKpAZfAoBt+icey/Cje9gUfufWDU0G5uKEgek TOaargpcSQ3bD/PU6mT4b54HFYc9vIzXmPto/OuON9Vw3DPpILQwxnY1oq+kXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653006055; a=rsa-sha256; cv=none; b=EiiPQ9oz0iNCRRpwFSMdXZNI87+N2pCZBbZxd2Oks4IIvnsICZVi6ZlMl1MAp6Dha6kiq9 9gr5DP3CANhBfZN0lNGZflWveDPSUmIsNJO1hO4lSN6SL64bvVNPL8FuujhQoipP4LHHWP GoSfl0g8hMMIUKHUL+AsMJ5NznIgJyHfqlyADJ2IhkZ6AHFl39mbcmdJPxC/pWMANrVsW4 4StYKuEu4EoE/3zNAS5Nrv0EC03885mnj39F24Kzu5bW00IUXB053xK370jN7POaT/tWpG XCNgHH5sEqMhrrtJWGvukT9vFIVeR8B6wEp1NKLgWVxz42VymBaKMeenYGwNXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b4600b13780847f8c9e4369ee1fa2bf7b8913399 commit b4600b13780847f8c9e4369ee1fa2bf7b8913399 Author: John Baldwin AuthorDate: 2022-04-21 17:29:13 +0000 Commit: John Baldwin CommitDate: 2022-05-19 21:31:53 +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 (cherry picked from commit 517a8a715a8aa94071c058491d22c464a7962f74) --- 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 eddc8da5bd8e..4091a8fb2822 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)) @@ -1874,6 +1874,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; @@ -2071,10 +2072,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;