Date: Fri, 27 Jul 2007 05:54:30 GMT From: Christopher Davis <loafier@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 124158 for review Message-ID: <200707270554.l6R5sUpx034008@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=124158 Change 124158 by loafier@chrisdsoc on 2007/07/27 05:53:29 Use return value of pci_enable_io() to help determine whether to allocate memory or io ports. Affected files ... .. //depot/projects/soc2007/loafier_busalloc/src/sys/dev/sound/pci/es137x.c#3 edit Differences ... ==== //depot/projects/soc2007/loafier_busalloc/src/sys/dev/sound/pci/es137x.c#3 (text+ko) ==== @@ -1689,7 +1689,6 @@ static int es_pci_attach(device_t dev) { - uint32_t data; struct es_info *es = NULL; int mapped, i, numplay, dac_cfg; char status[SND_STATUSLEN]; @@ -1704,17 +1703,13 @@ mapped = 0; pci_enable_busmaster(dev); - data = pci_read_config(dev, PCIR_COMMAND, 2); - data |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN); - pci_write_config(dev, PCIR_COMMAND, data, 2); - data = pci_read_config(dev, PCIR_COMMAND, 2); - if (mapped == 0 && (data & PCIM_CMD_MEMEN)) { + if (mapped == 0 && pci_enable_io(dev, SYS_RES_MEMORY) == 0) { es->spec = es_res_spec_mem; if (bus_alloc_resources(dev, es->spec, es->res) == 0) mapped++; } - if (mapped == 0 && (data & PCIM_CMD_PORTEN)) { + if (mapped == 0 && pci_enable_io(dev, SYS_RES_IOPORT) == 0) { es->spec = es_res_spec_io; if (bus_alloc_resources(dev, es->spec, es->res) == 0) mapped++;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707270554.l6R5sUpx034008>
