mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
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
This commit is contained in:
parent
fdbd0ba75d
commit
6bdc398832
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue