summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2005-10-28 06:27:53 +0000
committermarcel <marcel@FreeBSD.org>2005-10-28 06:27:53 +0000
commitba5b7dfd1c0443b40ccd847b8fb0002f81dbe991 (patch)
treec7ed5b512070ded038683cb81a96c4d01da516f3 /sys/dev/uart
parentc28ed44e287e7d4a8c44e8c9e82450fa92b414c0 (diff)
downloadFreeBSD-src-ba5b7dfd1c0443b40ccd847b8fb0002f81dbe991.zip
FreeBSD-src-ba5b7dfd1c0443b40ccd847b8fb0002f81dbe991.tar.gz
o Style(9) nits
o Fix typo in comment o s/-100/BUS_PROBE_GENERIC/ o s/err/error/ for consistency o Remove non-applicable comment o Allow uart_bus_probe() to return the predefined BUS_PROBE_* contants. In this case: explicitly test for error > 0.
Diffstat (limited to 'sys/dev/uart')
-rw-r--r--sys/dev/uart/uart_bus_pccard.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/dev/uart/uart_bus_pccard.c b/sys/dev/uart/uart_bus_pccard.c
index ef6ae3e..0189a5f 100644
--- a/sys/dev/uart/uart_bus_pccard.c
+++ b/sys/dev/uart/uart_bus_pccard.c
@@ -64,19 +64,20 @@ static driver_t uart_pccard_driver = {
static int
uart_pccard_probe(device_t dev)
{
- int error = 0;
- u_int32_t fcn = PCCARD_FUNCTION_UNSPEC;
+ int error;
+ uint32_t fcn;
+ fcn = PCCARD_FUNCTION_UNSPEC;
error = pccard_get_function(dev, &fcn);
if (error != 0)
return (error);
/*
* If a serial card, we are likely the right driver. However,
- * some serial cards are better servered by other drivers, so
+ * some serial cards are better serviced by other drivers, so
* allow other drivers to claim it, if they want.
*/
if (fcn == PCCARD_FUNCTION_SERIAL)
- return (-100);
+ return (BUS_PROBE_GENERIC);
return (ENXIO);
}
@@ -85,16 +86,14 @@ static int
uart_pccard_attach(device_t dev)
{
struct uart_softc *sc;
- int err;
+ int error;
sc = device_get_softc(dev);
sc->sc_class = &uart_ns8250_class;
- /* Do not probe IRQ - pccard doesn't turn on the interrupt line */
- /* until bus_setup_intr but how can I do so?*/
- err = uart_bus_probe(dev, 0, 0, 0, 0);
- if (err)
- return (err);
+ error = uart_bus_probe(dev, 0, 0, 0, 0);
+ if (error > 0)
+ return (error);
return (uart_bus_attach(dev));
}
OpenPOWER on IntegriCloud