From nobody Thu Oct 06 14:52:51 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 4MjvYv3FVjz4dmY8; Thu, 6 Oct 2022 14:52:51 +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 4MjvYv2nX3z3MJJ; Thu, 6 Oct 2022 14:52:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665067971; 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=H4Gb5ez4f7TgRFj7Vmqxyl2LU5sps/+aDokoJFI0PkA=; b=h3A/+f5jXei6avJIfEwm8maMkjKy9zcUkP9xL4hd5/7etzFWSFWcAJmC4DIcc6HKroYCP5 RdT4IKMkm8TsAbha0MFWi0ZtQ9BUY9EbZSFUXLIGpM7bfvcdUVPNvd6Ab7B6kxbJphcX7B 2e3DjGKlSe7Et1uHqpz49lWVbABUaq1mDeAqHKqpxTnY1qS5FCitd/w3YxFXWY7RmRNokP JKFUjL0SsqC4Mv6zaJq0RdRt0DmQP6c259fwqDarBIzETibPoJ76nO1kAGRZ4n0z0U3P1a 5tdCmGeKy5JDQoU9TT18Cn71KuZ+QbkRsP0YrwFhKWtzBsSmHPkz/DoxouJ42A== 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 4MjvYv1rqyzHRr; Thu, 6 Oct 2022 14:52:51 +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 296Eqp1C017017; Thu, 6 Oct 2022 14:52:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 296EqpmO017016; Thu, 6 Oct 2022 14:52:51 GMT (envelope-from git) Date: Thu, 6 Oct 2022 14:52:51 GMT Message-Id: <202210061452.296EqpmO017016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Kornel=20Dul=C4=99ba?= Subject: git: 6bdc398832a6 - main - uart_dev_snps: Fix device probing 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: kd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6bdc398832a60f94a2d895f64b5546eec3af2da8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665067971; 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=H4Gb5ez4f7TgRFj7Vmqxyl2LU5sps/+aDokoJFI0PkA=; b=iQbK3u7H8ppuLBVAbpSZVzAjd+fjZ/k6WooTkJivsinaUbIoRKQ96VO96hzcfszvTnAT/k /G/EwdIxNmmElPVCIeYMqkwu03WT/dZkynCsxFfJMIe8frGj2vGa2lsPD4r4HN17XLY1IJ eZ8pd6wZgE8aiI9Zg3evD/0qQeORnoIpnMjtEaM4RwXZjeRNPFrZBL3sm3sfF1bYyaTbjp wN+tyl2k1AI1HB/zZo1s9+ScJc9POYTcl1O9d+YrMSk3Hl0zfKt/lz4fTF4uXxiA4h82lC DSZ8kLZyhOAw/PSykarvY9yAyqdpFuPbzkHxlgQ2ag4E5lNZkPmzfN2UuNE1qQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665067971; a=rsa-sha256; cv=none; b=gysazZ44xWAH+9VCasAioBv0TC3LL/yQEh5JvRnHhNEbdJ9atHejhoeY1bjU9rUAm7lGor fDIOlUDJZNTHiu6D01UfB4Wp747Od8KmENh6UiT3I5rYL297ehtpG3fHyg08+YbP0xsOFg 9mC3KqUUfBXb8QLRG9sTA8BF9FP70PtRu95GV5+3IXb2Bjb5R24bathTx1PFvyRPuj/Gfl ZHYNnO2rBRRnfrHFNK2UY4iVih0znSApAdLzETvR8DCVLI3Tojdwwu63ERtxb4VW/zl/o+ DyqXSyZ3yAoXNTr+hT2YXun2fPhscAUDYEwCQ3ediSeZ4TcO84Ee26W8wh64aA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kd: URL: https://cgit.FreeBSD.org/src/commit/?id=6bdc398832a60f94a2d895f64b5546eec3af2da8 commit 6bdc398832a60f94a2d895f64b5546eec3af2da8 Author: Kornel Dulęba AuthorDate: 2022-10-06 14:25:47 +0000 Commit: Kornel Dulęba CommitDate: 2022-10-06 14:42:51 +0000 uart_dev_snps: Fix device probing The "uart_bus_probe" function is used as a generic part of uart probe logic. It returns a driver priority(negative number) if successful and an error code otherwise. Fix the error checking condition to account for that. Also, while here return "BUS_PROBE_VENDOR", instead of "0". This fixes uart on clearfog pro with recent DT. PR: 266657 Reviewed by: mw Obtained from: Semihalf Differential Revision: https://reviews.freebsd.org/D36880 --- sys/dev/uart/uart_dev_snps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/uart/uart_dev_snps.c b/sys/dev/uart/uart_dev_snps.c index b29fc48e5422..040f0ea00f0e 100644 --- a/sys/dev/uart/uart_dev_snps.c +++ b/sys/dev/uart/uart_dev_snps.c @@ -216,7 +216,7 @@ snps_probe(device_t dev) device_printf(dev, "could not determine frequency\n"); error = uart_bus_probe(dev, (int)shift, (int)iowidth, (int)clock, 0, 0, UART_F_BUSY_DETECT); - if (error != 0) + if (error > 0) return (error); /* XXX uart_bus_probe has changed the softc, so refresh it */ @@ -227,7 +227,7 @@ snps_probe(device_t dev) sc->apb_pclk = apb_pclk; sc->reset = reset; - return (0); + return (BUS_PROBE_VENDOR); } static int