summaryrefslogtreecommitdiffstats
path: root/sys/dev/auxio/auxio.c
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2005-07-10 10:33:00 +0000
committermarius <marius@FreeBSD.org>2005-07-10 10:33:00 +0000
commit05e74e9c36a7cca171b25721e2254f4054ea0ac0 (patch)
treed6113afc3eea6c64cd206013178f867183d7f1dd /sys/dev/auxio/auxio.c
parent3748117ee9bf85920ab6fe0d02395cdfbe211c4c (diff)
downloadFreeBSD-src-05e74e9c36a7cca171b25721e2254f4054ea0ac0.zip
FreeBSD-src-05e74e9c36a7cca171b25721e2254f4054ea0ac0.tar.gz
Switch from trying to allocate up to 8 register banks for the EBus
variant to allocating a fixed set of 5 banks that the EBus variant is documented to have (and also has in reality). Trying to allocate up to 8 banks is a remnant from experiments during the development of this driver. Discussed with: joerg, yongari Reviewed by: yongari Approved by: re (scottl)
Diffstat (limited to 'sys/dev/auxio/auxio.c')
-rw-r--r--sys/dev/auxio/auxio.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/sys/dev/auxio/auxio.c b/sys/dev/auxio/auxio.c
index ee05f64..e98f9b6 100644
--- a/sys/dev/auxio/auxio.c
+++ b/sys/dev/auxio/auxio.c
@@ -95,16 +95,16 @@ __FBSDID("$FreeBSD$");
#define AUXIO_PCIO_FREQ 2
#define AUXIO_PCIO_OSC 3
#define AUXIO_PCIO_TEMP 4
-#define AUXIO_PCIO_MAX 8
+#define AUXIO_PCIO_NREG 5
struct auxio_softc {
struct device *sc_dev;
int sc_nauxio;
- struct resource *sc_res[AUXIO_PCIO_MAX];
- int sc_rid[AUXIO_PCIO_MAX];
- bus_space_tag_t sc_regt[AUXIO_PCIO_MAX];
- bus_space_handle_t sc_regh[AUXIO_PCIO_MAX];
+ struct resource *sc_res[AUXIO_PCIO_NREG];
+ int sc_rid[AUXIO_PCIO_NREG];
+ bus_space_tag_t sc_regt[AUXIO_PCIO_NREG];
+ bus_space_handle_t sc_regh[AUXIO_PCIO_NREG];
struct cdev *sc_led_dev;
u_int32_t sc_led_stat;
@@ -224,26 +224,13 @@ static int
auxio_ebus_attach(device_t dev)
{
struct auxio_softc *sc;
- u_long start, count;
- int i;
sc = device_get_softc(dev);
bzero(sc, sizeof(*sc));
sc->sc_dev = dev;
AUXIO_LOCK_INIT(sc);
- for (i = 0;
- i < AUXIO_PCIO_MAX &&
- bus_get_resource(dev, SYS_RES_MEMORY, i, &start, &count) == 0; i++)
- if (bootverbose)
- device_printf(sc->sc_dev,
- "Got rid %d, start %#lx, count %#lx\n",
- i, start, count);
- if (i < 1) {
- device_printf(dev, "no LED resource\n");
- return (ENXIO);
- }
- sc->sc_nauxio = i;
+ sc->sc_nauxio = AUXIO_PCIO_NREG;
sc->sc_flags = AUXIO_LEDONLY | AUXIO_EBUS;
return(auxio_attach_common(sc));
OpenPOWER on IntegriCloud