From nobody Tue Aug 15 06:45:53 2023 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 4RQ1xY5XMPz4qZhn; Tue, 15 Aug 2023 06:45:53 +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 4RQ1xY3BfLz4QFr; Tue, 15 Aug 2023 06:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692081953; 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=gCddEBXJXnJoXysZXHFiPFe3BP09Uuftw4yZ2BI/wME=; b=VYqtXRZ+7OK+B3/4ek/91FOH6KqnB42q81yrfmQTMVa9wEwGbidtIV6yRW9RlsVnfP8CCG VFKGrGCEvINkVYKEGaedtCO71VJOIrdxMib7ffNWpkNx6Z115HCri4589Ppza65HujCy4H KnNRQlDxNVODVDQGCnWsdwMDU+p8GTOEscZJJXnERt32V2uIIT5TkWI2ErAXht5VT30E0a 5FyewEACrmV0aEe8C4MKFqpCFjT6704T1gxjizPM82aMWkFnAxBycufuO3nMlo1M4oxtUL AZKlCHkIzbShP7iA+t8vM9U8kYuCwsehOmbpbI2W2A/3PACJnGrSad8Y/7+eFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692081953; 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=gCddEBXJXnJoXysZXHFiPFe3BP09Uuftw4yZ2BI/wME=; b=UVYxupGxQlEosAP4WWUjSTBJK7Q20s3H5oRoeaFRr6MxxbVlmvW81Uv8Juv7hSIGy2BF57 lSjKD0KUJtPk2vv5JQ+94WlA9IzYvHsj+R7q4bD1MJPzig9k9IlYvwQOno3Xwds85PZG0S AzZkJJvg1WsXo3xHDawrSAKcWpmnSvomgWS3ltYyaM6FMpvsi8FXFiOezemKS/cchLr3FL c50XAa+pr8uBdtVmEbUfGUfPJRNhY5/xoAt+SfgParKKlcc839nyLbvPsPcFFByLf0nJKP KA63qBNMYYqbOu9omciU0D+ANuoV2banXqmwbK71pis5rQxQee0oeATW+e3pQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692081953; a=rsa-sha256; cv=none; b=bZdMsjjwjnnMg3xiFdGqidMNVOfgXFPXGPuW4NWrDyz9ZAAT215oYFGyQpzg1ochxpgrkt B6SuIkral3MuF4ZzlkxH0RbhJAaqpQj0sG+ZWE3xCRnEbm7KbvHRyaaPmurcA992U8Dvr3 gmZfoYdIziJNqjDT7igWhdTiPhXHOUZ3ZIJ+OKJib091Xd5OhXDCSlzuLMGmlM+entQQGN gmolMWrqE7qkXcGPgZXAcAANL/IVLBGDzNQ1Ht+7lVd6RDOB3QolEruhOGRXWcYWY++Q3A DenCTKkmDaTu600qvNW68Ge/O2VDkTPSFlv5buuJYXODpaqvJVA0pR91eKvwRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RQ1xY24k6z10sY; Tue, 15 Aug 2023 06:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37F6jrrU042902; Tue, 15 Aug 2023 06:45:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37F6jrot042900; Tue, 15 Aug 2023 06:45:53 GMT (envelope-from git) Date: Tue, 15 Aug 2023 06:45:53 GMT Message-Id: <202308150645.37F6jrot042900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 81b41b2ef5bf - main - ofw_firmware: Return BUS_PROBE_GENERIC instead of 0 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: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81b41b2ef5bfd571123919e93d37624d53d4f589 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=81b41b2ef5bfd571123919e93d37624d53d4f589 commit 81b41b2ef5bfd571123919e93d37624d53d4f589 Author: Emmanuel Vadot AuthorDate: 2023-08-15 05:59:09 +0000 Commit: Emmanuel Vadot CommitDate: 2023-08-15 06:45:22 +0000 ofw_firmware: Return BUS_PROBE_GENERIC instead of 0 While here make it only probe if the node is directly under the root one. If it's not it's likely a device node named 'firmware' and not the firmware group we're interested in. Suggested by: jhb Sponsored by: Beckhoff Automation GmbH & Co. KG --- sys/dev/ofw/ofw_firmware.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/ofw/ofw_firmware.c b/sys/dev/ofw/ofw_firmware.c index 7d62fc317c1d..8723965f74be 100644 --- a/sys/dev/ofw/ofw_firmware.c +++ b/sys/dev/ofw/ofw_firmware.c @@ -101,16 +101,21 @@ static int ofw_firmware_probe(device_t dev) { const char *name, *compat; + phandle_t root, parent; name = ofw_bus_get_name(dev); if (name == NULL || strcmp(name, "firmware") != 0) return (ENXIO); + parent = OF_parent(ofw_bus_get_node(dev)); + root = OF_finddevice("/"); + if (parent != root) + return (ENXIO); compat = ofw_bus_get_compat(dev); if (compat != NULL) return (ENXIO); device_set_desc(dev, "OFW Firmware Group"); - return (0); + return (BUS_PROBE_GENERIC); } static int