aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKornel Dulęba <kd@FreeBSD.org>2022-10-06 14:25:47 +0000
committerKornel Dulęba <kd@FreeBSD.org>2022-10-06 14:42:51 +0000
commit6bdc398832a60f94a2d895f64b5546eec3af2da8 (patch)
treedfff8164003689faa848548f8b1bfdc64ab9792d
parentfdbd0ba75d99f1909b13a9f9ece5e8c576bd8977 (diff)
downloadsrc-6bdc398832a60f94a2d895f64b5546eec3af2da8.tar.gz
src-6bdc398832a60f94a2d895f64b5546eec3af2da8.zip
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
-rw-r--r--sys/dev/uart/uart_dev_snps.c4
1 files 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