PERFORCE change 144842 for review

M. Warner Losh imp at bsdimp.com
Thu Jul 24 05:23:14 UTC 2008


In message: <20080713122907.GA63008 at alchemy.franken.de>
            Marius Strobl <marius at alchemy.franken.de> writes:
: On Mon, Jul 07, 2008 at 06:55:17PM +0000, Marcel Moolenaar wrote:
: > http://perforce.freebsd.org/chv.cgi?CH=144842
: > 
: > Change 144842 by marcel at marcel_xcllnt on 2008/07/07 18:55:11
: > 
: > 	ISA_PNP_PROBE() can also return ENOENT.
: > 	So, assume a match when the error is 0, not != ENXIO.
: > 
: > Affected files ...
: > 
: > .. //depot/projects/uart/dev/uart/uart_bus_isa.c#13 edit
: > 
: > Differences ...
: > 
: > ==== //depot/projects/uart/dev/uart/uart_bus_isa.c#13 (text+ko) ====
: > 
: > @@ -170,7 +170,7 @@
: >  	sc = device_get_softc(dev);
: >  
: >  	/* Probe PnP _and_ non-PnP ns8250 here. */
: > -	if (ISA_PNP_PROBE(parent, dev, isa_ns8250_ids) != ENXIO) {
: > +	if (ISA_PNP_PROBE(parent, dev, isa_ns8250_ids) == 0) {
: >  		sc->sc_class = &uart_ns8250_class;
: >  		return (uart_bus_probe(dev, 0, 0, 0, 0));
: >  	}
: 
: Unfortunately, this now no longer probes non-PnP ns8250. You'll
: probably need something like the following to actually probe both:
: 	if (ISA_PNP_PROBE(parent, dev, isa_ns8250_ids) == 0 ||
: 	    isa_get_vendorid(dev) == 0)

Or to save the error like ep does:

	int error = 0;

	/* Check isapnp ids */
	error = ISA_PNP_PROBE(device_get_parent(dev), dev, ep_ids);

	/* If the card had a PnP ID that didn't match any we know about */
	if (error == ENXIO)
		return (error);

	/* If we had some other problem. */
	if (!(error == 0 || error == ENOENT))
		return (error);

...

Warner


More information about the p4-projects mailing list