From 3a45066f19cf6d30fecd6cfb797edee1d0e5f58d Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Fri, 28 Oct 2005 06:27:53 +0000 Subject: [PATCH] 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. --- sys/dev/uart/uart_bus_pccard.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/sys/dev/uart/uart_bus_pccard.c b/sys/dev/uart/uart_bus_pccard.c index ef6ae3eaa354..0189a5f2f01e 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)); }