From nobody Mon Apr 25 18:56:50 2022 X-Original-To: dev-commits-src-all@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 B3AE21A90790; Mon, 25 Apr 2022 18:56:50 +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 4KnDl64KLkz4XVd; Mon, 25 Apr 2022 18:56:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650913010; 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=vJuD020zjRFiZEjnNf2tpvFTVhHOa2kCoNKfeW4ejuo=; b=IxhhaP5yE/YBzo+/IlpmlEOBe6ZPGw0P8fEwo5kMCkrEc1ntPYAnG0GeCINNgk/nMUcrWk A3828mDlO085SFmAG0qaSPgZSOS7Js1KJXzAvF5JinuZfHCNw8qQBItt4lKUvQPmgioON4 IDn2x+3OsavF9OVsqKnbDw/6rvKXMwddJuGRbLinBYnXJNV7ncgKP2gLHP+AbLIZeqU87g G//JQ3FLn/8g6neTEcsce5slKUiF/hKW/v2C2DuhANbthgu1RLHiurcQhdJYN+LBQePTF0 wsp16Teni6HB4c2qJ9CkADY56dtF34jL3B/uH3w67p7C95xEo3D2QNThSZPmog== 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 7385920586; Mon, 25 Apr 2022 18:56:50 +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 23PIuoJE098475; Mon, 25 Apr 2022 18:56:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23PIuoml098474; Mon, 25 Apr 2022 18:56:50 GMT (envelope-from git) Date: Mon, 25 Apr 2022 18:56:50 GMT Message-Id: <202204251856.23PIuoml098474@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: 651a887f4e66 - main - xen: Use devclass_find to lookup devclasses in identify. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 651a887f4e66b15145508e74db72ebb73c22112b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650913010; 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=vJuD020zjRFiZEjnNf2tpvFTVhHOa2kCoNKfeW4ejuo=; b=Nj/ShV6CIjrkRODA42ZvwyfCvIfmd7pFh5j3Hppya7EcSEPppsSBKAhPUeHdMWnDxTDc4A uv3fSWwJOqp8TgcXadJ86CvRDaI1Itma0BGtA1WiGVQSCFv2X5T3atrIHNlQw4x62E7gXm NGWoqH0Ol2s6G6j+GT8H6MHmOwz4HxKKMVajULDIZOD78Y1tCHvclPLY7lC9OLQvcd4kiS 7zUjS6QEPmSQSwiMOr44L+plxu8lvtfshjXmuhJeuC8xspkHyBDyP7rRiiUO9oHDuxKCWY GMKcVudtjaBVAE94ZTritQXOOXPkJT+nwYdikunPerzw9BZwQjQJTu0R6rrO1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650913010; a=rsa-sha256; cv=none; b=F/ABHitqDXFRxb4YKAN0BhlK8Z6963rs/fEGDFkI/JJK5AFswjO2c1FfmqktPgCeIeYEqf i9sISGuphY+O+bW9U8BEIkd/POJ4s/ZHAxoZGAAK359IBxYO8LBdhwJrzK4G4XuLstWqgf pGwnJFGmnj+pmDQMSqjvoBhSCUxh2Ko8/RiPQSCugf2ecUfClwc1evPuXvtLmfA/bLJD7k MeSH69IqZmd9krDgO7ZyE6B7ZNJp7U42Z+w2Jx6xTb14o1sPjIaXCf9nrfSv2fM4qm1xw5 8+duib3U/JZls3/vtKeAhltHZtBmAZUcND1QAFtBtBedkiKnWll6xnGft8QMcg== 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=651a887f4e66b15145508e74db72ebb73c22112b commit 651a887f4e66b15145508e74db72ebb73c22112b Author: John Baldwin AuthorDate: 2022-04-25 18:55:30 +0000 Commit: John Baldwin CommitDate: 2022-04-25 18:55:30 +0000 xen: Use devclass_find to lookup devclasses in identify. While here, use driver->name instead of hardcoding the xenpv and xen_et strings both for devclass_find() and BUS_ADD_CHILD(). Reviewed by: Elliott Mitchell , imp, royger Differential Revision: https://reviews.freebsd.org/D35001 --- sys/dev/xen/bus/xenpv.c | 4 ++-- sys/dev/xen/timer/timer.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/xen/bus/xenpv.c b/sys/dev/xen/bus/xenpv.c index 91004039a85e..7727c1caccee 100644 --- a/sys/dev/xen/bus/xenpv.c +++ b/sys/dev/xen/bus/xenpv.c @@ -77,14 +77,14 @@ xenpv_identify(driver_t *driver, device_t parent) return; /* Make sure there's only one xenpv device. */ - if (devclass_get_device(xenpv_devclass, 0)) + if (devclass_get_device(devclass_find(driver->name), 0)) return; /* * The xenpv bus should be the last to attach in order * to properly detect if an ISA bus has already been added. */ - if (BUS_ADD_CHILD(parent, UINT_MAX, "xenpv", 0) == NULL) + if (BUS_ADD_CHILD(parent, UINT_MAX, driver->name, 0) == NULL) panic("Unable to attach xenpv bus."); } diff --git a/sys/dev/xen/timer/timer.c b/sys/dev/xen/timer/timer.c index fb646d8f0536..527259f6720f 100644 --- a/sys/dev/xen/timer/timer.c +++ b/sys/dev/xen/timer/timer.c @@ -109,10 +109,10 @@ xentimer_identify(driver_t *driver, device_t parent) return; /* Handle all Xen PV timers in one device instance. */ - if (devclass_get_device(xentimer_devclass, 0)) + if (devclass_get_device(devclass_find(driver->name), 0)) return; - BUS_ADD_CHILD(parent, 0, "xen_et", 0); + BUS_ADD_CHILD(parent, 0, driver->name, 0); } static int