From nobody Thu Apr 21 17:30:10 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 5A89E1990F0B; Thu, 21 Apr 2022 17:30:11 +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 4Kkl0z0Hztz4Wf3; Thu, 21 Apr 2022 17:30:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650562211; 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=ZWVfZm/6demGzd+wyXbbExB5GlXidIlYdxxC/w+JEB4=; b=MizbNrHACs+YZYyoXnDkI7uDe9QUkNXHwVHWLFHXl51RxOHKFESw7iS5xd1fcfNNSwpMrL RSiUYn7I8I73CYo40pE/0exvWAsXuLIe/zLWIZtz7P3pd1RucqyOGdYNqljgdDYM4vWDu1 2iyOPvaP2Mx00C57xOvjOoNixeN1divNmLmJM0pRI1dmXzmGHzUkB5vvLj1/hgbGAMDD/g 5J2tcc2Yj8++k92pSGnDLjZ9QVTX26O+j8YC0rqlby4RwkKm0S4W6KBTWdnTQZpVmslQjc DSwZ8sJqYaYYiKzRUZAFF54xRqPL3RWGjep8f1n8l3iweP6C1MgLDVGZaOJoKQ== 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 D4E684F26; Thu, 21 Apr 2022 17:30:10 +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 23LHUAD3003192; Thu, 21 Apr 2022 17:30:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23LHUAUT003190; Thu, 21 Apr 2022 17:30:10 GMT (envelope-from git) Date: Thu, 21 Apr 2022 17:30:10 GMT Message-Id: <202204211730.23LHUAUT003190@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: e9d92100c7a5 - main - hidbus: Use devclass_find to lookup the devclass for hidbus. 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: e9d92100c7a590a58e701799799a3b897db65201 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650562211; 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=ZWVfZm/6demGzd+wyXbbExB5GlXidIlYdxxC/w+JEB4=; b=wZXImcF0ueGnbpUxE+yJjCT2bTQ97B8IF8bISeqQJu+sixwjUsGYN3C5/LLMCuP3TZ3mEU OTzsRpj7j8jgTPDhjl9ZbMKbCMJfBEDvbvToNr4qlSaeGZM+UGIX30TfyPydqG3TLHS1G+ BdSHLNaZ8e8ji5Lw4FpbxgpAR+Hh8CznIJGpXlrKQsFIxb9bv/9YOSFc8VNwWZNbovrbH3 5Mf5wbKuI4Za6Jyi3qQHG13Vk0FWDk1QBT8pb8NF2EOzoXk/LgGksVL2+4Wu8rVX6mVXVa TS+VD6/OuDAs1GPKSdKxhMlcViWKoaa6WlBwo/0bWxQo61IeKtgFy3SfHTL8jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650562211; a=rsa-sha256; cv=none; b=v29/5BKOO8zWJU7LcsjmepQir2EOWVDURsszjCeJQIVbWBQ8WL01HTV+9O0LshHnxiCjCG CtkGxwGCe5O64zwmtp3PD38GfuGYhDjAyoKkxOqAwPyUezRXNXbXQdCN8vsamRmE88TBDs 4r57pIAMQaZf9SvotER4U/h3nXGgxuPoaSAwvjcaw4eys2jdqXq4y9soNYNDSpuxnp3afl cSWRDGkgMHhAn510aEdb/z/ncYM6AqEtar9rX1SVpEedO4cFKm4nOhcLu9rq7STtXuVK24 gSW2s2H04ZZSJbVtgEY2RadAelz7Jf0aRqkFKL1tMTFm7kd3leLdN3QtvmurXQ== 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=e9d92100c7a590a58e701799799a3b897db65201 commit e9d92100c7a590a58e701799799a3b897db65201 Author: John Baldwin AuthorDate: 2022-04-21 17:29:14 +0000 Commit: John Baldwin CommitDate: 2022-04-21 17:29:14 +0000 hidbus: Use devclass_find to lookup the devclass for hidbus. Reviewed by: wulf, imp Differential Revision: https://reviews.freebsd.org/D35000 --- sys/dev/hid/hidbus.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/hid/hidbus.c b/sys/dev/hid/hidbus.c index a635ca3de026..8067ab57d128 100644 --- a/sys/dev/hid/hidbus.c +++ b/sys/dev/hid/hidbus.c @@ -293,10 +293,10 @@ hidbus_detach_children(device_t dev) error = 0; - is_bus = device_get_devclass(dev) == hidbus_devclass; + is_bus = device_get_devclass(dev) == devclass_find("hidbus"); bus = is_bus ? dev : device_get_parent(dev); - KASSERT(device_get_devclass(bus) == hidbus_devclass, + KASSERT(device_get_devclass(bus) == devclass_find("hidbus"), ("Device is not hidbus or it's child")); if (is_bus) { @@ -686,7 +686,7 @@ hid_get_report_descr(device_t dev, void **data, hid_size_t *len) device_t bus; struct hidbus_softc *sc; - bus = device_get_devclass(dev) == hidbus_devclass ? + bus = device_get_devclass(dev) == devclass_find("hidbus") ? dev : device_get_parent(dev); sc = device_get_softc(bus); @@ -726,7 +726,7 @@ hid_set_report_descr(device_t dev, const void *data, hid_size_t len) bus_topo_assert(); - is_bus = device_get_devclass(dev) == hidbus_devclass; + is_bus = device_get_devclass(dev) == devclass_find("hidbus"); bus = is_bus ? dev : device_get_parent(dev); sc = device_get_softc(bus); @@ -804,7 +804,7 @@ hidbus_lookup_id(device_t dev, const struct hid_device_id *id, int nitems_id) id_end = id + nitems_id; info = hid_get_device_info(dev); - is_child = device_get_devclass(dev) != hidbus_devclass; + is_child = device_get_devclass(dev) != devclass_find("hidbus"); if (is_child) usage = hidbus_get_usage(dev); @@ -880,7 +880,7 @@ hid_get_device_info(device_t dev) { device_t bus; - bus = device_get_devclass(dev) == hidbus_devclass ? + bus = device_get_devclass(dev) == devclass_find("hidbus") ? dev : device_get_parent(dev); return (device_get_ivars(bus));