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.
This commit is contained in:
Marcel Moolenaar 2005-10-28 06:27:53 +00:00
parent 17ef9ca46d
commit 3a45066f19
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=151791

View file

@ -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));
}