tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
RFC: device attachment/detachment
Hi,
Drivers attaches in the device tree independent if their attachment
function failed or not. The autoconf framework isn't aware of this,
because the attachment function doesn't return an error code.
dyoung@ started to work on the drivers to detach the drivers
on shutdown/reboot. The drivers' detach function doesn't know if
the attachment failed or not. It only can carefully
check which resource was allocated and which not and free the
allocated ones.
Attached patch modifies the driver's attachment function to
return an error code, zero for success.
I modified all drivers necessary to compile an amd64 GENERIC
kernel plus bwi(4). The intended functional change is in
subr_autoconf.c, there's no intended functional change in the
drivers.
bwi(4) attachment always fails on my machine
due to lack of Draft-N support in a very early support.
W/o attached patch 'drvctl -d bwi0' crashes in various places
due to assumptions even in MI code.
With attached patch, bwi0 detaches:
bwi0 at pci3 dev 0 function 0: Broadcom Wireless
bwi0: interrupting at ioapic0 pin 16
bwi0: bwi_attach
bwi0: bwi_power_on
bwi0: regwin: type 0x800, rev 19, vendor 0x4243
bwi0: BBP id 0x4321, BBP rev 0x3, BBP pkg 0
bwi0: nregwin 5, cap 0x0864000d
bwi0: regwin: type 0x812, rev 12, vendor 0x4243
bwi0: MAC: rev 12
bwi0: regwin: type 0x820, rev 4, vendor 0x4243
bwi0: regwin: type 0x804, rev 13, vendor 0x4243
bwi0: bus regwin already exists
bwi0: regwin: type 0x817, rev 4, vendor 0x4243
bwi0: bwi_power_on
bwi0: clksrc CS_OSC
bwi0: clkfreq min 990000, max 1010000
bwi0: power on delay 3
bwi0: bus rev 4
bwi0: PCIE is enabled
bwi0: card flags 0x3844
bwi0: 0th led, act 91, lowact 0
bwi0: 1th led, act 91, lowact 0
bwi0: 2th led, act 41, lowact 0
bwi0: 3th led, act 41, lowact 0
bwi0: MAC was already disabled
bwi0: PHY is linked
bwi0: PHY type 4, rev 2, ver 5
bwi0: unsupported PHY type 4
bwi0: detached
Christoph
Index: sys/arch/amd64/amd64/mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/amd64/mainbus.c,v
retrieving revision 1.27
diff -u -p -r1.27 mainbus.c
--- sys/arch/amd64/amd64/mainbus.c 17 Apr 2009 21:07:58 -0000 1.27
+++ sys/arch/amd64/amd64/mainbus.c 1 May 2009 16:43:17 -0000
@@ -81,7 +81,7 @@ __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v
*/
int mainbus_match(device_t, cfdata_t, void *);
-void mainbus_attach(device_t, device_t, void *);
+int mainbus_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(mainbus, 0,
mainbus_match, mainbus_attach, NULL, NULL);
@@ -147,7 +147,7 @@ mainbus_match(device_t parent, cfdata_t
/*
* Attach the mainbus.
*/
-void
+int
mainbus_attach(device_t parent, device_t self, void *aux)
{
#if NPCI > 0
@@ -288,6 +288,7 @@ mainbus_attach(device_t parent, device_t
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
int
Index: sys/arch/amd64/conf/GENERIC
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/conf/GENERIC,v
retrieving revision 1.243
diff -u -p -r1.243 GENERIC
--- sys/arch/amd64/conf/GENERIC 27 Apr 2009 12:02:10 -0000 1.243
+++ sys/arch/amd64/conf/GENERIC 1 May 2009 16:43:17 -0000
@@ -618,6 +618,7 @@ atw* at pci? dev ? function ? # ADMtek A
bce* at pci? dev ? function ? # Broadcom 440x 10/100 Ethernet
bge* at pci? dev ? function ? # Broadcom 570x gigabit Ethernet
bnx* at pci? dev ? function ? # Broadcom NetXtremeII gigabit Ethernet
+bwi* at pci? dev ? function ? # Broadcom BCM43xx wireless
dge* at pci? dev ? function ? # Intel 82597 10GbE LR
en* at pci? dev ? function ? # ENI/Adaptec ATM
ep* at pci? dev ? function ? # 3Com 3c59x
Index: sys/arch/x86/isa/clock.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/isa/clock.c,v
retrieving revision 1.32
diff -u -p -r1.32 clock.c
--- sys/arch/x86/isa/clock.c 7 Apr 2009 17:51:46 -0000 1.32
+++ sys/arch/x86/isa/clock.c 1 May 2009 16:43:25 -0000
@@ -165,7 +165,7 @@ __KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.
#include <dev/isa/pcppivar.h>
int sysbeepmatch(device_t, cfdata_t, void *);
-void sysbeepattach(device_t, device_t, void *);
+int sysbeepattach(device_t, device_t, void *);
int sysbeepdetach(device_t, int);
CFATTACH_DECL3_NEW(sysbeep, 0,
@@ -542,7 +542,7 @@ sysbeepmatch(device_t parent, cfdata_t m
return (!ppi_attached);
}
-void
+int
sysbeepattach(device_t parent, device_t self, void *aux)
{
aprint_naive("\n");
@@ -553,6 +553,7 @@ sysbeepattach(device_t parent, device_t
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
int
Index: sys/arch/x86/pci/aapic.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/pci/aapic.c,v
retrieving revision 1.7
diff -u -p -r1.7 aapic.c
--- sys/arch/x86/pci/aapic.c 9 Jul 2008 21:07:55 -0000 1.7
+++ sys/arch/x86/pci/aapic.c 1 May 2009 16:43:25 -0000
@@ -21,7 +21,7 @@ extern int nioapics;
#endif
static int aapic_match(device_t, cfdata_t, void *);
-static void aapic_attach(device_t, device_t, void *);
+static int aapic_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(aapic, 0, aapic_match, aapic_attach, NULL, NULL);
@@ -37,7 +37,7 @@ aapic_match(device_t parent, cfdata_t ma
return (0);
}
-static void
+static int
aapic_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -52,9 +52,9 @@ aapic_attach(device_t parent, device_t s
#if NIOAPIC > 0
if (nioapics == 0)
- return;
+ return ENXIO;
#else
- return;
+ return ENXIO;
#endif
reg = pci_conf_read(pa->pa_pc, pa->pa_tag, AMD8131_IOAPIC_CTL);
@@ -67,4 +67,6 @@ aapic_attach(device_t parent, device_t s
reg = pci_conf_read(pa->pa_pc, tag, AMD8131_PCIX_MISC);
reg &= ~AMD8131_NIOAMODE;
pci_conf_write(pa->pa_pc, tag, AMD8131_PCIX_MISC, reg);
+
+ return 0;
}
Index: sys/arch/x86/pci/amdtemp.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/pci/amdtemp.c,v
retrieving revision 1.7
diff -u -p -r1.7 amdtemp.c
--- sys/arch/x86/pci/amdtemp.c 12 Mar 2009 14:24:17 -0000 1.7
+++ sys/arch/x86/pci/amdtemp.c 1 May 2009 16:43:25 -0000
@@ -157,7 +157,7 @@ struct amdtemp_softc {
static int amdtemp_match(device_t, cfdata_t, void *);
-static void amdtemp_attach(device_t, device_t, void *);
+static int amdtemp_attach(device_t, device_t, void *);
static void amdtemp_k8_init(struct amdtemp_softc *, pcireg_t);
static void amdtemp_k8_setup_sensors(struct amdtemp_softc *, int);
@@ -208,7 +208,7 @@ amdtemp_match(device_t parent, cfdata_t
return 2; /* supercede pchb(4) */
}
-static void
+static int
amdtemp_attach(device_t parent, device_t self, void *aux)
{
struct amdtemp_softc *sc = device_private(self);
@@ -248,7 +248,7 @@ amdtemp_attach(device_t parent, device_t
default:
aprint_normal(", family 0x%x not supported\n",
sc->sc_family);
- return;
+ return ENXIO;
}
aprint_normal("\n");
@@ -307,12 +307,14 @@ amdtemp_attach(device_t parent, device_t
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
- return;
+ return 0;
bad:
kmem_free(sc->sc_sensor, len);
bad2:
sysmon_envsys_destroy(sc->sc_sme);
+
+ return ENXIO;
}
static void
Index: sys/arch/x86/pci/ichlpcib.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/pci/ichlpcib.c,v
retrieving revision 1.17
diff -u -p -r1.17 ichlpcib.c
--- sys/arch/x86/pci/ichlpcib.c 29 Apr 2009 14:55:36 -0000 1.17
+++ sys/arch/x86/pci/ichlpcib.c 1 May 2009 16:43:25 -0000
@@ -96,7 +96,7 @@ struct lpcib_softc {
};
static int lpcibmatch(device_t, cfdata_t, void *);
-static void lpcibattach(device_t, device_t, void *);
+static int lpcibattach(device_t, device_t, void *);
static bool lpcib_suspend(device_t PMF_FN_PROTO);
static bool lpcib_resume(device_t PMF_FN_PROTO);
static bool lpcib_shutdown(device_t, int);
@@ -179,7 +179,7 @@ lpcibmatch(device_t parent, cfdata_t mat
return 0;
}
-static void
+static int
lpcibattach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -207,7 +207,7 @@ lpcibattach(device_t parent, device_t se
if (pci_mapreg_map(pa, LPCIB_PCI_PMBASE, PCI_MAPREG_TYPE_IO, 0,
&sc->sc_iot, &sc->sc_ioh, NULL, NULL)) {
aprint_error_dev(self, "can't map power management i/o space");
- return;
+ return ENXIO;
}
sc->sc_pmcon_orig = pci_conf_read(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag,
@@ -223,14 +223,14 @@ lpcibattach(device_t parent, device_t se
LPCIB_RCBA);
if ((rcba & LPCIB_RCBA_EN) == 0) {
aprint_error_dev(self, "RCBA is not enabled");
- return;
+ return ENXIO;
}
rcba &= ~LPCIB_RCBA_EN;
if (bus_space_map(sc->sc_rcbat, rcba, LPCIB_RCBA_SIZE, 0,
&sc->sc_rcbah)) {
aprint_error_dev(self, "RCBA could not be mapped");
- return;
+ return ENXIO;
}
}
@@ -252,6 +252,7 @@ lpcibattach(device_t parent, device_t se
if (!pmf_device_register1(self, lpcib_suspend, lpcib_resume,
lpcib_shutdown))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static bool
@@ -714,7 +715,7 @@ lpcib_hpet_match(device_t parent, cfdata
return 1;
}
-static void
+static int
lpcib_hpet_attach(device_t parent, device_t self, void *aux)
{
struct hpet_softc *sc = device_private(self);
@@ -729,10 +730,11 @@ lpcib_hpet_attach(device_t parent, devic
&sc->sc_memh)) {
aprint_error_dev(self,
"HPET memory window could not be mapped");
- return;
+ return ENXIO;
}
hpet_attach_subr(self);
+ return 0;
}
CFATTACH_DECL_NEW(ichlpcib_hpet, sizeof(struct hpet_softc), lpcib_hpet_match,
Index: sys/arch/x86/pci/pchb.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/pci/pchb.c,v
retrieving revision 1.18
diff -u -p -r1.18 pchb.c
--- sys/arch/x86/pci/pchb.c 7 Apr 2009 17:52:36 -0000 1.18
+++ sys/arch/x86/pci/pchb.c 1 May 2009 16:43:26 -0000
@@ -72,7 +72,7 @@ __KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.1
#define I82424_BCTL_PCI_BURSTEN 0x02
int pchbmatch(device_t, cfdata_t, void *);
-void pchbattach(device_t, device_t, void *);
+int pchbattach(device_t, device_t, void *);
int pchbdetach(device_t, int);
static bool pchb_resume(device_t PMF_FN_ARGS);
@@ -148,7 +148,7 @@ pchb_get_bus_number(pci_chipset_tag_t pc
return -1;
}
-void
+int
pchbattach(device_t parent, device_t self, void *aux)
{
struct pchb_softc *sc = device_private(self);
@@ -437,6 +437,7 @@ pchbattach(device_t parent, device_t sel
memset(&pba.pba_intrtag, 0, sizeof(pba.pba_intrtag));
config_found_ia(self, "pcibus", &pba, pcibusprint);
}
+ return 0;
}
int
Index: sys/arch/x86/pci/pcib.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/pci/pcib.c,v
retrieving revision 1.8
diff -u -p -r1.8 pcib.c
--- sys/arch/x86/pci/pcib.c 2 Apr 2009 00:09:32 -0000 1.8
+++ sys/arch/x86/pci/pcib.c 1 May 2009 16:43:26 -0000
@@ -50,7 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.8
#include "pcibvar.h"
int pcibmatch(device_t, cfdata_t, void *);
-void pcibattach(device_t, device_t, void *);
+int pcibattach(device_t, device_t, void *);
int pcibdetach(device_t, int);
void pcibchilddet(device_t, device_t);
@@ -183,7 +183,7 @@ pcibmatch(device_t parent, cfdata_t matc
return (0);
}
-void
+int
pcibattach(device_t parent, device_t self, void *aux)
{
struct pcib_softc *sc = device_private(self);
@@ -213,6 +213,7 @@ pcibattach(device_t parent, device_t sel
}
config_defer(self, pcib_callback);
+ return 0;
}
int
Index: sys/arch/x86/pci/pcibvar.h
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/pci/pcibvar.h,v
retrieving revision 1.1
diff -u -p -r1.1 pcibvar.h
--- sys/arch/x86/pci/pcibvar.h 20 Jul 2008 16:50:29 -0000 1.1
+++ sys/arch/x86/pci/pcibvar.h 1 May 2009 16:43:26 -0000
@@ -34,5 +34,5 @@ struct pcib_softc {
pcitag_t sc_tag;
};
-extern void pcibattach(device_t, device_t, void *);
+extern int pcibattach(device_t, device_t, void *);
Index: sys/arch/x86/x86/cpu.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/cpu.c,v
retrieving revision 1.63
diff -u -p -r1.63 cpu.c
--- sys/arch/x86/x86/cpu.c 27 Mar 2009 19:53:19 -0000 1.63
+++ sys/arch/x86/x86/cpu.c 1 May 2009 16:43:27 -0000
@@ -119,7 +119,7 @@ __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.63
#endif
int cpu_match(device_t, cfdata_t, void *);
-void cpu_attach(device_t, device_t, void *);
+int cpu_attach(device_t, device_t, void *);
static bool cpu_suspend(device_t PMF_FN_PROTO);
static bool cpu_resume(device_t PMF_FN_PROTO);
@@ -263,7 +263,7 @@ cpu_vm_init(struct cpu_info *ci)
}
-void
+int
cpu_attach(device_t parent, device_t self, void *aux)
{
struct cpu_softc *sc = device_private(self);
@@ -277,7 +277,7 @@ cpu_attach(device_t parent, device_t sel
if (cpus_attached == ~0) {
aprint_error(": increase MAXCPUS\n");
- return;
+ return ENXIO;
}
/*
@@ -290,7 +290,7 @@ cpu_attach(device_t parent, device_t sel
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self,
"couldn't establish power handler\n");
- return;
+ return ENXIO;
}
aprint_naive(": Application Processor\n");
ptr = (uintptr_t)kmem_alloc(sizeof(*ci) + CACHE_LINE_SIZE - 1,
@@ -339,7 +339,7 @@ cpu_attach(device_t parent, device_t sel
aprint_normal("\n");
aprint_error_dev(self,
"mi_cpu_attach failed with %d\n", error);
- return;
+ return ENXIO;
}
cpu_init_tss(ci);
} else {
@@ -436,6 +436,8 @@ cpu_attach(device_t parent, device_t sel
#endif
);
}
+
+ return 0;
}
/*
Index: sys/arch/x86/x86/ioapic.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/ioapic.c,v
retrieving revision 1.42
diff -u -p -r1.42 ioapic.c
--- sys/arch/x86/x86/ioapic.c 1 May 2009 09:38:24 -0000 1.42
+++ sys/arch/x86/x86/ioapic.c 1 May 2009 16:43:27 -0000
@@ -100,7 +100,7 @@ __KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1
*/
int ioapic_match(device_t, cfdata_t, void *);
-void ioapic_attach(device_t, device_t, void *);
+int ioapic_attach(device_t, device_t, void *);
extern int x86_mem_add_mapping(bus_addr_t, bus_size_t,
int, bus_space_handle_t *); /* XXX XXX */
@@ -257,7 +257,7 @@ ioapic_match(device_t parent, cfdata_t m
/*
* can't use bus_space_xxx as we don't have a bus handle ...
*/
-void
+int
ioapic_attach(device_t parent, device_t self, void *aux)
{
struct ioapic_softc *sc = device_private(self);
@@ -276,7 +276,7 @@ ioapic_attach(device_t parent, device_t
if (ioapic_find(aaa->apic_id) != NULL) {
aprint_error(": duplicate apic id (ignored)\n");
- return;
+ return ENXIO;
}
ioapic_add(sc);
@@ -288,7 +288,7 @@ ioapic_attach(device_t parent, device_t
if (x86_mem_add_mapping(aaa->apic_address, PAGE_SIZE, 0, &bh) != 0) {
aprint_error(": map failed\n");
- return;
+ return ENXIO;
}
sc->sc_reg = (volatile uint32_t *)(bh + IOAPIC_REG);
sc->sc_data = (volatile uint32_t *)(bh + IOAPIC_DATA);
@@ -394,6 +394,7 @@ ioapic_attach(device_t parent, device_t
for (i=0; i<sc->sc_apic_sz; i++)
ioapic_print_redir(sc, "boot", i);
#endif
+ return 0;
}
static void
Index: sys/arch/x86/x86/ipmi.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/ipmi.c,v
retrieving revision 1.33
diff -u -p -r1.33 ipmi.c
--- sys/arch/x86/x86/ipmi.c 24 Apr 2009 17:42:03 -0000 1.33
+++ sys/arch/x86/x86/ipmi.c 1 May 2009 16:43:28 -0000
@@ -186,7 +186,7 @@ int ipmi_watchdog_tickle(struct sysmon_w
int ipmi_intr(void *);
int ipmi_match(device_t, cfdata_t, void *);
-void ipmi_attach(device_t, device_t, void *);
+int ipmi_attach(device_t, device_t, void *);
static int ipmi_detach(device_t, int);
long ipow(long, int);
@@ -1830,7 +1830,7 @@ ipmi_thread(void *cookie)
kthread_exit(0);
}
-void
+int
ipmi_attach(device_t parent, device_t self, void *aux)
{
struct ipmi_softc *sc = device_private(self);
@@ -1842,7 +1842,9 @@ ipmi_attach(device_t parent, device_t se
if (kthread_create(PRI_NONE, 0, NULL, ipmi_thread, self,
&sc->sc_kthread, "ipmi") != 0) {
aprint_error("ipmi: unable to create thread, disabled\n");
+ return ENXIO;
}
+ return 0;
}
static int
Index: sys/dev/audio.c
===================================================================
RCS file: /cvsroot/src/sys/dev/audio.c,v
retrieving revision 1.244
diff -u -p -r1.244 audio.c
--- sys/dev/audio.c 17 Apr 2009 20:04:35 -0000 1.244
+++ sys/dev/audio.c 1 May 2009 16:43:29 -0000
@@ -174,7 +174,7 @@ static void stream_filter_list_set
int audio_set_defaults(struct audio_softc *, u_int);
int audioprobe(device_t, cfdata_t, void *);
-void audioattach(device_t, device_t, void *);
+int audioattach(device_t, device_t, void *);
int audiodetach(device_t, int);
int audioactivate(device_t, enum devact);
@@ -279,7 +279,7 @@ audioprobe(device_t parent, cfdata_t mat
return (sa->type == AUDIODEV_TYPE_AUDIO) ? 1 : 0;
}
-void
+int
audioattach(device_t parent, device_t self, void *aux)
{
struct audio_softc *sc;
@@ -342,14 +342,14 @@ audioattach(device_t parent, device_t se
if (error) {
sc->hw_if = NULL;
aprint_error("audio: could not allocate play buffer\n");
- return;
+ return ENXIO;
}
error = audio_alloc_ring(sc, &sc->sc_rr, AUMODE_RECORD, AU_RING_SIZE);
if (error) {
audio_free_ring(sc, &sc->sc_pr);
sc->hw_if = NULL;
aprint_error("audio: could not allocate record buffer\n");
- return;
+ return ENXIO;
}
sc->sc_lastgain = 128;
@@ -357,7 +357,7 @@ audioattach(device_t parent, device_t se
if ((error = audio_set_defaults(sc, 0))) {
aprint_error("audioattach: audio_set_defaults() failed\n");
sc->hw_if = NULL;
- return;
+ return ENXIO;
}
sc->sc_sih_rd = softint_establish(SOFTINT_SERIAL,
@@ -519,6 +519,7 @@ audioattach(device_t parent, device_t se
#ifdef AUDIO_PM_IDLE
callout_schedule(&sc->sc_idle_counter, audio_idle_timeout * hz);
#endif
+ return 0;
}
int
Index: sys/dev/fss.c
===================================================================
RCS file: /cvsroot/src/sys/dev/fss.c,v
retrieving revision 1.62
diff -u -p -r1.62 fss.c
--- sys/dev/fss.c 13 Jan 2009 13:35:52 -0000 1.62
+++ sys/dev/fss.c 1 May 2009 16:43:29 -0000
@@ -109,7 +109,7 @@ const struct cdevsw fss_cdevsw = {
};
static int fss_match(device_t, cfdata_t, void *);
-static void fss_attach(device_t, device_t, void *);
+static int fss_attach(device_t, device_t, void *);
static int fss_detach(device_t, int);
CFATTACH_DECL_NEW(fss, sizeof(struct fss_softc),
@@ -131,7 +131,7 @@ fss_match(device_t self, cfdata_t cfdata
return 1;
}
-static void
+static int
fss_attach(device_t parent, device_t self, void *aux)
{
struct fss_softc *sc = device_private(self);
@@ -151,6 +151,7 @@ fss_attach(device_t parent, device_t sel
if (fss_num_attached++ == 0)
vfs_hooks_attach(&fss_vfs_hooks);
+ return 0;
}
static int
Index: sys/dev/md.c
===================================================================
RCS file: /cvsroot/src/sys/dev/md.c,v
retrieving revision 1.57
diff -u -p -r1.57 md.c
--- sys/dev/md.c 13 Jan 2009 13:35:52 -0000 1.57
+++ sys/dev/md.c 1 May 2009 16:43:29 -0000
@@ -93,7 +93,7 @@ struct md_softc {
void mdattach(int);
-static void md_attach(device_t, device_t, void *);
+static int md_attach(device_t, device_t, void *);
static dev_type_open(mdopen);
static dev_type_close(mdclose);
@@ -147,7 +147,7 @@ mdattach(int n)
}
}
-static void
+static int
md_attach(device_t parent, device_t self,
void *aux)
{
@@ -173,6 +173,7 @@ md_attach(device_t parent, device_t self
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
/*
Index: sys/dev/midi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/midi.c,v
retrieving revision 1.69
diff -u -p -r1.69 midi.c
--- sys/dev/midi.c 7 Apr 2009 17:54:58 -0000 1.69
+++ sys/dev/midi.c 1 May 2009 16:43:30 -0000
@@ -101,7 +101,7 @@ void midi_softintr_rd(void *);
void midi_softintr_wr(void *);
int midiprobe(device_t, cfdata_t, void *);
-void midiattach(device_t, device_t, void *);
+int midiattach(device_t, device_t, void *);
int mididetach(device_t, int);
int midiactivate(device_t, enum devact);
@@ -136,7 +136,7 @@ midiprobe(device_t parent, cfdata_t matc
return (sa->type == AUDIODEV_TYPE_MIDI);
}
-void
+int
midiattach(device_t parent, device_t self, void *aux)
{
struct midi_softc *sc = device_private(self);
@@ -155,7 +155,7 @@ midiattach(device_t parent, device_t sel
hwp->output == 0 ||
hwp->getinfo == 0) {
printf("midi: missing method\n");
- return;
+ return ENXIO;
}
#endif
@@ -167,6 +167,7 @@ midiattach(device_t parent, device_t sel
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self,
"couldn't establish power handler\n");
+ return 0;
}
int
Index: sys/dev/radio.c
===================================================================
RCS file: /cvsroot/src/sys/dev/radio.c,v
retrieving revision 1.22
diff -u -p -r1.22 radio.c
--- sys/dev/radio.c 9 Jul 2008 13:12:54 -0000 1.22
+++ sys/dev/radio.c 1 May 2009 16:43:30 -0000
@@ -52,7 +52,7 @@ struct radio_softc {
};
static int radioprobe(device_t, cfdata_t, void *);
-static void radioattach(device_t, device_t, void *);
+static int radioattach(device_t, device_t, void *);
static int radioprint(void *, const char *);
static int radiodetach(device_t, int);
static int radioactivate(device_t, enum devact);
@@ -77,7 +77,7 @@ radioprobe(device_t parent, cfdata_t mat
return (1);
}
-static void
+static int
radioattach(device_t parent, device_t self, void *aux)
{
struct radio_softc *sc = (void *)self;
@@ -90,6 +90,7 @@ radioattach(device_t parent, device_t se
sc->hw_if = hwp;
sc->hw_hdl = hdlp;
sc->sc_dev = parent;
+ return 0;
}
static int
Index: sys/dev/video.c
===================================================================
RCS file: /cvsroot/src/sys/dev/video.c,v
retrieving revision 1.20
diff -u -p -r1.20 video.c
--- sys/dev/video.c 14 Mar 2009 00:33:25 -0000 1.20
+++ sys/dev/video.c 1 May 2009 16:43:30 -0000
@@ -187,7 +187,7 @@ struct video_softc {
static int video_print(void *, const char *);
static int video_match(device_t, cfdata_t, void *);
-static void video_attach(device_t, device_t, void *);
+static int video_attach(device_t, device_t, void *);
static int video_detach(device_t, int);
static int video_activate(device_t, enum devact);
@@ -286,7 +286,7 @@ video_match(device_t parent, cfdata_t ma
}
-static void
+static int
video_attach(device_t parent, device_t self, void *aux)
{
struct video_softc *sc;
@@ -314,6 +314,7 @@ video_attach(device_t parent, device_t s
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
Index: sys/dev/vnd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/vnd.c,v
retrieving revision 1.199
diff -u -p -r1.199 vnd.c
--- sys/dev/vnd.c 30 Apr 2009 20:34:08 -0000 1.199
+++ sys/dev/vnd.c 1 May 2009 16:43:30 -0000
@@ -244,7 +244,7 @@ const struct cdevsw vnd_cdevsw = {
};
static int vnd_match(device_t, cfdata_t, void *);
-static void vnd_attach(device_t, device_t, void *);
+static int vnd_attach(device_t, device_t, void *);
static int vnd_detach(device_t, int);
CFATTACH_DECL3_NEW(vnd, sizeof(struct vnd_softc),
@@ -272,7 +272,7 @@ vnd_match(device_t self, cfdata_t cfdata
return 1;
}
-static void
+static int
vnd_attach(device_t parent, device_t self, void *aux)
{
struct vnd_softc *sc = device_private(self);
@@ -285,6 +285,7 @@ vnd_attach(device_t parent, device_t sel
disk_init(&sc->sc_dkdev, device_xname(self), NULL);
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static int
Index: sys/dev/acpi/acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.125
diff -u -p -r1.125 acpi.c
--- sys/dev/acpi/acpi.c 8 Apr 2009 12:39:27 -0000 1.125
+++ sys/dev/acpi/acpi.c 1 May 2009 16:43:31 -0000
@@ -118,7 +118,7 @@ static int acpi_dbgr = 0x00;
static ACPI_TABLE_DESC acpi_initial_tables[128];
static int acpi_match(device_t, struct cfdata *, void *);
-static void acpi_attach(device_t, device_t, void *);
+static int acpi_attach(device_t, device_t, void *);
static void acpi_childdet(device_t, device_t);
static int acpi_detach(device_t, int);
@@ -410,7 +410,7 @@ acpi_childdet(device_t self, device_t ch
* which was required to check for the presence of ACPI),
* and enable the ACPI subsystem.
*/
-static void
+static int
acpi_attach(device_t parent, device_t self, void *aux)
{
struct acpi_softc *sc = device_private(self);
@@ -473,7 +473,7 @@ acpi_attach(device_t parent, device_t se
if (ACPI_FAILURE(rv)) {
aprint_error_dev(self, "unable to enable ACPI: %s\n",
AcpiFormatException(rv));
- return;
+ return ENXIO;
}
acpi_md_callback();
@@ -482,7 +482,7 @@ acpi_attach(device_t parent, device_t se
if (ACPI_FAILURE(rv)) {
aprint_error_dev(self, "unable to enable ACPI: %s\n",
AcpiFormatException(rv));
- return;
+ return ENXIO;
}
/* early EC handler initialization if ECDT table is available */
@@ -493,7 +493,7 @@ acpi_attach(device_t parent, device_t se
aprint_error_dev(self,
"unable to initialize ACPI objects: %s\n",
AcpiFormatException(rv));
- return;
+ return ENXIO;
}
acpi_active = 1;
@@ -532,6 +532,7 @@ acpi_attach(device_t parent, device_t se
if (acpi_dbgr & ACPI_DBGR_RUNNING)
acpi_osd_debugger();
#endif
+ return 0;
}
static int
Index: sys/dev/acpi/acpi_acad.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi_acad.c,v
retrieving revision 1.33
diff -u -p -r1.33 acpi_acad.c
--- sys/dev/acpi/acpi_acad.c 23 Mar 2008 18:38:57 -0000 1.33
+++ sys/dev/acpi/acpi_acad.c 1 May 2009 16:43:31 -0000
@@ -84,7 +84,7 @@ static const char * const acad_hid[] = {
#define AACAD_ISSET(sc, f) ((sc)->sc_flags & (f))
static int acpiacad_match(device_t, struct cfdata *, void *);
-static void acpiacad_attach(device_t, device_t, void *);
+static int acpiacad_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(acpiacad, sizeof(struct acpiacad_softc),
acpiacad_match, acpiacad_attach, NULL, NULL);
@@ -117,7 +117,7 @@ acpiacad_match(device_t parent, struct c
*
* Autoconfiguration `attach' routine.
*/
-static void
+static int
acpiacad_attach(device_t parent, device_t self, void *aux)
{
struct acpiacad_softc *sc = device_private(self);
@@ -134,7 +134,7 @@ acpiacad_attach(device_t parent, device_
sc->sc_smpsw.smpsw_type = PSWITCH_TYPE_ACADAPTER;
if (sysmon_pswitch_register(&sc->sc_smpsw) != 0) {
aprint_error_dev(self, "unable to register with sysmon\n");
- return;
+ return ENXIO;
}
sc->sc_status = -1;
@@ -144,7 +144,7 @@ acpiacad_attach(device_t parent, device_
if (ACPI_FAILURE(rv)) {
aprint_error_dev(self, "unable to register DEVICE and SYSTEM "
"NOTIFY handler: %s\n", AcpiFormatException(rv));
- return;
+ return ENXIO;
}
#ifdef ACPI_ACAD_DEBUG
@@ -156,6 +156,8 @@ acpiacad_attach(device_t parent, device_
aprint_error_dev(self, "couldn't establish power handler\n");
acpiacad_init_envsys(self);
+
+ return 0;
}
/*
Index: sys/dev/acpi/acpi_bat.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi_bat.c,v
retrieving revision 1.69
diff -u -p -r1.69 acpi_bat.c
--- sys/dev/acpi/acpi_bat.c 3 Jun 2008 15:02:31 -0000 1.69
+++ sys/dev/acpi/acpi_bat.c 1 May 2009 16:43:31 -0000
@@ -166,7 +166,7 @@ static const char * const bat_hid[] = {
#define ABAT_ALV_STAT 3 /* battery status is available */
static int acpibat_match(device_t, struct cfdata *, void *);
-static void acpibat_attach(device_t, struct device *, void *);
+static int acpibat_attach(device_t, struct device *, void *);
static bool acpibat_resume(device_t PMF_FN_PROTO);
CFATTACH_DECL_NEW(acpibat, sizeof(struct acpibat_softc),
@@ -226,7 +226,7 @@ acpibat_resume(device_t dv PMF_FN_ARGS)
*
* Autoconfiguration `attach' routine.
*/
-static void
+static int
acpibat_attach(device_t parent, device_t self, void *aux)
{
struct acpibat_softc *sc = device_private(self);
@@ -248,7 +248,7 @@ acpibat_attach(device_t parent, device_t
aprint_error_dev(self,
"unable to register DEVICE/SYSTEM NOTIFY handler: %s\n",
AcpiFormatException(rv));
- return;
+ return ENXIO;
}
#ifdef ACPI_BAT_DEBUG
@@ -259,6 +259,8 @@ acpibat_attach(device_t parent, device_t
aprint_error_dev(self, "couldn't establish power handler\n");
acpibat_init_envsys(self);
+
+ return 0;
}
/*
Index: sys/dev/acpi/acpi_button.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi_button.c,v
retrieving revision 1.25
diff -u -p -r1.25 acpi_button.c
--- sys/dev/acpi/acpi_button.c 9 Dec 2007 20:27:52 -0000 1.25
+++ sys/dev/acpi/acpi_button.c 1 May 2009 16:43:31 -0000
@@ -71,7 +71,7 @@ static const char * const sleep_button_h
#define ACPIBUT_F_VERBOSE 0x01 /* verbose events */
static int acpibut_match(device_t, struct cfdata *, void *);
-static void acpibut_attach(device_t, device_t, void *);
+static int acpibut_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(acpibut, sizeof(struct acpibut_softc),
acpibut_match, acpibut_attach, NULL, NULL);
@@ -106,7 +106,7 @@ acpibut_match(device_t parent, struct cf
*
* Autoconfiguration `attach' routine.
*/
-static void
+static int
acpibut_attach(device_t parent, device_t self, void *aux)
{
struct acpibut_softc *sc = device_private(self);
@@ -133,7 +133,7 @@ acpibut_attach(device_t parent, device_t
if (sysmon_pswitch_register(&sc->sc_smpsw) != 0) {
aprint_error_dev(self, "unable to register with sysmon\n");
- return;
+ return ENXIO;
}
rv = AcpiInstallNotifyHandler(sc->sc_node->ad_handle,
@@ -142,7 +142,7 @@ acpibut_attach(device_t parent, device_t
aprint_error_dev(self,
"unable to register DEVICE NOTIFY handler: %s\n",
AcpiFormatException(rv));
- return;
+ return ENXIO;
}
acpi_set_wake_gpe(sc->sc_node->ad_handle);
@@ -154,6 +154,8 @@ acpibut_attach(device_t parent, device_t
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+
+ return 0;
}
/*
Index: sys/dev/acpi/acpi_ec.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi_ec.c,v
retrieving revision 1.54
diff -u -p -r1.54 acpi_ec.c
--- sys/dev/acpi/acpi_ec.c 28 Feb 2009 19:40:23 -0000 1.54
+++ sys/dev/acpi/acpi_ec.c 1 May 2009 16:43:31 -0000
@@ -140,12 +140,12 @@ struct acpiec_softc {
};
static int acpiecdt_match(device_t, struct cfdata *, void *);
-static void acpiecdt_attach(device_t, device_t, void *);
+static int acpiecdt_attach(device_t, device_t, void *);
static int acpiec_match(device_t, struct cfdata *, void *);
-static void acpiec_attach(device_t, device_t, void *);
+static int acpiec_attach(device_t, device_t, void *);
-static void acpiec_common_attach(device_t, device_t, ACPI_HANDLE,
+static int acpiec_common_attach(device_t, device_t, ACPI_HANDLE,
bus_addr_t, bus_addr_t, ACPI_HANDLE, uint8_t);
static bool acpiec_resume(device_t PMF_FN_PROTO);
@@ -218,7 +218,7 @@ acpiecdt_match(device_t parent, struct c
return 0;
}
-static void
+static int
acpiecdt_attach(device_t parent, device_t self, void *aux)
{
ACPI_HANDLE ec_handle;
@@ -231,7 +231,7 @@ acpiecdt_attach(device_t parent, device_
aprint_naive("\n");
aprint_normal(": ACPI Embedded Controller via ECDT\n");
- acpiec_common_attach(parent, self, ec_handle, cmd_reg, data_reg,
+ return acpiec_common_attach(parent, self, ec_handle, cmd_reg, data_reg,
NULL, gpebit);
}
@@ -246,7 +246,7 @@ acpiec_match(device_t parent, struct cfd
return acpi_match_hid(aa->aa_node->ad_devinfo, ec_hid);
}
-static void
+static int
acpiec_attach(device_t parent, device_t self, void *aux)
{
struct acpi_attach_args *aa = aux;
@@ -261,19 +261,19 @@ acpiec_attach(device_t parent, device_t
aprint_normal(": using %s\n", device_xname(ec_singleton));
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power
handler\n");
- return;
+ return ENXIO;
}
if (!acpiec_parse_gpe_package(self, aa->aa_node->ad_handle,
&gpe_handle, &gpebit))
- return;
+ return ENXIO;
rv = acpi_resource_parse(self, aa->aa_node->ad_handle, "_CRS",
&ec_res, &acpi_resource_parse_ops_default);
if (rv != AE_OK) {
aprint_error_dev(self, "resource parsing failed: %s\n",
AcpiFormatException(rv));
- return;
+ return ENXIO;
}
if ((io0 = acpi_res_io(&ec_res, 0)) == NULL) {
@@ -285,14 +285,16 @@ acpiec_attach(device_t parent, device_t
goto free_res;
}
- acpiec_common_attach(parent, self, aa->aa_node->ad_handle,
+ rv = acpiec_common_attach(parent, self, aa->aa_node->ad_handle,
io1->ar_base, io0->ar_base, gpe_handle, gpebit);
free_res:
acpi_resource_cleanup(&ec_res);
+
+ return rv;
}
-static void
+static int
acpiec_common_attach(device_t parent, device_t self,
ACPI_HANDLE ec_handle, bus_addr_t cmd_reg, bus_addr_t data_reg,
ACPI_HANDLE gpe_handle, uint8_t gpebit)
@@ -314,7 +316,7 @@ acpiec_common_attach(device_t parent, de
if (bus_space_map(sc->sc_data_st, data_reg, 1, 0,
&sc->sc_data_sh) != 0) {
aprint_error_dev(self, "unable to map data register\n");
- return;
+ return ENXIO;
}
if (bus_space_map(sc->sc_csr_st, cmd_reg, 1, 0, &sc->sc_csr_sh) != 0) {
@@ -380,7 +382,7 @@ acpiec_common_attach(device_t parent, de
if (!pmf_device_register(self, acpiec_suspend, acpiec_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
- return;
+ return 0;
post_csr_map:
(void)AcpiRemoveGpeHandler(sc->sc_gpeh, sc->sc_gpebit,
@@ -390,6 +392,8 @@ post_csr_map:
bus_space_unmap(sc->sc_csr_st, sc->sc_csr_sh, 1);
post_data_map:
bus_space_unmap(sc->sc_data_st, sc->sc_data_sh, 1);
+
+ return ENXIO;
}
static bool
Index: sys/dev/acpi/acpi_lid.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi_lid.c,v
retrieving revision 1.26
diff -u -p -r1.26 acpi_lid.c
--- sys/dev/acpi/acpi_lid.c 15 Jul 2008 16:19:37 -0000 1.26
+++ sys/dev/acpi/acpi_lid.c 1 May 2009 16:43:31 -0000
@@ -63,7 +63,7 @@ static const char * const lid_hid[] = {
};
static int acpilid_match(device_t, cfdata_t, void *);
-static void acpilid_attach(device_t, device_t, void *);
+static int acpilid_attach(device_t, device_t, void *);
static int acpilid_detach(device_t, int);
CFATTACH_DECL_NEW(acpilid, sizeof(struct acpilid_softc),
@@ -96,7 +96,7 @@ acpilid_match(device_t parent, cfdata_t
*
* Autoconfiguration `attach' routine.
*/
-static void
+static int
acpilid_attach(device_t parent, device_t self, void *aux)
{
struct acpilid_softc *sc = device_private(self);
@@ -112,7 +112,7 @@ acpilid_attach(device_t parent, device_t
sc->sc_smpsw.smpsw_type = PSWITCH_TYPE_LID;
if (sysmon_pswitch_register(&sc->sc_smpsw) != 0) {
aprint_error_dev(self, "unable to register with sysmon\n");
- return;
+ return ENXIO;
}
rv = AcpiInstallNotifyHandler(sc->sc_node->ad_handle,
@@ -121,13 +121,15 @@ acpilid_attach(device_t parent, device_t
aprint_error_dev(self,
"unable to register DEVICE NOTIFY handler: %s\n",
AcpiFormatException(rv));
- return;
+ return ENXIO;
}
acpi_set_wake_gpe(sc->sc_node->ad_handle);
if (!pmf_device_register(self, acpilid_suspend, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+
+ return 0;
}
static int
Index: sys/dev/acpi/acpi_tz.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi_tz.c,v
retrieving revision 1.39
diff -u -p -r1.39 acpi_tz.c
--- sys/dev/acpi/acpi_tz.c 9 Nov 2008 13:54:06 -0000 1.39
+++ sys/dev/acpi/acpi_tz.c 1 May 2009 16:43:31 -0000
@@ -69,7 +69,7 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v
#define ATZ_SENSOR_TEMP 0 /* thermal zone temperature */
static int acpitz_match(device_t, cfdata_t, void *);
-static void acpitz_attach(device_t, device_t, void *);
+static int acpitz_attach(device_t, device_t, void *);
/*
* ACPI Temperature Zone information. Note all temperatures are reported
@@ -150,7 +150,7 @@ acpitz_match(device_t parent, cfdata_t m
/*
* acpitz_attach: autoconf(9) attach routine
*/
-static void
+static int
acpitz_attach(device_t parent, device_t self, void *aux)
{
struct acpitz_softc *sc = device_private(self);
@@ -191,7 +191,7 @@ acpitz_attach(device_t parent, device_t
if (ACPI_FAILURE(rv)) {
aprint_error(": unable to install SYSTEM NOTIFY handler: %s\n",
AcpiFormatException(rv));
- return;
+ return ENXIO;
}
callout_init(&sc->sc_callout, CALLOUT_MPSAFE);
@@ -203,6 +203,8 @@ acpitz_attach(device_t parent, device_t
aprint_error(": couldn't establish power handler\n");
callout_schedule(&sc->sc_callout, sc->sc_zone.tzp * hz / 10);
+
+ return 0;
}
static void
Index: sys/dev/acpi/aiboost.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/aiboost.c,v
retrieving revision 1.25
diff -u -p -r1.25 aiboost.c
--- sys/dev/acpi/aiboost.c 20 May 2008 14:46:31 -0000 1.25
+++ sys/dev/acpi/aiboost.c 1 May 2009 16:43:31 -0000
@@ -79,7 +79,7 @@ static void aiboost_refresh_sensors(stru
/* autoconf(9) glue */
static int aiboost_acpi_match(device_t, struct cfdata *, void *);
-static void aiboost_acpi_attach(device_t, device_t, void *);
+static int aiboost_acpi_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(aiboost, sizeof(struct aiboost_softc), aiboost_acpi_match,
aiboost_acpi_attach, NULL, NULL);
@@ -104,7 +104,7 @@ aiboost_acpi_match(device_t parent, stru
return acpi_match_hid(aa->aa_node->ad_devinfo, aiboost_acpi_ids);
}
-static void
+static int
aiboost_acpi_attach(device_t parent, device_t self, void *aux)
{
struct aiboost_softc *sc = device_private(self);
@@ -122,13 +122,13 @@ aiboost_acpi_attach(device_t parent, dev
aprint_normal_dev(self, "ASUS AI Boost Hardware monitor\n");
if (ACPI_FAILURE(aiboost_getcomp(handl, "TSIF", &sc->sc_aitemp)))
- return;
+ return ENXIO;
if (ACPI_FAILURE(aiboost_getcomp(handl, "VSIF", &sc->sc_aivolt)))
- return;
+ return ENXIO;
if (ACPI_FAILURE(aiboost_getcomp(handl, "FSIF", &sc->sc_aifan)))
- return;
+ return ENXIO;
mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_NONE);
/* Initialize sensors */
@@ -171,13 +171,15 @@ aiboost_acpi_attach(device_t parent, dev
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
- return;
+ return 0;
bad:
kmem_free(sc->sc_sensor, len);
bad2:
sysmon_envsys_destroy(sc->sc_sme);
mutex_destroy(&sc->sc_mtx);
+
+ return ENXIO;
}
#define COPYDESCR(x, y) \
Index: sys/dev/acpi/asus_acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/asus_acpi.c,v
retrieving revision 1.6
diff -u -p -r1.6 asus_acpi.c
--- sys/dev/acpi/asus_acpi.c 21 Sep 2008 21:15:28 -0000 1.6
+++ sys/dev/acpi/asus_acpi.c 1 May 2009 16:43:31 -0000
@@ -72,7 +72,7 @@ typedef struct asus_softc {
#define ASUS_METHOD_PBLS "PBLS"
static int asus_match(device_t, cfdata_t, void *);
-static void asus_attach(device_t, device_t, void *);
+static int asus_attach(device_t, device_t, void *);
static void asus_notify_handler(ACPI_HANDLE, UINT32, void *);
@@ -99,7 +99,7 @@ asus_match(device_t parent, cfdata_t mat
return acpi_match_hid(aa->aa_node->ad_devinfo, asus_ids);
}
-static void
+static int
asus_attach(device_t parent, device_t self, void *opaque)
{
asus_softc_t *sc = device_private(self);
@@ -132,6 +132,7 @@ asus_attach(device_t parent, device_t se
if (!pmf_device_register(self, asus_suspend, asus_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static void
Index: sys/dev/acpi/attimer_acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/attimer_acpi.c,v
retrieving revision 1.13
diff -u -p -r1.13 attimer_acpi.c
--- sys/dev/acpi/attimer_acpi.c 7 Apr 2009 17:59:18 -0000 1.13
+++ sys/dev/acpi/attimer_acpi.c 1 May 2009 16:43:31 -0000
@@ -77,7 +77,7 @@ __KERNEL_RCSID(0, "$NetBSD: attimer_acpi
#include <dev/ic/attimervar.h>
static int attimer_acpi_match(device_t, cfdata_t, void *);
-static void attimer_acpi_attach(device_t, device_t, void *);
+static int attimer_acpi_attach(device_t, device_t, void *);
CFATTACH_DECL3_NEW(attimer_acpi, sizeof(struct attimer_softc),
attimer_acpi_match, attimer_acpi_attach, attimer_detach, NULL, NULL, NULL,
@@ -109,7 +109,7 @@ attimer_acpi_match(device_t parent, cfda
/*
* attimer_acpi_attach: autoconf(9) attach routine
*/
-static void
+static int
attimer_acpi_attach(device_t parent, device_t self, void *aux)
{
struct attimer_softc *sc = device_private(self);
@@ -117,6 +117,7 @@ attimer_acpi_attach(device_t parent, dev
struct acpi_resources res;
struct acpi_io *io;
ACPI_STATUS rv;
+ int error = 0;
sc->sc_dev = self;
@@ -124,13 +125,14 @@ attimer_acpi_attach(device_t parent, dev
rv = acpi_resource_parse(sc->sc_dev, aa->aa_node->ad_handle, "_CRS",
&res, &acpi_resource_parse_ops_default);
if (ACPI_FAILURE(rv))
- return;
+ return ENXIO;
/* find our i/o registers */
io = acpi_res_io(&res, 0);
if (io == NULL) {
aprint_error_dev(self,
"unable to find i/o register resource\n");
+ error = ENXIO;
goto out;
}
@@ -139,6 +141,7 @@ attimer_acpi_attach(device_t parent, dev
if (bus_space_map(sc->sc_iot, io->ar_base, sc->sc_size,
0, &sc->sc_ioh) != 0) {
aprint_error_dev(self, "can't map i/o space\n");
+ error = ENXIO;
goto out;
}
@@ -146,4 +149,5 @@ attimer_acpi_attach(device_t parent, dev
out:
acpi_resource_cleanup(&res);
+ return error;
}
Index: sys/dev/acpi/dalb_acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/dalb_acpi.c,v
retrieving revision 1.2
diff -u -p -r1.2 dalb_acpi.c
--- sys/dev/acpi/dalb_acpi.c 1 Jun 2008 23:35:18 -0000 1.2
+++ sys/dev/acpi/dalb_acpi.c 1 May 2009 16:43:31 -0000
@@ -63,7 +63,7 @@ struct acpi_dalb_softc {
};
static int acpi_dalb_match(device_t, cfdata_t, void *);
-static void acpi_dalb_attach(device_t, device_t, void *);
+static int acpi_dalb_attach(device_t, device_t, void *);
static void acpi_dalb_notify_handler(ACPI_HANDLE, UINT32, void *);
static bool acpi_dalb_resume(device_t PMF_FN_PROTO);
@@ -159,7 +159,7 @@ out:
AcpiOsFree(ret.Pointer);
}
-static void
+static int
acpi_dalb_attach(device_t parent, device_t self, void *aux)
{
struct acpi_dalb_softc *sc = device_private(self);
@@ -187,6 +187,7 @@ acpi_dalb_attach(device_t parent, device
if (!pmf_device_register(self, NULL, acpi_dalb_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static void
Index: sys/dev/acpi/hpet_acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/hpet_acpi.c,v
retrieving revision 1.4
diff -u -p -r1.4 hpet_acpi.c
--- sys/dev/acpi/hpet_acpi.c 17 Feb 2009 12:46:01 -0000 1.4
+++ sys/dev/acpi/hpet_acpi.c 1 May 2009 16:43:31 -0000
@@ -48,7 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: hpet_acpi.c,
#include <dev/ic/hpetvar.h>
static int hpet_acpi_match(device_t, cfdata_t, void *);
-static void hpet_acpi_attach(device_t, device_t, void *);
+static int hpet_acpi_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(hpet_acpi, sizeof(struct hpet_softc), hpet_acpi_match,
@@ -77,26 +77,27 @@ hpet_acpi_match(device_t parent, cfdata_
return acpi_match_hid(aa->aa_node->ad_devinfo, hpet_acpi_ids);
}
-static void
+static int
hpet_acpi_attach(device_t parent, device_t self, void *aux)
{
struct hpet_softc *sc = device_private(self);
struct acpi_attach_args *aa = aux;
struct acpi_resources res;
struct acpi_mem *mem;
- ACPI_STATUS rv;
+ ACPI_STATUS rv = 0;
/* parse resources */
rv = acpi_resource_parse(self, aa->aa_node->ad_handle, "_CRS",
&res, &acpi_resource_parse_ops_default);
if (ACPI_FAILURE(rv))
- return;
+ return ENXIO;
/* find our mem registers */
mem = acpi_res_mem(&res, 0);
if (mem == NULL) {
aprint_error_dev(self,
"unable to find mem register resource\n");
+ rv = ENXIO;
goto out;
}
@@ -104,6 +105,7 @@ hpet_acpi_attach(device_t parent, device
if (bus_space_map(sc->sc_memt, mem->ar_base, mem->ar_length,
0, &sc->sc_memh)) {
aprint_error_dev(self, "can't map mem space\n");
+ rv = ENXIO;
goto out;
}
@@ -111,4 +113,5 @@ hpet_acpi_attach(device_t parent, device
out:
acpi_resource_cleanup(&res);
+ return 0;
}
Index: sys/dev/acpi/hpqlb_acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/hpqlb_acpi.c,v
retrieving revision 1.2
diff -u -p -r1.2 hpqlb_acpi.c
--- sys/dev/acpi/hpqlb_acpi.c 2 May 2008 01:53:33 -0000 1.2
+++ sys/dev/acpi/hpqlb_acpi.c 1 May 2009 16:43:31 -0000
@@ -87,7 +87,7 @@ struct hpqlb_softc {
#define HP_QLB_ChasisOpen 0xe3
static int hpqlb_match(device_t, cfdata_t, void *);
-static void hpqlb_attach(device_t, device_t, void *);
+static int hpqlb_attach(device_t, device_t, void *);
static int hpqlb_finalize(device_t);
static int hpqlb_hotkey_handler(struct wskbd_softc *, void *, u_int, int);
@@ -115,7 +115,7 @@ hpqlb_match(device_t parent, cfdata_t ma
return acpi_match_hid(aa->aa_node->ad_devinfo, hpqlb_ids);
}
-static void
+static int
hpqlb_attach(device_t parent, device_t self, void *opaque)
{
struct hpqlb_softc *sc = device_private(self);
@@ -153,6 +153,7 @@ hpqlb_attach(device_t parent, device_t s
if (!pmf_device_register(self, NULL, hpqlb_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static int
Index: sys/dev/acpi/joy_acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/joy_acpi.c,v
retrieving revision 1.9
diff -u -p -r1.9 joy_acpi.c
--- sys/dev/acpi/joy_acpi.c 17 Feb 2009 12:46:01 -0000 1.9
+++ sys/dev/acpi/joy_acpi.c 1 May 2009 16:43:31 -0000
@@ -48,7 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: joy_acpi.c,v
#include <dev/ic/joyvar.h>
static int joy_acpi_match(device_t, cfdata_t, void *);
-static void joy_acpi_attach(device_t, device_t, void *);
+static int joy_acpi_attach(device_t, device_t, void *);
struct joy_acpi_softc {
struct joy_softc sc_joy;
@@ -83,7 +83,7 @@ joy_acpi_match(device_t parent, cfdata_t
/*
* joy_acpi_attach: autoconf(9) attach routine
*/
-static void
+static int
joy_acpi_attach(device_t parent, device_t self, void *aux)
{
struct joy_acpi_softc *asc = device_private(self);
@@ -91,7 +91,7 @@ joy_acpi_attach(device_t parent, device_
struct acpi_attach_args *aa = aux;
struct acpi_resources res;
struct acpi_io *io;
- ACPI_STATUS rv;
+ ACPI_STATUS rv = 0;
sc->sc_dev = self;
@@ -99,13 +99,14 @@ joy_acpi_attach(device_t parent, device_
rv = acpi_resource_parse(sc->sc_dev, aa->aa_node->ad_handle, "_CRS",
&res, &acpi_resource_parse_ops_default);
if (ACPI_FAILURE(rv))
- return;
+ return ENXIO;
/* find our i/o registers */
io = acpi_res_io(&res, 0);
if (io == NULL) {
aprint_error_dev(self,
"unable to find i/o register resource\n");
+ rv = ENXIO;
goto out;
}
@@ -113,6 +114,7 @@ joy_acpi_attach(device_t parent, device_
if (bus_space_map(sc->sc_iot, io->ar_base, io->ar_length,
0, &sc->sc_ioh)) {
aprint_error_dev(self, "can't map i/o space\n");
+ rv = ENXIO;
goto out;
}
@@ -120,4 +122,5 @@ joy_acpi_attach(device_t parent, device_
out:
acpi_resource_cleanup(&res);
+ return rv;
}
Index: sys/dev/acpi/mpu_acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/mpu_acpi.c,v
retrieving revision 1.9
diff -u -p -r1.9 mpu_acpi.c
--- sys/dev/acpi/mpu_acpi.c 17 Feb 2009 12:46:01 -0000 1.9
+++ sys/dev/acpi/mpu_acpi.c 1 May 2009 16:43:31 -0000
@@ -52,7 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: mpu_acpi.c,v
#include <dev/ic/mpuvar.h>
static int mpu_acpi_match(device_t, cfdata_t, void *);
-static void mpu_acpi_attach(device_t, device_t, void *);
+static int mpu_acpi_attach(device_t, device_t, void *);
struct mpu_acpi_softc {
struct mpu_softc sc_mpu;
@@ -87,7 +87,7 @@ mpu_acpi_match(device_t parent, cfdata_t
/*
* mpu_acpi_attach: autoconf(9) attach routine
*/
-static void
+static int
mpu_acpi_attach(device_t parent, device_t self, void *aux)
{
struct mpu_acpi_softc *asc = device_private(self);
@@ -96,19 +96,20 @@ mpu_acpi_attach(device_t parent, device_
struct acpi_resources res;
struct acpi_io *io;
struct acpi_irq *irq;
- ACPI_STATUS rv;
+ ACPI_STATUS rv = 0;
/* parse resources */
rv = acpi_resource_parse(self, aa->aa_node->ad_handle, "_CRS",
&res, &acpi_resource_parse_ops_default);
if (ACPI_FAILURE(rv))
- return;
+ return ENXIO;
/* find our i/o registers */
io = acpi_res_io(&res, 0);
if (io == NULL) {
aprint_error_dev(self,
"unable to find i/o register resource\n");
+ rv = ENXIO;
goto out;
}
@@ -116,12 +117,14 @@ mpu_acpi_attach(device_t parent, device_
irq = acpi_res_irq(&res, 0);
if (irq == NULL) {
aprint_error_dev(self, "unable to find irq resource\n");
+ rv = ENXIO;
goto out;
}
sc->iot = aa->aa_iot;
if (bus_space_map(sc->iot, io->ar_base, io->ar_length, 0, &sc->ioh)) {
aprint_error_dev(self, "can't map i/o space\n");
+ rv = ENXIO;
goto out;
}
@@ -135,4 +138,5 @@ mpu_acpi_attach(device_t parent, device_
out:
acpi_resource_cleanup(&res);
+ return rv;
}
Index: sys/dev/acpi/pckbc_acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/pckbc_acpi.c,v
retrieving revision 1.31
diff -u -p -r1.31 pckbc_acpi.c
--- sys/dev/acpi/pckbc_acpi.c 17 Feb 2009 12:46:01 -0000 1.31
+++ sys/dev/acpi/pckbc_acpi.c 1 May 2009 16:43:31 -0000
@@ -63,7 +63,7 @@ __KERNEL_RCSID(0, "$NetBSD: pckbc_acpi.c
#include <dev/acpi/acpivar.h>
static int pckbc_acpi_match(device_t, cfdata_t, void *);
-static void pckbc_acpi_attach(device_t, device_t, void *);
+static int pckbc_acpi_attach(device_t, device_t, void *);
struct pckbc_acpi_softc {
struct pckbc_softc sc_pckbc;
@@ -127,7 +127,7 @@ pckbc_acpi_match(device_t parent, cfdata
return 0;
}
-static void
+static int
pckbc_acpi_attach(device_t parent, device_t self, void *aux)
{
struct pckbc_acpi_softc *psc = device_private(self);
@@ -139,7 +139,7 @@ pckbc_acpi_attach(device_t parent, devic
struct acpi_resources res;
struct acpi_io *io0, *io1, *ioswap;
struct acpi_irq *irq;
- ACPI_STATUS rv;
+ ACPI_STATUS rv = 0;
sc->sc_dv = self;
psc->sc_ic = aa->aa_ic;
@@ -161,12 +161,13 @@ pckbc_acpi_attach(device_t parent, devic
rv = acpi_resource_parse(sc->sc_dv, aa->aa_node->ad_handle, "_CRS",
&res, &acpi_resource_parse_ops_default);
if (ACPI_FAILURE(rv))
- return;
+ return ENXIO;
/* find our IRQ */
irq = acpi_res_irq(&res, 0);
if (irq == NULL) {
aprint_error_dev(self, "unable to find irq resource\n");
+ rv = ENXIO;
goto out;
}
psc->sc_irq = irq->ar_irq;
@@ -183,6 +184,7 @@ pckbc_acpi_attach(device_t parent, devic
if (io0 == NULL || io1 == NULL) {
aprint_error_dev(self,
"unable to find i/o resources\n");
+ rv = ENXIO;
goto out;
}
@@ -232,6 +234,7 @@ pckbc_acpi_attach(device_t parent, devic
aprint_error_dev(self, "couldn't establish power handler\n");
out:
acpi_resource_cleanup(&res);
+ return rv;
}
static void
Index: sys/dev/acpi/pcppi_acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/pcppi_acpi.c,v
retrieving revision 1.11
diff -u -p -r1.11 pcppi_acpi.c
--- sys/dev/acpi/pcppi_acpi.c 17 Feb 2009 12:46:01 -0000 1.11
+++ sys/dev/acpi/pcppi_acpi.c 1 May 2009 16:43:31 -0000
@@ -48,7 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: pcppi_acpi.c
#include <dev/isa/pcppivar.h>
static int pcppi_acpi_match(device_t, cfdata_t, void *);
-static void pcppi_acpi_attach(device_t, device_t, void *);
+static int pcppi_acpi_attach(device_t, device_t, void *);
struct pcppi_acpi_softc {
struct pcppi_softc sc_pcppi;
@@ -83,7 +83,7 @@ pcppi_acpi_match(device_t parent, cfdata
/*
* pcppi_acpi_attach: autoconf(9) attach routine
*/
-static void
+static int
pcppi_acpi_attach(device_t parent, device_t self, void *aux)
{
struct pcppi_acpi_softc *asc = device_private(self);
@@ -91,7 +91,7 @@ pcppi_acpi_attach(device_t parent, devic
struct acpi_attach_args *aa = aux;
struct acpi_resources res;
struct acpi_io *io;
- ACPI_STATUS rv;
+ ACPI_STATUS rv = 0;
sc->sc_dv = self;
@@ -99,13 +99,14 @@ pcppi_acpi_attach(device_t parent, devic
rv = acpi_resource_parse(sc->sc_dv, aa->aa_node->ad_handle, "_CRS",
&res, &acpi_resource_parse_ops_default);
if (ACPI_FAILURE(rv))
- return;
+ return ENXIO;
/* find our i/o registers */
io = acpi_res_io(&res, 0);
if (io == NULL) {
aprint_error_dev(self,
"unable to find i/o register resource\n");
+ rv = ENXIO;
goto out;
}
@@ -114,6 +115,7 @@ pcppi_acpi_attach(device_t parent, devic
if (bus_space_map(sc->sc_iot, io->ar_base, sc->sc_size,
0, &sc->sc_ppi_ioh)) {
aprint_error_dev(self, "can't map i/o space\n");
+ rv = ENXIO;
goto out;
}
@@ -121,4 +123,5 @@ pcppi_acpi_attach(device_t parent, devic
out:
acpi_resource_cleanup(&res);
+ return rv;
}
Index: sys/dev/acpi/sony_acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/sony_acpi.c,v
retrieving revision 1.7
diff -u -p -r1.7 sony_acpi.c
--- sys/dev/acpi/sony_acpi.c 1 May 2008 16:06:41 -0000 1.7
+++ sys/dev/acpi/sony_acpi.c 1 May 2009 16:43:31 -0000
@@ -83,7 +83,7 @@ static const char * const sony_acpi_ids[
};
static int sony_acpi_match(device_t, cfdata_t, void *);
-static void sony_acpi_attach(device_t, device_t, void *);
+static int sony_acpi_attach(device_t, device_t, void *);
static ACPI_STATUS sony_acpi_eval_set_integer(ACPI_HANDLE, const char *,
ACPI_INTEGER, ACPI_INTEGER *);
static void sony_acpi_quirk_setup(struct sony_acpi_softc *);
@@ -236,7 +236,7 @@ sony_acpi_eval_set_integer(ACPI_HANDLE h
return rv;
}
-static void
+static int
sony_acpi_attach(device_t parent, device_t self, void *aux)
{
struct sony_acpi_softc *sc = device_private(self);
@@ -309,6 +309,7 @@ sony_acpi_attach(device_t parent, device
if (!pmf_event_register(self, PMFE_DISPLAY_BRIGHTNESS_DOWN,
sony_acpi_brightness_down, true))
aprint_error_dev(self, "couldn't register BRIGHTNESS DOWN
handler\n");
+ return 0;
}
static void
Index: sys/dev/acpi/thinkpad_acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/thinkpad_acpi.c,v
retrieving revision 1.18
diff -u -p -r1.18 thinkpad_acpi.c
--- sys/dev/acpi/thinkpad_acpi.c 17 Feb 2009 12:30:31 -0000 1.18
+++ sys/dev/acpi/thinkpad_acpi.c 1 May 2009 16:43:31 -0000
@@ -108,7 +108,7 @@ typedef struct thinkpad_softc {
(THINKPAD_DISPLAY_LCD | THINKPAD_DISPLAY_CRT | THINKPAD_DISPLAY_DVI)
static int thinkpad_match(device_t, struct cfdata *, void *);
-static void thinkpad_attach(device_t, device_t, void *);
+static int thinkpad_attach(device_t, device_t, void *);
static ACPI_STATUS thinkpad_mask_init(thinkpad_softc_t *, uint32_t);
static void thinkpad_notify_handler(ACPI_HANDLE, UINT32, void *);
@@ -159,14 +159,14 @@ thinkpad_match(device_t parent, struct c
return 1;
}
-static void
+static int
thinkpad_attach(device_t parent, device_t self, void *opaque)
{
thinkpad_softc_t *sc = device_private(self);
struct acpi_attach_args *aa = (struct acpi_attach_args *)opaque;
struct sysmon_pswitch *psw;
device_t curdev;
- ACPI_STATUS rv;
+ ACPI_STATUS rv = 0;
ACPI_INTEGER val;
int i;
@@ -202,6 +202,7 @@ thinkpad_attach(device_t parent, device_
if (ACPI_FAILURE(rv)) {
aprint_error_dev(self, "couldn't evaluate MHKA: %s\n",
AcpiFormatException(rv));
+ rv = ENXIO;
goto fail;
}
@@ -210,6 +211,7 @@ thinkpad_attach(device_t parent, device_
if (ACPI_FAILURE(rv)) {
aprint_error_dev(self, "couldn't set event mask: %s\n",
AcpiFormatException(rv));
+ rv = ENXIO;
goto fail;
}
@@ -263,6 +265,7 @@ fail:
if (!pmf_event_register(self, PMFE_DISPLAY_BRIGHTNESS_DOWN,
thinkpad_brightness_down, true))
aprint_error_dev(self, "couldn't register event handler\n");
+ return rv;
}
static void
Index: sys/dev/acpi/ug_acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/ug_acpi.c,v
retrieving revision 1.5
diff -u -p -r1.5 ug_acpi.c
--- sys/dev/acpi/ug_acpi.c 17 Feb 2009 12:46:01 -0000 1.5
+++ sys/dev/acpi/ug_acpi.c 1 May 2009 16:43:31 -0000
@@ -50,7 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: ug_acpi.c,v
/* autoconf(9) functions */
static int ug_acpi_match(device_t, cfdata_t, void *);
-static void ug_acpi_attach(device_t, device_t, void *);
+static int ug_acpi_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(ug_acpi, sizeof(struct ug_softc), ug_acpi_match,
ug_acpi_attach, NULL, NULL);
@@ -76,7 +76,7 @@ ug_acpi_match(device_t parent, cfdata_t
return acpi_match_hid(aa->aa_node->ad_devinfo, ug_acpi_ids);
}
-static void
+static int
ug_acpi_attach(device_t parent, device_t self, void *aux)
{
struct ug_softc *sc = device_private(self);
@@ -90,7 +90,7 @@ ug_acpi_attach(device_t parent, device_t
rv = acpi_resource_parse(self, aa->aa_node->ad_handle, "_CRS",
&res, &acpi_resource_parse_ops_default);
if (ACPI_FAILURE(rv))
- return;
+ return ENXIO;
/* find our i/o registers */
io = acpi_res_io(&res, 0);
@@ -98,14 +98,14 @@ ug_acpi_attach(device_t parent, device_t
aprint_error_dev(self,
"unable to find i/o register resource\n");
acpi_resource_cleanup(&res);
- return;
+ return ENXIO;
}
if (bus_space_map(aa->aa_iot, io->ar_base, io->ar_length,
0, &ioh)) {
aprint_error_dev(self, "can't map i/o space\n");
acpi_resource_cleanup(&res);
- return;
+ return ENXIO;
}
aprint_normal("%s", device_xname(self));
@@ -116,4 +116,5 @@ ug_acpi_attach(device_t parent, device_t
ug2_attach(self);
acpi_resource_cleanup(&res);
+ return 0;
}
Index: sys/dev/acpi/wss_acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/wss_acpi.c,v
retrieving revision 1.21
diff -u -p -r1.21 wss_acpi.c
--- sys/dev/acpi/wss_acpi.c 14 Mar 2009 15:36:16 -0000 1.21
+++ sys/dev/acpi/wss_acpi.c 1 May 2009 16:43:31 -0000
@@ -53,7 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: wss_acpi.c,v
#include <dev/isa/wssvar.h>
static int wss_acpi_match(struct device *, struct cfdata *, void *);
-static void wss_acpi_attach(struct device *, struct device *, void *);
+static int wss_acpi_attach(struct device *, struct device *, void *);
CFATTACH_DECL(wss_acpi, sizeof(struct wss_softc), wss_acpi_match,
wss_acpi_attach, NULL, NULL);
@@ -111,7 +111,7 @@ wss_acpi_match(struct device *parent, st
/*
* wss_acpi_attach: autoconf(9) attach routine
*/
-static void
+static int
wss_acpi_attach(struct device *parent, struct device *self, void *aux)
{
struct wss_softc *sc = (struct wss_softc *)self;
@@ -121,7 +121,7 @@ wss_acpi_attach(struct device *parent, s
struct acpi_irq *irq;
struct acpi_drq *playdrq, *recdrq;
struct audio_attach_args arg;
- ACPI_STATUS rv;
+ ACPI_STATUS rv = 0;
struct wss_acpi_hint *wah;
wah = &wss_acpi_hints[
@@ -132,7 +132,7 @@ wss_acpi_attach(struct device *parent, s
aa->aa_node->ad_handle, "_CRS", &res,
&acpi_resource_parse_ops_default);
if (ACPI_FAILURE(rv))
- return;
+ return ENXIO;
/* Find and map our i/o registers */
sc->sc_iot = aa->aa_iot;
@@ -140,16 +140,19 @@ wss_acpi_attach(struct device *parent, s
oplio = acpi_res_io(&res, wah->io_region_idx_opl);
if (dspio == NULL || oplio == NULL) {
aprint_error_dev(&sc->sc_ad1848.sc_ad1848.sc_dev, "unable to
find i/o registers resource\n");
+ rv = ENXIO;
goto out;
}
if (bus_space_map(sc->sc_iot, dspio->ar_base, dspio->ar_length,
0, &sc->sc_ioh) != 0) {
aprint_error_dev(&sc->sc_ad1848.sc_ad1848.sc_dev, "unable to
map i/o registers\n");
+ rv = ENXIO;
goto out;
}
if (bus_space_map(sc->sc_iot, oplio->ar_base, oplio->ar_length,
0, &sc->sc_opl_ioh) != 0) {
aprint_error_dev(&sc->sc_ad1848.sc_ad1848.sc_dev, "unable to
map opl i/o registers\n");
+ rv = ENXIO;
goto out;
}
@@ -160,6 +163,7 @@ wss_acpi_attach(struct device *parent, s
if (irq == NULL) {
aprint_error_dev(&sc->sc_ad1848.sc_ad1848.sc_dev, "unable to
find irq resource\n");
/* XXX bus_space_unmap */
+ rv = ENXIO;
goto out;
}
sc->wss_irq = irq->ar_irq;
@@ -170,6 +174,7 @@ wss_acpi_attach(struct device *parent, s
if (playdrq == NULL || recdrq == NULL) {
aprint_error_dev(&sc->sc_ad1848.sc_ad1848.sc_dev, " unable to
find drq resources\n");
/* XXX bus_space_unmap */
+ rv = ENXIO;
goto out;
}
sc->wss_playdrq = playdrq->ar_drq;
@@ -183,6 +188,7 @@ wss_acpi_attach(struct device *parent, s
if (!ad1848_isa_probe(&sc->sc_ad1848)) {
aprint_error_dev(&sc->sc_ad1848.sc_ad1848.sc_dev, "ad1848 probe
failed\n");
/* XXX cleanup */
+ rv = ENXIO;
goto out;
}
@@ -197,4 +203,5 @@ wss_acpi_attach(struct device *parent, s
out:
acpi_resource_cleanup(&res);
+ return rv;
}
Index: sys/dev/ata/ata.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ata/ata.c,v
retrieving revision 1.105
diff -u -p -r1.105 ata.c
--- sys/dev/ata/ata.c 7 Apr 2009 18:01:20 -0000 1.105
+++ sys/dev/ata/ata.c 1 May 2009 16:43:31 -0000
@@ -434,7 +434,7 @@ atabus_match(device_t parent, struct cfd
*
* Autoconfiguration attach routine.
*/
-static void
+static int
atabus_attach(device_t parent, device_t self, void *aux)
{
struct atabus_softc *sc = device_private(self);
@@ -450,7 +450,7 @@ atabus_attach(device_t parent, device_t
sc->sc_dev = self;
if (ata_addref(chp))
- return;
+ return ENXIO;
initq = malloc(sizeof(*initq), M_DEVBUF, M_WAITOK);
initq->atabus_sc = sc;
@@ -464,6 +464,8 @@ atabus_attach(device_t parent, device_t
if (!pmf_device_register(self, atabus_suspend, atabus_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+
+ return 0;
}
/*
Index: sys/dev/ata/ata_raid.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ata/ata_raid.c,v
retrieving revision 1.32
diff -u -p -r1.32 ata_raid.c
--- sys/dev/ata/ata_raid.c 11 Sep 2008 11:08:50 -0000 1.32
+++ sys/dev/ata/ata_raid.c 1 May 2009 16:43:32 -0000
@@ -74,7 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v
void ataraidattach(int);
static int ataraid_match(device_t, cfdata_t, void *);
-static void ataraid_attach(device_t, device_t, void *);
+static int ataraid_attach(device_t, device_t, void *);
static int ataraid_print(void *, const char *);
static int ata_raid_finalize(device_t );
@@ -190,7 +190,7 @@ ataraid_match(device_t parent, cfdata_t
*
* Autoconfiguration glue: attach routine. We attach the children.
*/
-static void
+static int
ataraid_attach(device_t parent, device_t self,
void *aux)
{
@@ -212,6 +212,8 @@ ataraid_attach(device_t parent, device_t
config_found_sm_loc(self, "ataraid", locs, aai,
ataraid_print, config_stdsubmatch);
}
+
+ return 0;
}
/*
Index: sys/dev/ata/ld_ataraid.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ata/ld_ataraid.c,v
retrieving revision 1.33
diff -u -p -r1.33 ld_ataraid.c
--- sys/dev/ata/ld_ataraid.c 15 Oct 2008 06:51:20 -0000 1.33
+++ sys/dev/ata/ld_ataraid.c 1 May 2009 16:43:32 -0000
@@ -93,7 +93,7 @@ struct ld_ataraid_softc {
};
static int ld_ataraid_match(struct device *, struct cfdata *, void *);
-static void ld_ataraid_attach(struct device *, struct device *, void *);
+static int ld_ataraid_attach(struct device *, struct device *, void *);
static int ld_ataraid_dump(struct ld_softc *, void *, int, int);
@@ -137,7 +137,7 @@ ld_ataraid_match(device_t parent, cfdata
return (1);
}
-static void
+static int
ld_ataraid_attach(device_t parent, device_t self, void *aux)
{
struct ld_ataraid_softc *sc = device_private(self);
@@ -202,7 +202,7 @@ ld_ataraid_attach(device_t parent, devic
if (ld->sc_start == NULL) {
aprint_error_dev(ld->sc_dv, "unsupported array type\n");
- return;
+ return ENXIO;
}
/*
@@ -247,6 +247,7 @@ ld_ataraid_attach(device_t parent, devic
device_xname(ld->sc_dv));
#endif
ldattach(ld);
+ return 0;
}
static struct cbuf *
Index: sys/dev/ata/wd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ata/wd.c,v
retrieving revision 1.371
diff -u -p -r1.371 wd.c
--- sys/dev/ata/wd.c 2 Apr 2009 00:09:32 -0000 1.371
+++ sys/dev/ata/wd.c 1 May 2009 16:43:33 -0000
@@ -127,7 +127,7 @@ int wdcdebug_wd_mask = 0x0;
#endif
int wdprobe(struct device *, struct cfdata *, void *);
-void wdattach(struct device *, struct device *, void *);
+int wdattach(struct device *, struct device *, void *);
int wddetach(struct device *, int);
int wdactivate(struct device *, enum devact);
int wdprint(void *, char *);
@@ -289,7 +289,7 @@ wdprobe(struct device *parent, struct cf
return 1;
}
-void
+int
wdattach(struct device *parent, struct device *self, void *aux)
{
struct wd_softc *wd = device_private(self);
@@ -318,7 +318,7 @@ wdattach(struct device *parent, struct d
/* read our drive info */
if (wd_get_params(wd, AT_WAIT, &wd->sc_params) != 0) {
aprint_error("\n%s: IDENTIFY failed\n", device_xname(self));
- return;
+ return ENXIO;
}
for (blank = 0, p = wd->sc_params.atap_model, q = tbuf, i = 0;
@@ -421,6 +421,7 @@ wdattach(struct device *parent, struct d
if (!pmf_device_register1(self, wd_suspend, NULL, wd_shutdown))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static bool
Index: sys/dev/bluetooth/bcsp.c
===================================================================
RCS file: /cvsroot/src/sys/dev/bluetooth/bcsp.c,v
retrieving revision 1.16
diff -u -p -r1.16 bcsp.c
--- sys/dev/bluetooth/bcsp.c 26 Apr 2009 07:53:43 -0000 1.16
+++ sys/dev/bluetooth/bcsp.c 1 May 2009 16:43:33 -0000
@@ -133,7 +133,7 @@ struct bcsp_softc {
void bcspattach(int);
static int bcsp_match(device_t, struct cfdata *, void *);
-static void bcsp_attach(device_t, device_t, void *);
+static int bcsp_attach(device_t, device_t, void *);
static int bcsp_detach(device_t, int);
/* tty functions */
@@ -259,7 +259,7 @@ bcsp_match(device_t self __unused, struc
* open the line discipline.
*/
/* ARGSUSED */
-static void
+static int
bcsp_attach(device_t parent __unused, device_t self, void *aux __unused)
{
struct bcsp_softc *sc = device_private(self);
@@ -334,10 +334,11 @@ bcsp_attach(device_t parent __unused, de
0, CTL_HW, bcsp_node_num, CTL_CREATE, CTL_EOL)) != 0) {
goto err;
}
- return;
+ return 0;
err:
aprint_error_dev(self, "sysctl_createv failed (rc = %d)\n", rc);
+ return ENXIO;
}
/*
Index: sys/dev/bluetooth/bthidev.c
===================================================================
RCS file: /cvsroot/src/sys/dev/bluetooth/bthidev.c,v
retrieving revision 1.16
diff -u -p -r1.16 bthidev.c
--- sys/dev/bluetooth/bthidev.c 6 Aug 2008 15:01:23 -0000 1.16
+++ sys/dev/bluetooth/bthidev.c 1 May 2009 16:43:33 -0000
@@ -110,7 +110,7 @@ static void bthidev_null(struct bthidev
/* autoconf(9) glue */
static int bthidev_match(device_t, struct cfdata *, void *);
-static void bthidev_attach(device_t, device_t, void *);
+static int bthidev_attach(device_t, device_t, void *);
static int bthidev_detach(device_t, int);
static int bthidev_print(void *, const char *);
@@ -167,7 +167,7 @@ bthidev_match(device_t self, struct cfda
return 0;
}
-static void
+static int
bthidev_attach(device_t parent, device_t self, void *aux)
{
struct bthidev_softc *sc = device_private(self);
@@ -215,7 +215,7 @@ bthidev_attach(device_t parent, device_t
sockopt_setint(&sc->sc_mode, L2CAP_LM_SECURE);
else {
aprint_error(" unknown %s\n", BTDEVmode);
- return;
+ return ENXIO;
}
aprint_verbose(" %s %s", BTDEVmode,
@@ -227,7 +227,7 @@ bthidev_attach(device_t parent, device_t
sc->sc_ctlpsm = prop_number_integer_value(obj);
if (L2CAP_PSM_INVALID(sc->sc_ctlpsm)) {
aprint_error(" invalid %s\n", BTHIDEVcontrolpsm);
- return;
+ return ENXIO;
}
}
@@ -236,7 +236,7 @@ bthidev_attach(device_t parent, device_t
sc->sc_intpsm = prop_number_integer_value(obj);
if (L2CAP_PSM_INVALID(sc->sc_intpsm)) {
aprint_error(" invalid %s\n", BTHIDEVinterruptpsm);
- return;
+ return ENXIO;
}
}
@@ -246,7 +246,7 @@ bthidev_attach(device_t parent, device_t
desc = prop_data_data_nocopy(obj);
} else {
aprint_error(" no %s\n", BTHIDEVdescriptor);
- return;
+ return ENXIO;
}
obj = prop_dictionary_get(dict, BTHIDEVreconnect);
@@ -268,7 +268,7 @@ bthidev_attach(device_t parent, device_t
if (maxid < 0) {
aprint_error(" no reports found\n");
- return;
+ return ENXIO;
}
aprint_normal("\n");
@@ -311,6 +311,7 @@ bthidev_attach(device_t parent, device_t
if (sc->sc_flags & BTHID_CONNECTING)
bthidev_connect(sc);
mutex_exit(bt_lock);
+ return 0;
}
static int
Index: sys/dev/bluetooth/bthub.c
===================================================================
RCS file: /cvsroot/src/sys/dev/bluetooth/bthub.c,v
retrieving revision 1.14
diff -u -p -r1.14 bthub.c
--- sys/dev/bluetooth/bthub.c 12 Jun 2008 21:47:11 -0000 1.14
+++ sys/dev/bluetooth/bthub.c 1 May 2009 16:43:33 -0000
@@ -60,7 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: bthub.c,v 1.
/* autoconf(9) glue */
static int bthub_match(device_t, struct cfdata *, void *);
-static void bthub_attach(device_t, device_t, void *);
+static int bthub_attach(device_t, device_t, void *);
static int bthub_detach(device_t, int);
CFATTACH_DECL_NEW(bthub, 0,
@@ -92,7 +92,7 @@ bthub_match(device_t self, struct cfdata
return 1;
}
-static void
+static int
bthub_attach(device_t parent, device_t self, void *aux)
{
bdaddr_t *addr = aux;
@@ -110,6 +110,7 @@ bthub_attach(device_t parent, device_t s
addr->b[2], addr->b[1], addr->b[0]);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/bluetooth/btkbd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/bluetooth/btkbd.c,v
retrieving revision 1.10
diff -u -p -r1.10 btkbd.c
--- sys/dev/bluetooth/btkbd.c 9 Sep 2008 03:54:56 -0000 1.10
+++ sys/dev/bluetooth/btkbd.c 1 May 2009 16:43:33 -0000
@@ -145,7 +145,7 @@ struct btkbd_softc {
/* autoconf(9) methods */
static int btkbd_match(device_t, struct cfdata *, void *);
-static void btkbd_attach(device_t, device_t, void *);
+static int btkbd_attach(device_t, device_t, void *);
static int btkbd_detach(device_t, int);
CFATTACH_DECL_NEW(btkbd, sizeof(struct btkbd_softc),
@@ -205,7 +205,7 @@ btkbd_match(device_t self, struct cfdata
return 0;
}
-static void
+static int
btkbd_attach(device_t parent, device_t self, void *aux)
{
struct btkbd_softc *sc = device_private(self);
@@ -219,7 +219,7 @@ btkbd_attach(device_t parent, device_t s
parserr = btkbd_parse_desc(sc, ba->ba_id, ba->ba_desc, ba->ba_dlen);
if (parserr != NULL) {
aprint_error("%s\n", parserr);
- return;
+ return ENXIO;
}
aprint_normal("\n");
@@ -237,6 +237,7 @@ btkbd_attach(device_t parent, device_t s
wska.accesscookie = sc;
sc->sc_wskbd = config_found(self, &wska, wskbddevprint);
+ return 0;
}
static int
Index: sys/dev/bluetooth/btms.c
===================================================================
RCS file: /cvsroot/src/sys/dev/bluetooth/btms.c,v
retrieving revision 1.8
diff -u -p -r1.8 btms.c
--- sys/dev/bluetooth/btms.c 9 Sep 2008 03:54:56 -0000 1.8
+++ sys/dev/bluetooth/btms.c 1 May 2009 16:43:33 -0000
@@ -115,7 +115,7 @@ struct btms_softc {
/* autoconf(9) methods */
static int btms_match(device_t, struct cfdata *, void *);
-static void btms_attach(device_t, device_t, void *);
+static int btms_attach(device_t, device_t, void *);
static int btms_detach(device_t, int);
CFATTACH_DECL_NEW(btms, sizeof(struct btms_softc),
@@ -152,7 +152,7 @@ btms_match(device_t parent, struct cfdat
return 0;
}
-static void
+static int
btms_attach(device_t parent, device_t self, void *aux)
{
struct btms_softc *sc = device_private(self);
@@ -175,7 +175,7 @@ btms_attach(device_t parent, device_t se
if (hl == 0 || NOTMOUSE(flags)) {
aprint_error("X report 0x%04x not supported\n", flags);
- return;
+ return ENXIO;
}
/* control the vertical */
@@ -189,7 +189,7 @@ btms_attach(device_t parent, device_t se
if (hl == 0 || NOTMOUSE(flags)) {
aprint_error("Y report 0x%04x not supported\n", flags);
- return;
+ return ENXIO;
}
/* Try the wheel first as the Z activator since it's tradition. */
@@ -276,6 +276,7 @@ btms_attach(device_t parent, device_t se
wsma.accesscookie = sc;
sc->sc_wsmouse = config_found(self, &wsma, wsmousedevprint);
+ return 0;
}
static int
Index: sys/dev/bluetooth/btsco.c
===================================================================
RCS file: /cvsroot/src/sys/dev/bluetooth/btsco.c,v
retrieving revision 1.22
diff -u -p -r1.22 btsco.c
--- sys/dev/bluetooth/btsco.c 6 Aug 2008 15:01:23 -0000 1.22
+++ sys/dev/bluetooth/btsco.c 1 May 2009 16:43:34 -0000
@@ -135,7 +135,7 @@ struct btsco_softc {
/* autoconf(9) glue */
static int btsco_match(device_t, struct cfdata *, void *);
-static void btsco_attach(device_t, device_t, void *);
+static int btsco_attach(device_t, device_t, void *);
static int btsco_detach(device_t, int);
CFATTACH_DECL_NEW(btsco, sizeof(struct btsco_softc),
@@ -274,7 +274,7 @@ btsco_match(device_t self, struct cfdata
return 0;
}
-static void
+static int
btsco_attach(device_t parent, device_t self, void *aux)
{
struct btsco_softc *sc = device_private(self);
@@ -310,7 +310,7 @@ btsco_attach(device_t parent, device_t s
|| prop_number_integer_value(obj) < RFCOMM_CHANNEL_MIN
|| prop_number_integer_value(obj) > RFCOMM_CHANNEL_MAX) {
aprint_error(" invalid %s", BTSCOchannel);
- return;
+ return ENXIO;
}
sc->sc_channel = prop_number_integer_value(obj);
@@ -325,7 +325,7 @@ btsco_attach(device_t parent, device_t s
sc->sc_intr = softint_establish(SOFTINT_NET, btsco_intr, sc);
if (sc->sc_intr == NULL) {
aprint_error_dev(self, "softint_establish failed\n");
- return;
+ return ENXIO;
}
/*
@@ -334,8 +334,9 @@ btsco_attach(device_t parent, device_t s
sc->sc_audio = audio_attach_mi(&btsco_if, sc, self);
if (sc->sc_audio == NULL) {
aprint_error_dev(self, "audio_attach_mi failed\n");
- return;
+ return ENXIO;
}
+ return 0;
}
static int
Index: sys/dev/bluetooth/btuart.c
===================================================================
RCS file: /cvsroot/src/sys/dev/bluetooth/btuart.c,v
retrieving revision 1.21
diff -u -p -r1.21 btuart.c
--- sys/dev/bluetooth/btuart.c 26 Apr 2009 07:53:43 -0000 1.21
+++ sys/dev/bluetooth/btuart.c 1 May 2009 16:43:34 -0000
@@ -83,7 +83,7 @@ struct btuart_softc {
void btuartattach(int);
static int btuart_match(device_t, struct cfdata *, void *);
-static void btuart_attach(device_t, device_t, void *);
+static int btuart_attach(device_t, device_t, void *);
static int btuart_detach(device_t, int);
static int btuartopen(dev_t, struct tty *);
@@ -176,7 +176,7 @@ btuart_match(device_t self __unused, str
* Autoconf attach routine.
* Called by config_attach_pseudo(9) when we open the line discipline.
*/
-static void
+static int
btuart_attach(device_t parent __unused, device_t self, void *aux __unused)
{
struct btuart_softc *sc = device_private(self);
@@ -191,6 +191,7 @@ btuart_attach(device_t parent __unused,
sc->sc_unit = hci_attach(&btuart_hci, self, 0);
if (sc->sc_unit == NULL)
aprint_error_dev(self, "HCI attach failed\n");
+ return 0;
}
/*
Index: sys/dev/cardbus/adv_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/adv_cardbus.c,v
retrieving revision 1.20
diff -u -p -r1.20 adv_cardbus.c
--- sys/dev/cardbus/adv_cardbus.c 14 Mar 2009 15:36:16 -0000 1.20
+++ sys/dev/cardbus/adv_cardbus.c 1 May 2009 16:43:34 -0000
@@ -83,7 +83,7 @@ struct adv_cardbus_softc {
};
int adv_cardbus_match(struct device *, struct cfdata *, void *);
-void adv_cardbus_attach(struct device *, struct device *, void *);
+int adv_cardbus_attach(struct device *, struct device *, void *);
int adv_cardbus_detach(struct device *, int);
CFATTACH_DECL(adv_cardbus, sizeof(struct adv_cardbus_softc),
@@ -102,7 +102,7 @@ adv_cardbus_match(struct device *parent,
return (0);
}
-void
+int
adv_cardbus_attach(struct device *parent, struct device *self,
void *aux)
{
@@ -145,7 +145,7 @@ adv_cardbus_attach(struct device *parent
default:
printf(": unknown model!\n");
- return;
+ return ENXIO;
}
}
@@ -179,7 +179,7 @@ adv_cardbus_attach(struct device *parent
csc->sc_csr |= PCI_COMMAND_IO_ENABLE;
} else {
aprint_error_dev(&sc->sc_dev, "unable to map device
registers\n");
- return;
+ return ENXIO;
}
/* Make sure the right access type is on the CardBus bridge. */
@@ -218,7 +218,7 @@ adv_cardbus_attach(struct device *parent
*/
if (adv_init(sc)) {
printf("adv_init failed\n");
- return;
+ return ENXIO;
}
/*
@@ -229,13 +229,15 @@ adv_cardbus_attach(struct device *parent
if (sc->sc_ih == NULL) {
aprint_error_dev(&sc->sc_dev,
"unable to establish interrupt\n");
- return;
+ return ENXIO;
}
/*
* Attach.
*/
adv_attach(sc);
+
+ return 0;
}
int
Index: sys/dev/cardbus/ahc_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/ahc_cardbus.c,v
retrieving revision 1.26
diff -u -p -r1.26 ahc_cardbus.c
--- sys/dev/cardbus/ahc_cardbus.c 14 Mar 2009 15:36:16 -0000 1.26
+++ sys/dev/cardbus/ahc_cardbus.c 1 May 2009 16:43:34 -0000
@@ -86,7 +86,7 @@ struct ahc_cardbus_softc {
};
int ahc_cardbus_match(struct device *, struct cfdata *, void *);
-void ahc_cardbus_attach(struct device *, struct device *, void *);
+int ahc_cardbus_attach(struct device *, struct device *, void *);
int ahc_cardbus_detach(struct device *, int);
int ahc_activate(struct device *self, enum devact act);
@@ -106,7 +106,7 @@ ahc_cardbus_match(struct device *parent,
return (0);
}
-void
+int
ahc_cardbus_attach(struct device *parent, struct device *self,
void *aux)
{
@@ -145,7 +145,7 @@ ahc_cardbus_attach(struct device *parent
} else {
printf("%s: unable to map device registers\n",
ahc_name(ahc));
- return;
+ return ENXIO;
}
/* Make sure the right access type is on the CardBus bridge. */
@@ -185,7 +185,7 @@ ahc_cardbus_attach(struct device *parent
ahc->bugs |= AHC_PCI_2_1_RETRY_BUG;
if (ahc_softc_init(ahc) != 0)
- return;
+ return ENXIO;
/*
* On all CardBus adapters, we allow SCB paging.
@@ -206,13 +206,13 @@ ahc_cardbus_attach(struct device *parent
if (ahc->ih == NULL) {
printf("%s: unable to establish interrupt\n",
ahc_name(ahc));
- return;
+ return ENXIO;
}
ahc->seep_config = malloc(sizeof(*ahc->seep_config),
M_DEVBUF, M_NOWAIT);
if (ahc->seep_config == NULL)
- return;
+ return ENXIO;
ahc_check_extport(ahc, &sxfrctl1);
/*
@@ -250,10 +250,12 @@ ahc_cardbus_attach(struct device *parent
if (ahc_init(ahc)) {
ahc_free(ahc);
- return;
+ return ENXIO;
}
ahc_attach(ahc);
+
+ return 0;
}
int
Index: sys/dev/cardbus/cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/cardbus.c,v
retrieving revision 1.96
diff -u -p -r1.96 cardbus.c
--- sys/dev/cardbus/cardbus.c 2 Apr 2009 00:09:33 -0000 1.96
+++ sys/dev/cardbus/cardbus.c 1 May 2009 16:43:34 -0000
@@ -69,7 +69,7 @@ __KERNEL_RCSID(0, "$NetBSD: cardbus.c,v
#endif
-STATIC void cardbusattach(device_t, device_t, void *);
+STATIC int cardbusattach(device_t, device_t, void *);
STATIC int cardbusdetach(device_t, int);
STATIC int cardbusmatch(device_t, struct cfdata *, void *);
int cardbus_rescan(device_t, const char *, const int *);
@@ -109,7 +109,7 @@ cardbusmatch(device_t parent, struct cfd
return (1);
}
-STATIC void
+STATIC int
cardbusattach(device_t parent, device_t self, void *aux)
{
struct cardbus_softc *sc = device_private(self);
@@ -142,6 +142,7 @@ cardbusattach(device_t parent, device_t
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
STATIC int
Index: sys/dev/cardbus/cardslot.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/cardslot.c,v
retrieving revision 1.47
diff -u -p -r1.47 cardslot.c
--- sys/dev/cardbus/cardslot.c 2 Apr 2009 00:09:33 -0000 1.47
+++ sys/dev/cardbus/cardslot.c 1 May 2009 16:43:34 -0000
@@ -64,7 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: cardslot.c,v
-STATIC void cardslotattach(struct device *, struct device *, void *);
+STATIC int cardslotattach(struct device *, struct device *, void *);
STATIC int cardslotdetach(device_t, int);
STATIC int cardslotmatch(struct device *, struct cfdata *, void *);
@@ -95,7 +95,7 @@ cardslotmatch(struct device *parent, str
-STATIC void
+STATIC int
cardslotattach(struct device *parent, struct device *self,
void *aux)
{
@@ -166,6 +166,7 @@ cardslotattach(struct device *parent, st
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
STATIC int
Index: sys/dev/cardbus/com_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/com_cardbus.c,v
retrieving revision 1.22
diff -u -p -r1.22 com_cardbus.c
--- sys/dev/cardbus/com_cardbus.c 24 Jun 2008 19:44:52 -0000 1.22
+++ sys/dev/cardbus/com_cardbus.c 1 May 2009 16:43:34 -0000
@@ -72,7 +72,7 @@ struct com_cardbus_softc {
#define DEVICET(CSC) ((CSC)->cc_com.sc_dev)
static int com_cardbus_match (device_t, cfdata_t, void*);
-static void com_cardbus_attach (device_t, device_t, void*);
+static int com_cardbus_attach (device_t, device_t, void*);
static int com_cardbus_detach (device_t, int);
static void com_cardbus_setup(struct com_cardbus_softc*);
@@ -201,7 +201,7 @@ gofigure(struct cardbus_attach_args *ca,
return 1;
}
-static void
+static int
com_cardbus_attach (device_t parent, device_t self, void *aux)
{
struct com_softc *sc = device_private(self);
@@ -215,7 +215,7 @@ com_cardbus_attach (device_t parent, dev
csc->cc_tag = Cardbus_make_tag(csc->cc_ct);
if(gofigure(ca, csc) != 0)
- return;
+ return ENXIO;
if(Cardbus_mapreg_map(ca->ca_ct,
csc->cc_reg,
@@ -226,7 +226,7 @@ com_cardbus_attach (device_t parent, dev
&csc->cc_addr,
&csc->cc_size) != 0) {
aprint_error("failed to map memory");
- return;
+ return ENXIO;
}
COM_INIT_REGS(sc->sc_regs, iot, ioh, csc->cc_addr);
@@ -258,7 +258,7 @@ com_cardbus_attach (device_t parent, dev
com_attach_subr(sc);
- Cardbus_function_disable(csc->cc_ct);
+ return Cardbus_function_disable(csc->cc_ct);
}
static void
Index: sys/dev/cardbus/ehci_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/ehci_cardbus.c,v
retrieving revision 1.22
diff -u -p -r1.22 ehci_cardbus.c
--- sys/dev/cardbus/ehci_cardbus.c 24 Jun 2008 19:44:52 -0000 1.22
+++ sys/dev/cardbus/ehci_cardbus.c 1 May 2009 16:43:34 -0000
@@ -66,7 +66,7 @@ extern int ehcidebug;
#endif
int ehci_cardbus_match(device_t, struct cfdata *, void *);
-void ehci_cardbus_attach(device_t, device_t, void *);
+int ehci_cardbus_attach(device_t, device_t, void *);
int ehci_cardbus_detach(device_t, int);
struct ehci_cardbus_softc {
@@ -123,7 +123,7 @@ ehci_cardbus_resume(device_t dv PMF_FN_A
return ehci_resume(dv PMF_FN_CALL);
}
-void
+int
ehci_cardbus_attach(device_t parent, device_t self, void *aux)
{
struct ehci_cardbus_softc *sc = device_private(self);
@@ -150,7 +150,7 @@ ehci_cardbus_attach(device_t parent, dev
if (Cardbus_mapreg_map(ct, CARDBUS_CBMEM, CARDBUS_MAPREG_TYPE_MEM, 0,
&sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
printf("%s: can't map mem space\n", devname);
- return;
+ return ENXIO;
}
sc->sc_cc = cc;
@@ -181,7 +181,7 @@ XXX (ct->ct_cf->cardbus_mem_open)(cc, 0,
IPL_USB, ehci_intr, sc);
if (sc->sc_ih == NULL) {
printf("%s: couldn't establish interrupt\n", devname);
- return;
+ return ENXIO;
}
/* Figure out vendor for root hub descriptor. */
@@ -217,7 +217,7 @@ XXX (ct->ct_cf->cardbus_mem_open)(cc, 0,
cardbus_intr_disestablish(sc->sc_cc, sc->sc_cf, sc->sc_ih);
sc->sc_ih = NULL;
- return;
+ return ENXIO;
}
if (!pmf_device_register1(self, ehci_cardbus_suspend,
@@ -226,6 +226,7 @@ XXX (ct->ct_cf->cardbus_mem_open)(cc, 0,
/* Attach usb device. */
sc->sc.sc_child = config_found(self, &sc->sc.sc_bus, usbctlprint);
+ return 0;
}
int
Index: sys/dev/cardbus/fwohci_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/fwohci_cardbus.c,v
retrieving revision 1.26
diff -u -p -r1.26 fwohci_cardbus.c
--- sys/dev/cardbus/fwohci_cardbus.c 11 Jul 2008 17:50:45 -0000 1.26
+++ sys/dev/cardbus/fwohci_cardbus.c 1 May 2009 16:43:34 -0000
@@ -63,7 +63,7 @@ struct fwohci_cardbus_softc {
};
static int fwohci_cardbus_match(device_t, struct cfdata *, void *);
-static void fwohci_cardbus_attach(device_t, device_t, void *);
+static int fwohci_cardbus_attach(device_t, device_t, void *);
static int fwohci_cardbus_detach(device_t, int);
CFATTACH_DECL_NEW(fwohci_cardbus, sizeof(struct fwohci_cardbus_softc),
@@ -88,7 +88,7 @@ fwohci_cardbus_match(device_t parent, st
return 0;
}
-static void
+static int
fwohci_cardbus_attach(device_t parent, device_t self, void *aux)
{
struct cardbus_attach_args *ca = aux;
@@ -110,7 +110,7 @@ fwohci_cardbus_attach(device_t parent, d
&sc->sc_sc.bst, &sc->sc_sc.bsh,
NULL, &sc->sc_sc.bssize)) {
aprint_error_dev(self, "can't map OHCI register space\n");
- return;
+ return ENXIO;
}
sc->sc_sc.fc.dev = self;
@@ -139,7 +139,7 @@ XXX (ct->ct_cf->cardbus_mem_open)(cc, 0,
IPL_BIO, fwohci_filt, sc);
if (sc->sc_ih == NULL) {
aprint_error_dev(self, "couldn't establish interrupt\n");
- return;
+ return ENXIO;
}
/* XXX NULL should be replaced by some call to Cardbus coed */
@@ -147,6 +147,7 @@ XXX (ct->ct_cf->cardbus_mem_open)(cc, 0,
cardbus_intr_disestablish(cc, cf, sc->sc_ih);
sc->sc_ih = NULL;
}
+ return 0;
}
int
Index: sys/dev/cardbus/if_ath_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/if_ath_cardbus.c,v
retrieving revision 1.32
diff -u -p -r1.32 if_ath_cardbus.c
--- sys/dev/cardbus/if_ath_cardbus.c 11 Dec 2008 05:45:29 -0000 1.32
+++ sys/dev/cardbus/if_ath_cardbus.c 1 May 2009 16:43:34 -0000
@@ -111,7 +111,7 @@ struct ath_cardbus_softc {
};
int ath_cardbus_match(device_t, cfdata_t, void *);
-void ath_cardbus_attach(device_t, device_t, void *);
+int ath_cardbus_attach(device_t, device_t, void *);
int ath_cardbus_detach(device_t, int);
CFATTACH_DECL_NEW(ath_cardbus, sizeof(struct ath_cardbus_softc),
@@ -165,7 +165,7 @@ ath_cardbus_match(device_t parent, struc
return 0;
}
-void
+int
ath_cardbus_attach(device_t parent, device_t self, void *aux)
{
struct ath_cardbus_softc *csc = device_private(self);
@@ -193,7 +193,7 @@ ath_cardbus_attach(device_t parent, devi
csc->sc_bar_val = adr | PCI_MAPREG_TYPE_MEM;
} else {
aprint_error_dev(self, "unable to map device registers\n");
- return;
+ return ENXIO;
}
sc->sc_st = HALTAG(csc->sc_iot);
@@ -213,7 +213,7 @@ ath_cardbus_attach(device_t parent, devi
* Finish off the attach.
*/
if (ath_attach(PCI_PRODUCT(ca->ca_id), sc) != 0)
- return;
+ return ENXIO;
if (!pmf_device_register(self, ath_cardbus_suspend, ath_cardbus_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
@@ -221,6 +221,7 @@ ath_cardbus_attach(device_t parent, devi
pmf_class_network_register(self, &sc->sc_if);
pmf_device_suspend_self(self);
}
+ return 0;
}
int
Index: sys/dev/cardbus/if_atw_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/if_atw_cardbus.c,v
retrieving revision 1.26
diff -u -p -r1.26 if_atw_cardbus.c
--- sys/dev/cardbus/if_atw_cardbus.c 2 Apr 2009 00:09:33 -0000 1.26
+++ sys/dev/cardbus/if_atw_cardbus.c 1 May 2009 16:43:34 -0000
@@ -113,7 +113,7 @@ struct atw_cardbus_softc {
};
static int atw_cardbus_match(device_t, cfdata_t, void *);
-static void atw_cardbus_attach(device_t, device_t, void *);
+static int atw_cardbus_attach(device_t, device_t, void *);
static int atw_cardbus_detach(device_t, int);
CFATTACH_DECL3_NEW(atw_cardbus, sizeof(struct atw_cardbus_softc),
@@ -163,7 +163,7 @@ atw_cardbus_match(device_t parent, cfdat
return 0;
}
-static void
+static int
atw_cardbus_attach(device_t parent, device_t self, void *aux)
{
struct atw_cardbus_softc *csc = device_private(self);
@@ -250,7 +250,7 @@ atw_cardbus_attach(device_t parent, devi
csc->sc_bar_val = adr | CARDBUS_MAPREG_TYPE_IO;
} else {
aprint_error_dev(self, "unable to map device registers\n");
- return;
+ return ENXIO;
}
/*
@@ -288,7 +288,7 @@ atw_cardbus_attach(device_t parent, devi
/*
* Power down the socket.
*/
- Cardbus_function_disable(csc->sc_ct);
+ return Cardbus_function_disable(csc->sc_ct);
}
static int
Index: sys/dev/cardbus/if_ex_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/if_ex_cardbus.c,v
retrieving revision 1.45
diff -u -p -r1.45 if_ex_cardbus.c
--- sys/dev/cardbus/if_ex_cardbus.c 24 Jun 2008 19:44:52 -0000 1.45
+++ sys/dev/cardbus/if_ex_cardbus.c 1 May 2009 16:43:34 -0000
@@ -84,7 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ex_cardbu
#define EX_CB_INTR_ACK 0x8000 /* intr acknowledge bit */
int ex_cardbus_match(device_t, cfdata_t, void *);
-void ex_cardbus_attach(device_t, device_t, void *);
+int ex_cardbus_attach(device_t, device_t, void *);
int ex_cardbus_detach(device_t, int);
void ex_cardbus_intr_ack(struct ex_softc *);
@@ -214,7 +214,7 @@ ex_cardbus_match(device_t parent, cfdata
return (0);
}
-void
+int
ex_cardbus_attach(device_t parent, device_t self, void *aux)
{
struct ex_cardbus_softc *csc = device_private(self);
@@ -273,7 +273,7 @@ ex_cardbus_attach(device_t parent, devic
} else {
aprint_error_dev(self, "unable to map function "
"status window\n");
- return;
+ return ENXIO;
}
/* Setup interrupt acknowledge hook */
@@ -282,7 +282,7 @@ ex_cardbus_attach(device_t parent, devic
}
else {
aprint_naive(": can't map i/o space\n");
- return;
+ return ENXIO;
}
/* Power management hooks. */
@@ -301,7 +301,7 @@ ex_cardbus_attach(device_t parent, devic
bus_space_write_4(csc->sc_funct, csc->sc_funch,
EX_CB_INTR, EX_CB_INTR_ACK);
- Cardbus_function_disable(csc->sc_ct);
+ return Cardbus_function_disable(csc->sc_ct);
}
void
Index: sys/dev/cardbus/if_fxp_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/if_fxp_cardbus.c,v
retrieving revision 1.37
diff -u -p -r1.37 if_fxp_cardbus.c
--- sys/dev/cardbus/if_fxp_cardbus.c 7 Mar 2009 15:03:25 -0000 1.37
+++ sys/dev/cardbus/if_fxp_cardbus.c 1 May 2009 16:43:34 -0000
@@ -87,7 +87,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_fxp_cardb
#include <dev/pci/pcidevs.h>
static int fxp_cardbus_match(device_t, cfdata_t, void *);
-static void fxp_cardbus_attach(device_t, device_t, void *);
+static int fxp_cardbus_attach(device_t, device_t, void *);
static int fxp_cardbus_detach(device_t, int);
static void fxp_cardbus_setup(struct fxp_softc *);
static int fxp_cardbus_enable(struct fxp_softc *);
@@ -123,7 +123,7 @@ fxp_cardbus_match(struct device *parent,
return (0);
}
-static void
+static int
fxp_cardbus_attach(struct device *parent, struct device *self,
void *aux)
{
@@ -187,6 +187,7 @@ fxp_cardbus_attach(struct device *parent
aprint_error_dev(self, "couldn't establish power handler\n");
else
pmf_class_network_register(self, &sc->sc_ethercom.ec_if);
+ return 0;
}
static void
Index: sys/dev/cardbus/if_ral_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/if_ral_cardbus.c,v
retrieving revision 1.14
diff -u -p -r1.14 if_ral_cardbus.c
--- sys/dev/cardbus/if_ral_cardbus.c 12 Oct 2008 02:15:02 -0000 1.14
+++ sys/dev/cardbus/if_ral_cardbus.c 1 May 2009 16:43:34 -0000
@@ -94,7 +94,7 @@ struct ral_cardbus_softc {
};
int ral_cardbus_match(struct device *, struct cfdata *, void *);
-void ral_cardbus_attach(struct device *, struct device *, void *);
+int ral_cardbus_attach(struct device *, struct device *, void *);
int ral_cardbus_detach(struct device *, int);
CFATTACH_DECL(ral_cardbus, sizeof (struct ral_cardbus_softc),
@@ -126,7 +126,7 @@ ral_cardbus_match(struct device *parent,
return 0;
}
-void
+int
ral_cardbus_attach(struct device *parent, struct device *self,
void *aux)
{
@@ -161,7 +161,7 @@ ral_cardbus_attach(struct device *parent
&csc->sc_mapsize);
if (error != 0) {
printf(": could not map memory space\n");
- return;
+ return ENXIO;
}
#if rbus
@@ -176,7 +176,7 @@ ral_cardbus_attach(struct device *parent
(*csc->sc_opns->attach)(sc, CARDBUS_PRODUCT(ca->ca_id));
- Cardbus_function_disable(ct);
+ return Cardbus_function_disable(ct);
}
int
Index: sys/dev/cardbus/if_re_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/if_re_cardbus.c,v
retrieving revision 1.18
diff -u -p -r1.18 if_re_cardbus.c
--- sys/dev/cardbus/if_re_cardbus.c 24 Jun 2008 19:44:52 -0000 1.18
+++ sys/dev/cardbus/if_re_cardbus.c 1 May 2009 16:43:34 -0000
@@ -106,7 +106,7 @@ static const struct rtk_type re_cardbus_
};
static int re_cardbus_match(device_t, cfdata_t, void *);
-static void re_cardbus_attach(device_t, device_t, void *);
+static int re_cardbus_attach(device_t, device_t, void *);
static int re_cardbus_detach(device_t, int);
struct re_cardbus_softc {
@@ -160,7 +160,7 @@ re_cardbus_match(device_t parent, cfdata
}
-void
+int
re_cardbus_attach(device_t parent, device_t self, void *aux)
{
struct re_cardbus_softc *csc = device_private(self);
@@ -220,7 +220,7 @@ re_cardbus_attach(device_t parent, devic
#endif
else {
aprint_error_dev(self, "unable to map deviceregisters\n");
- return;
+ return ENXIO;
}
/*
* Handle power management nonsense and initialize the
@@ -239,7 +239,7 @@ re_cardbus_attach(device_t parent, devic
/*
* Power down the socket.
*/
- Cardbus_function_disable(csc->sc_ct);
+ return Cardbus_function_disable(csc->sc_ct);
}
int
Index: sys/dev/cardbus/if_rtk_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/if_rtk_cardbus.c,v
retrieving revision 1.37
diff -u -p -r1.37 if_rtk_cardbus.c
--- sys/dev/cardbus/if_rtk_cardbus.c 24 Jun 2008 19:44:52 -0000 1.37
+++ sys/dev/cardbus/if_rtk_cardbus.c 1 May 2009 16:43:35 -0000
@@ -121,7 +121,7 @@ static const struct rtk_type rtk_cardbus
};
static int rtk_cardbus_match(device_t, cfdata_t, void *);
-static void rtk_cardbus_attach(device_t, device_t, void *);
+static int rtk_cardbus_attach(device_t, device_t, void *);
static int rtk_cardbus_detach(device_t, int);
struct rtk_cardbus_softc {
@@ -176,7 +176,7 @@ rtk_cardbus_match(device_t parent, cfdat
}
-void
+int
rtk_cardbus_attach(device_t parent, device_t self, void *aux)
{
struct rtk_cardbus_softc *csc = device_private(self);
@@ -236,7 +236,7 @@ rtk_cardbus_attach(device_t parent, devi
#endif
else {
aprint_error_dev(self, " unable to map deviceregisters\n");
- return;
+ return ENXIO;
}
/*
* Handle power management nonsense and initialize the
@@ -254,7 +254,7 @@ rtk_cardbus_attach(device_t parent, devi
/*
* Power down the socket.
*/
- Cardbus_function_disable(csc->sc_ct);
+ return Cardbus_function_disable(csc->sc_ct);
}
int
Index: sys/dev/cardbus/if_rtw_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/if_rtw_cardbus.c,v
retrieving revision 1.28
diff -u -p -r1.28 if_rtw_cardbus.c
--- sys/dev/cardbus/if_rtw_cardbus.c 6 Feb 2009 01:55:19 -0000 1.28
+++ sys/dev/cardbus/if_rtw_cardbus.c 1 May 2009 16:43:35 -0000
@@ -141,7 +141,7 @@ struct rtw_cardbus_softc {
};
int rtw_cardbus_match(device_t, struct cfdata *, void *);
-void rtw_cardbus_attach(device_t, device_t, void *);
+int rtw_cardbus_attach(device_t, device_t, void *);
int rtw_cardbus_detach(device_t, int);
CFATTACH_DECL_NEW(rtw_cardbus, sizeof(struct rtw_cardbus_softc),
@@ -209,7 +209,7 @@ rtw_cardbus_funcregen(struct rtw_regs *r
rtw_config0123_enable(regs, 0);
}
-void
+int
rtw_cardbus_attach(device_t parent, device_t self, void *aux)
{
struct rtw_cardbus_softc *csc = device_private(self);
@@ -274,7 +274,7 @@ rtw_cardbus_attach(device_t parent, devi
csc->sc_bar_val = adr | CARDBUS_MAPREG_TYPE_IO;
} else {
aprint_error_dev(self, "unable to map device registers\n");
- return;
+ return ENXIO;
}
/*
@@ -305,6 +305,7 @@ rtw_cardbus_attach(device_t parent, devi
*/
pmf_device_suspend_self(self);
}
+ return 0;
}
int
Index: sys/dev/cardbus/if_tlp_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/if_tlp_cardbus.c,v
retrieving revision 1.61
diff -u -p -r1.61 if_tlp_cardbus.c
--- sys/dev/cardbus/if_tlp_cardbus.c 17 Apr 2009 10:20:32 -0000 1.61
+++ sys/dev/cardbus/if_tlp_cardbus.c 1 May 2009 16:43:35 -0000
@@ -113,7 +113,7 @@ struct tulip_cardbus_softc {
};
int tlp_cardbus_match(device_t, cfdata_t, void *);
-void tlp_cardbus_attach(device_t, device_t, void *);
+int tlp_cardbus_attach(device_t, device_t, void *);
int tlp_cardbus_detach(device_t, int);
CFATTACH_DECL_NEW(tlp_cardbus, sizeof(struct tulip_cardbus_softc),
@@ -229,7 +229,7 @@ tlp_cardbus_match(device_t parent, cfdat
return (0);
}
-void
+int
tlp_cardbus_attach(device_t parent, device_t self,
void *aux)
{
@@ -335,7 +335,7 @@ tlp_cardbus_attach(device_t parent, devi
csc->sc_bar_val = adr | CARDBUS_MAPREG_TYPE_IO;
} else {
aprint_error_dev(self, "unable to map device registers\n");
- return;
+ return ENXIO;
}
/*
@@ -443,7 +443,7 @@ tlp_cardbus_attach(device_t parent, devi
cant_cope:
printf("%s: sorry, unable to handle your board\n",
device_xname(self));
- return;
+ return ENXIO;
}
/* Remember which interrupt line. */
@@ -457,7 +457,7 @@ tlp_cardbus_attach(device_t parent, devi
/*
* Power down the socket.
*/
- Cardbus_function_disable(csc->sc_ct);
+ return Cardbus_function_disable(csc->sc_ct);
}
int
Index: sys/dev/cardbus/njata_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/njata_cardbus.c,v
retrieving revision 1.7
diff -u -p -r1.7 njata_cardbus.c
--- sys/dev/cardbus/njata_cardbus.c 24 Jun 2008 19:44:52 -0000 1.7
+++ sys/dev/cardbus/njata_cardbus.c 1 May 2009 16:43:35 -0000
@@ -65,7 +65,7 @@ struct njata32_cardbus_softc {
static const struct njata32_cardbus_product *njata_cardbus_lookup
(const struct cardbus_attach_args *);
static int njata_cardbus_match(device_t, cfdata_t, void *);
-static void njata_cardbus_attach(device_t, device_t, void *);
+static int njata_cardbus_attach(device_t, device_t, void *);
static int njata_cardbus_detach(struct device *, int);
CFATTACH_DECL_NEW(njata_cardbus, sizeof(struct njata32_cardbus_softc),
@@ -120,7 +120,7 @@ njata_cardbus_match(device_t parent, cfd
return 0;
}
-static void
+static int
njata_cardbus_attach(device_t parent, device_t self, void *aux)
{
struct cardbus_attach_args *ca = aux;
@@ -189,7 +189,7 @@ njata_cardbus_attach(device_t parent, de
} else {
aprint_error("%s: unable to map device registers\n",
NJATA32NAME(sc));
- return;
+ return ENXIO;
}
}
@@ -223,11 +223,12 @@ njata_cardbus_attach(device_t parent, de
if (sc->sc_ih == NULL) {
aprint_error("%s: unable to establish interrupt\n",
NJATA32NAME(sc));
- return;
+ return ENXIO;
}
/* attach */
njata32_attach(sc);
+ return 0;
}
static int
Index: sys/dev/cardbus/ohci_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/ohci_cardbus.c,v
retrieving revision 1.31
diff -u -p -r1.31 ohci_cardbus.c
--- sys/dev/cardbus/ohci_cardbus.c 11 Jul 2008 20:57:51 -0000 1.31
+++ sys/dev/cardbus/ohci_cardbus.c 1 May 2009 16:43:35 -0000
@@ -68,7 +68,7 @@ __KERNEL_RCSID(0, "$NetBSD: ohci_cardbus
#include <dev/usb/ohcivar.h>
int ohci_cardbus_match(device_t, struct cfdata *, void *);
-void ohci_cardbus_attach(device_t, device_t, void *);
+int ohci_cardbus_attach(device_t, device_t, void *);
int ohci_cardbus_detach(device_t, int);
struct ohci_cardbus_softc {
@@ -103,7 +103,7 @@ ohci_cardbus_match(device_t parent, stru
return (0);
}
-void
+int
ohci_cardbus_attach(device_t parent, device_t self, void *aux)
{
struct ohci_cardbus_softc *sc = device_private(self);
@@ -128,7 +128,7 @@ ohci_cardbus_attach(device_t parent, dev
if (Cardbus_mapreg_map(ct, CARDBUS_CBMEM, CARDBUS_MAPREG_TYPE_MEM, 0,
&sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
printf("%s: can't map mem space\n", devname);
- return;
+ return ENXIO;
}
sc->sc_cc = cc;
@@ -158,7 +158,7 @@ XXX (ct->ct_cf->cardbus_mem_open)(cc, 0,
IPL_USB, ohci_intr, sc);
if (sc->sc_ih == NULL) {
printf("%s: couldn't establish interrupt\n", devname);
- return;
+ return ENXIO;
}
/* Figure out vendor for root hub descriptor. */
@@ -178,7 +178,7 @@ XXX (ct->ct_cf->cardbus_mem_open)(cc, 0,
cardbus_intr_disestablish(sc->sc_cc, sc->sc_cf, sc->sc_ih);
sc->sc_ih = 0;
- return;
+ return ENXIO;
}
#if NEHCI_CARDBUS > 0
@@ -191,6 +191,7 @@ XXX (ct->ct_cf->cardbus_mem_open)(cc, 0,
/* Attach usb device. */
sc->sc.sc_child = config_found(self, &sc->sc.sc_bus, usbctlprint);
+ return 0;
}
int
Index: sys/dev/cardbus/uhci_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/uhci_cardbus.c,v
retrieving revision 1.12
diff -u -p -r1.12 uhci_cardbus.c
--- sys/dev/cardbus/uhci_cardbus.c 11 Jul 2008 21:02:53 -0000 1.12
+++ sys/dev/cardbus/uhci_cardbus.c 1 May 2009 16:43:35 -0000
@@ -68,7 +68,7 @@ struct uhci_cardbus_softc {
};
static int uhci_cardbus_match(device_t, struct cfdata *, void *);
-static void uhci_cardbus_attach(device_t, device_t, void *);
+static int uhci_cardbus_attach(device_t, device_t, void *);
static int uhci_cardbus_detach(device_t, int);
CFATTACH_DECL_NEW(uhci_cardbus, sizeof(struct uhci_cardbus_softc),
@@ -92,7 +92,7 @@ uhci_cardbus_match(device_t parent, stru
return (0);
}
-static void
+static int
uhci_cardbus_attach(device_t parent, device_t self,
void *aux)
{
@@ -118,7 +118,7 @@ uhci_cardbus_attach(device_t parent, dev
if (Cardbus_mapreg_map(ct, CARDBUS_CBIO, CARDBUS_MAPREG_TYPE_IO, 0,
&sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
printf("%s: can't map i/o space\n", devname);
- return;
+ return ENXIO;
}
sc->sc_cc = cc;
@@ -148,7 +148,7 @@ XXX (ct->ct_cf->cardbus_io_open)(cc, 0,
IPL_USB, uhci_intr, sc);
if (sc->sc_ih == NULL) {
printf("%s: couldn't establish interrupt\n", devname);
- return;
+ return ENXIO;
}
/* Set LEGSUP register to its default value. */
@@ -186,7 +186,7 @@ XXX (ct->ct_cf->cardbus_io_open)(cc, 0,
cardbus_intr_disestablish(sc->sc_cc, sc->sc_cf, sc->sc_ih);
sc->sc_ih = NULL;
- return;
+ return ENXIO;
}
#if NEHCI_CARDBUS > 0
@@ -195,6 +195,7 @@ XXX (ct->ct_cf->cardbus_io_open)(cc, 0,
/* Attach usb device. */
sc->sc.sc_child = config_found(self, &sc->sc.sc_bus, usbctlprint);
+ return 0;
}
static int
Index: sys/dev/dkwedge/dk.c
===================================================================
RCS file: /cvsroot/src/sys/dev/dkwedge/dk.c,v
retrieving revision 1.43
diff -u -p -r1.43 dk.c
--- sys/dev/dkwedge/dk.c 13 Jan 2009 13:35:53 -0000 1.43
+++ sys/dev/dkwedge/dk.c 1 May 2009 16:43:35 -0000
@@ -138,13 +138,14 @@ dkwedge_match(struct device *parent, str
*
* Autoconfiguration attach function for pseudo-device glue.
*/
-static void
+static int
dkwedge_attach(struct device *parent, struct device *self,
void *aux)
{
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
/*
Index: sys/dev/i2c/i2c.c
===================================================================
RCS file: /cvsroot/src/sys/dev/i2c/i2c.c,v
retrieving revision 1.23
diff -u -p -r1.23 i2c.c
--- sys/dev/i2c/i2c.c 3 Feb 2009 16:41:31 -0000 1.23
+++ sys/dev/i2c/i2c.c 1 May 2009 16:43:35 -0000
@@ -105,7 +105,7 @@ iic_match(device_t parent, cfdata_t cf,
return (1);
}
-static void
+static int
iic_attach(device_t parent, device_t self, void *aux)
{
struct iic_softc *sc = device_private(self);
@@ -201,6 +201,7 @@ iic_attach(device_t parent, device_t sel
* configuration file.
*/
config_search_ia(iic_search, self, "iic", NULL);
+ return 0;
}
static void
Index: sys/dev/i2o/iopsp.c
===================================================================
RCS file: /cvsroot/src/sys/dev/i2o/iopsp.c,v
retrieving revision 1.33
diff -u -p -r1.33 iopsp.c
--- sys/dev/i2o/iopsp.c 8 Sep 2008 23:36:54 -0000 1.33
+++ sys/dev/i2o/iopsp.c 1 May 2009 16:43:35 -0000
@@ -63,7 +63,7 @@ __KERNEL_RCSID(0, "$NetBSD: iopsp.c,v 1.
#include <dev/i2o/iopspvar.h>
static void iopsp_adjqparam(struct device *, int);
-static void iopsp_attach(struct device *, struct device *, void *);
+static int iopsp_attach(struct device *, struct device *, void *);
static void iopsp_intr(struct device *, struct iop_msg *, void *);
static int iopsp_ioctl(struct scsipi_channel *, u_long,
void *, int, struct proc *);
@@ -105,7 +105,7 @@ iopsp_match(struct device *parent, struc
/*
* Attach a supported device.
*/
-static void
+static int
iopsp_attach(struct device *parent, struct device *self, void *aux)
{
struct iop_attach_args *ia;
@@ -198,10 +198,11 @@ iopsp_attach(struct device *parent, stru
goto bad;
}
config_found(self, &sc->sc_channel, scsiprint);
- return;
+ return 0;
bad:
iop_initiator_unregister(iop, &sc->sc_ii);
+ return ENXIO;
}
/*
Index: sys/dev/i2o/ld_iop.c
===================================================================
RCS file: /cvsroot/src/sys/dev/i2o/ld_iop.c,v
retrieving revision 1.33
diff -u -p -r1.33 ld_iop.c
--- sys/dev/i2o/ld_iop.c 15 Dec 2008 18:35:48 -0000 1.33
+++ sys/dev/i2o/ld_iop.c 1 May 2009 16:43:35 -0000
@@ -75,7 +75,7 @@ struct ld_iop_softc {
};
static void ld_iop_adjqparam(device_t, int);
-static void ld_iop_attach(device_t, device_t, void *);
+static int ld_iop_attach(device_t, device_t, void *);
static int ld_iop_detach(device_t, int);
static int ld_iop_dump(struct ld_softc *, void *, int, int);
static int ld_iop_flush(struct ld_softc *, int);
@@ -116,7 +116,7 @@ ld_iop_match(device_t parent, cfdata_t m
return (ia->ia_class == I2O_CLASS_RANDOM_BLOCK_STORAGE);
}
-static void
+static int
ld_iop_attach(device_t parent, device_t self, void *aux)
{
struct iop_attach_args *ia = aux;
@@ -272,10 +272,11 @@ ld_iop_attach(device_t parent, device_t
aprint_error_dev(self, "device not yet supported\n");
ldattach(ld);
- return;
+ return 0;
bad:
ld_iop_unconfig(sc, evreg);
+ return ENXIO;
}
static void
Index: sys/dev/ic/icpsp.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/icpsp.c,v
retrieving revision 1.21
diff -u -p -r1.21 icpsp.c
--- sys/dev/ic/icpsp.c 28 Apr 2008 20:23:50 -0000 1.21
+++ sys/dev/ic/icpsp.c 1 May 2009 16:43:35 -0000
@@ -65,7 +65,7 @@ struct icpsp_softc {
int sc_openings;
};
-void icpsp_attach(struct device *, struct device *, void *);
+int icpsp_attach(struct device *, struct device *, void *);
void icpsp_intr(struct icp_ccb *);
int icpsp_match(struct device *, struct cfdata *, void *);
void icpsp_scsipi_request(struct scsipi_channel *, scsipi_adapter_req_t,
@@ -91,7 +91,7 @@ icpsp_match(struct device *parent, struc
return (icpa->icpa_unit >= ICPA_UNIT_SCSI);
}
-void
+int
icpsp_attach(struct device *parent, struct device *self, void *aux)
{
struct icp_attach_args *icpa;
@@ -125,6 +125,7 @@ icpsp_attach(struct device *parent, stru
sc->sc_channel.chan_flags = SCSIPI_CHAN_NOSETTLE;
config_found(self, &sc->sc_channel, scsiprint);
+ return 0;
}
void
Index: sys/dev/ic/ld_aac.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/ld_aac.c,v
retrieving revision 1.22
diff -u -p -r1.22 ld_aac.c
--- sys/dev/ic/ld_aac.c 2 Oct 2008 08:21:57 -0000 1.22
+++ sys/dev/ic/ld_aac.c 1 May 2009 16:43:35 -0000
@@ -61,7 +61,7 @@ struct ld_aac_softc {
int sc_hwunit;
};
-static void ld_aac_attach(device_t, device_t, void *);
+static int ld_aac_attach(device_t, device_t, void *);
static void ld_aac_intr(struct aac_ccb *);
static int ld_aac_dobio(struct ld_aac_softc *, void *, int, daddr_t, int,
struct buf *);
@@ -79,7 +79,7 @@ ld_aac_match(device_t parent, cfdata_t m
return (1);
}
-static void
+static int
ld_aac_attach(device_t parent, device_t self, void *aux)
{
struct aac_attach_args *aaca = aux;
@@ -103,6 +103,7 @@ ld_aac_attach(device_t parent, device_t
aprint_normal(": %s\n",
aac_describe_code(aac_container_types, hdr->hd_devtype));
ldattach(ld);
+ return 0;
}
static int
Index: sys/dev/ic/ld_cac.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/ld_cac.c,v
retrieving revision 1.24
diff -u -p -r1.24 ld_cac.c
--- sys/dev/ic/ld_cac.c 21 Mar 2009 19:44:26 -0000 1.24
+++ sys/dev/ic/ld_cac.c 1 May 2009 16:43:35 -0000
@@ -66,7 +66,7 @@ struct ld_cac_softc {
struct timeval sc_serrtm;
};
-void ld_cac_attach(device_t, device_t, void *);
+int ld_cac_attach(device_t, device_t, void *);
void ld_cac_done(device_t, void *, int);
int ld_cac_dump(struct ld_softc *, void *, int, int);
int ld_cac_match(device_t, cfdata_t, void *);
@@ -84,7 +84,7 @@ ld_cac_match(device_t parent, cfdata_t m
return (1);
}
-void
+int
ld_cac_attach(device_t parent, device_t self, void *aux)
{
struct cac_drive_info dinfo;
@@ -102,7 +102,7 @@ ld_cac_attach(device_t parent, device_t
if (cac_cmd(cac, CAC_CMD_GET_LOG_DRV_INFO, &dinfo, sizeof(dinfo),
sc->sc_hwunit, 0, CAC_CCB_DATA_IN, NULL)) {
aprint_error(": CMD_GET_LOG_DRV_INFO failed\n");
- return;
+ return ENXIO;
}
ld->sc_secsize = CAC_GET2(dinfo.secsize);
@@ -136,6 +136,7 @@ ld_cac_attach(device_t parent, device_t
/* XXX We should verify this... */
ld->sc_flags = LDF_ENABLED;
ldattach(ld);
+ return 0;
}
int
Index: sys/dev/ic/ld_icp.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/ld_icp.c,v
retrieving revision 1.23
diff -u -p -r1.23 ld_icp.c
--- sys/dev/ic/ld_icp.c 29 Jan 2009 12:14:40 -0000 1.23
+++ sys/dev/ic/ld_icp.c 1 May 2009 16:43:35 -0000
@@ -65,7 +65,7 @@ struct ld_icp_softc {
int sc_hwunit;
};
-void ld_icp_attach(device_t, device_t, void *);
+int ld_icp_attach(device_t, device_t, void *);
int ld_icp_detach(device_t, int);
int ld_icp_dobio(struct ld_icp_softc *, void *, int, int, int,
struct buf *);
@@ -94,7 +94,7 @@ ld_icp_match(device_t parent, cfdata_t m
return (icpa->icpa_unit < ICPA_UNIT_SCSI);
}
-void
+int
ld_icp_attach(device_t parent, device_t self, void *aux)
{
struct icp_attach_args *icpa = aux;
@@ -166,6 +166,7 @@ ld_icp_attach(device_t parent, device_t
out:
ldattach(ld);
+ return 0;
}
int
Index: sys/dev/ic/ld_mlx.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/ld_mlx.c,v
retrieving revision 1.19
diff -u -p -r1.19 ld_mlx.c
--- sys/dev/ic/ld_mlx.c 16 Jan 2009 04:20:28 -0000 1.19
+++ sys/dev/ic/ld_mlx.c 1 May 2009 16:43:35 -0000
@@ -65,7 +65,7 @@ struct ld_mlx_softc {
int sc_hwunit;
};
-static void ld_mlx_attach(device_t, device_t, void *);
+static int ld_mlx_attach(device_t, device_t, void *);
static int ld_mlx_detach(device_t, int);
static int ld_mlx_dobio(struct ld_mlx_softc *, void *, int, int, int,
struct buf *);
@@ -84,7 +84,7 @@ ld_mlx_match(device_t parent, cfdata_t m
return (1);
}
-static void
+static int
ld_mlx_attach(device_t parent, device_t self, void *aux)
{
struct mlx_attach_args *mlxa = aux;
@@ -133,6 +133,7 @@ ld_mlx_attach(device_t parent, device_t
aprint_normal(": RAID%d, %s\n", ms->ms_raidlevel, statestr);
ldattach(ld);
+ return 0;
}
static int
Index: sys/dev/ieee1394/firewire.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ieee1394/firewire.c,v
retrieving revision 1.24
diff -u -p -r1.24 firewire.c
--- sys/dev/ieee1394/firewire.c 18 Mar 2009 16:00:18 -0000 1.24
+++ sys/dev/ieee1394/firewire.c 1 May 2009 16:43:36 -0000
@@ -197,7 +197,7 @@ static int firewire_shutdown (device_
static device_t firewire_add_child (device_t, int, const char *, int);
#elif defined(__NetBSD__)
int firewirematch (device_t, struct cfdata *, void *);
-void firewireattach (device_t, device_t, void *);
+int firewireattach (device_t, device_t, void *);
int firewiredetach (device_t, int);
int firewire_print (void *, const char *);
int firewire_resume (struct firewire_comm *);
Index: sys/dev/ieee1394/fw_port.h
===================================================================
RCS file: /cvsroot/src/sys/dev/ieee1394/fw_port.h,v
retrieving revision 1.32
diff -u -p -r1.32 fw_port.h
--- sys/dev/ieee1394/fw_port.h 20 Apr 2009 09:56:07 -0000 1.32
+++ sys/dev/ieee1394/fw_port.h 1 May 2009 16:43:36 -0000
@@ -830,13 +830,13 @@ fw_bus_dmamem_alloc(fw_bus_dma_tag_t ft,
* fw attach macro for NetBSD
*/
#define FW_ATTACH(dname) \
- void \
+ int \
__CONCAT(dname,attach) \
(device_t parent, device_t self, void *aux)
#define FW_ATTACH_START(dname, sc, fwa)
\
struct __CONCAT(dname,_softc) *sc = device_private(self); \
__unused struct fw_attach_args *fwa = (struct fw_attach_args *)aux
-#define FW_ATTACH_RETURN(r) return
+#define FW_ATTACH_RETURN(r) return r
/*
* fw detach macro for NetBSD
@@ -1153,7 +1153,7 @@ fw_bus_dmamem_alloc(fw_bus_dma_tag_t ft,
config_found(sbp->fd.dev, sc_channel, scsiprint)) == \
NULL) { \
fw_printf(sbp->fd.dev, "attach failed\n"); \
- return; \
+ return ENXIO; \
} \
} while (/*CONSTCOND*/0)
#define SBP_DEVICE(d) ((d)->periph)
Index: sys/dev/ieee1394/if_fwip.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ieee1394/if_fwip.c,v
retrieving revision 1.18
diff -u -p -r1.18 if_fwip.c
--- sys/dev/ieee1394/if_fwip.c 18 Mar 2009 16:00:18 -0000 1.18
+++ sys/dev/ieee1394/if_fwip.c 1 May 2009 16:43:36 -0000
@@ -115,7 +115,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_fwip.c,v
#if defined(__NetBSD__)
int fwipmatch (device_t, struct cfdata *, void *);
-void fwipattach (device_t, device_t, void *);
+int fwipattach (device_t, device_t, void *);
int fwipdetach (device_t, int);
int fwipactivate (device_t, enum devact);
Index: sys/dev/ieee1394/sbp.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ieee1394/sbp.c,v
retrieving revision 1.27
diff -u -p -r1.27 sbp.c
--- sys/dev/ieee1394/sbp.c 18 Apr 2009 14:58:02 -0000 1.27
+++ sys/dev/ieee1394/sbp.c 1 May 2009 16:43:37 -0000
@@ -439,7 +439,7 @@ struct sbp_softc {
#if defined(__NetBSD__)
int sbpmatch (device_t, struct cfdata *, void *);
-void sbpattach (device_t parent, device_t self, void *aux);
+int sbpattach (device_t parent, device_t self, void *aux);
int sbpdetach (device_t self, int flags);
#endif
static void sbp_post_explore (void *);
Index: sys/dev/ir/irframe.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ir/irframe.c,v
retrieving revision 1.43
diff -u -p -r1.43 irframe.c
--- sys/dev/ir/irframe.c 11 Jan 2009 14:21:48 -0000 1.43
+++ sys/dev/ir/irframe.c 1 May 2009 16:43:37 -0000
@@ -97,7 +97,7 @@ irframe_match(device_t parent, cfdata_t
return (ia->ia_type == IR_TYPE_IRFRAME);
}
-void
+int
irframe_attach(device_t parent, device_t self, void *aux)
{
struct irframe_softc *sc = device_private(self);
@@ -143,6 +143,7 @@ irframe_attach(device_t parent, device_t
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
int
Index: sys/dev/ir/irframe_tty.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ir/irframe_tty.c,v
retrieving revision 1.56
diff -u -p -r1.56 irframe_tty.c
--- sys/dev/ir/irframe_tty.c 11 Jan 2009 14:28:13 -0000 1.56
+++ sys/dev/ir/irframe_tty.c 1 May 2009 16:43:38 -0000
@@ -196,7 +196,7 @@ static struct linesw irframet_disc = {
};
/* glue to attach irframe device */
-static void irframet_attach(struct device *, struct device *, void *);
+static int irframet_attach(struct device *, struct device *, void *);
static int irframet_detach(struct device *, int);
CFATTACH_DECL_NEW(irframet, sizeof(struct irframet_softc),
@@ -216,7 +216,7 @@ irframettyattach(int n)
config_cfattach_attach("irframe", &irframet_ca);
}
-static void
+static int
irframet_attach(device_t parent, device_t self, void *aux)
{
struct irframet_softc *sc = device_private(self);
@@ -237,6 +237,7 @@ irframet_attach(device_t parent, device_
irframe_attach(parent, self, &ia);
#endif
+ return 0;
}
static int
Index: sys/dev/ir/irframevar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/ir/irframevar.h,v
retrieving revision 1.18
diff -u -p -r1.18 irframevar.h
--- sys/dev/ir/irframevar.h 28 Apr 2008 20:23:51 -0000 1.18
+++ sys/dev/ir/irframevar.h 1 May 2009 16:43:38 -0000
@@ -58,5 +58,5 @@ struct irframe_softc {
#define IRDA_MAX_FRAME_SIZE 2048
#define IRDA_MAX_EBOFS 64
-void irframe_attach(struct device *, struct device *, void *);
+int irframe_attach(struct device *, struct device *, void *);
int irframe_detach(struct device *, int);
Index: sys/dev/isa/attimer_isa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/attimer_isa.c,v
retrieving revision 1.11
diff -u -p -r1.11 attimer_isa.c
--- sys/dev/isa/attimer_isa.c 29 Apr 2008 06:53:03 -0000 1.11
+++ sys/dev/isa/attimer_isa.c 1 May 2009 16:43:38 -0000
@@ -75,7 +75,7 @@ __KERNEL_RCSID(0, "$NetBSD: attimer_isa.
#include <dev/isa/isavar.h>
static int attimer_isa_match(device_t, struct cfdata *, void *);
-static void attimer_isa_attach(device_t, device_t, void *);
+static int attimer_isa_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(attimer_isa, sizeof(struct attimer_softc),
attimer_isa_match, attimer_isa_attach, attimer_detach, NULL);
@@ -122,7 +122,7 @@ attimer_isa_match(device_t parent, cfdat
return 1;
}
-static void
+static int
attimer_isa_attach(device_t parent, device_t self, void *aux)
{
struct attimer_softc *sc = device_private(self);
@@ -140,4 +140,6 @@ attimer_isa_attach(device_t parent, devi
aprint_error_dev(self, "could not map registers\n");
else
attimer_attach(sc);
+
+ return 0;
}
Index: sys/dev/isa/com_isa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/com_isa.c,v
retrieving revision 1.35
diff -u -p -r1.35 com_isa.c
--- sys/dev/isa/com_isa.c 2 Apr 2009 00:09:33 -0000 1.35
+++ sys/dev/isa/com_isa.c 1 May 2009 16:43:38 -0000
@@ -100,7 +100,7 @@ static bool com_isa_suspend(device_t PMF
static bool com_isa_resume(device_t PMF_FN_PROTO);
int com_isa_probe(device_t, cfdata_t , void *);
-void com_isa_attach(device_t, device_t, void *);
+int com_isa_attach(device_t, device_t, void *);
static int com_isa_detach(device_t, int);
#ifdef COM_HAYESP
int com_isa_isHAYESP(bus_space_handle_t, struct com_softc *);
@@ -160,7 +160,7 @@ com_isa_probe(device_t parent, cfdata_t
return (rv);
}
-void
+int
com_isa_attach(device_t parent, device_t self, void *aux)
{
struct com_isa_softc *isc = device_private(self);
@@ -183,7 +183,7 @@ com_isa_attach(device_t parent, device_t
if (!com_is_console(iot, iobase, &ioh) &&
bus_space_map(iot, iobase, COM_NPORTS, 0, &ioh)) {
printf(": can't map i/o space\n");
- return;
+ return ENXIO;
}
sc->sc_dev = self;
@@ -216,6 +216,7 @@ com_isa_attach(device_t parent, device_t
isc->sc_irq = irq;
isc->sc_ih = isa_intr_establish(ia->ia_ic, irq, IST_EDGE, IPL_SERIAL,
comintr, sc);
+ return 0;
}
static bool
Index: sys/dev/isa/fd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/fd.c,v
retrieving revision 1.91
diff -u -p -r1.91 fd.c
--- sys/dev/isa/fd.c 13 Jan 2009 13:35:53 -0000 1.91
+++ sys/dev/isa/fd.c 1 May 2009 16:43:38 -0000
@@ -204,7 +204,7 @@ const struct fd_type fd_types[] = {
void fdcfinishattach(device_t);
int fdprobe(device_t, struct cfdata *, void *);
-void fdattach(device_t, device_t, void *);
+int fdattach(device_t, device_t, void *);
static int fddetach(device_t, int);
static int fdcintr1(struct fdc_softc *);
static void fdcintrcb(void *);
@@ -534,7 +534,7 @@ fdprobe(device_t parent, cfdata_t match,
/*
* Controller is working, and drive responded. Attach it.
*/
-void
+int
fdattach(device_t parent, device_t self, void *aux)
{
struct fdc_softc *fdc = device_private(parent);
@@ -583,6 +583,7 @@ fdattach(device_t parent, device_t self,
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "cannot set power mgmt handler\n");
+ return 0;
}
static int
Index: sys/dev/isa/fdc_isa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/fdc_isa.c,v
retrieving revision 1.18
diff -u -p -r1.18 fdc_isa.c
--- sys/dev/isa/fdc_isa.c 28 Apr 2008 20:23:52 -0000 1.18
+++ sys/dev/isa/fdc_isa.c 1 May 2009 16:43:38 -0000
@@ -88,7 +88,7 @@ __KERNEL_RCSID(0, "$NetBSD: fdc_isa.c,v
#include <dev/isa/fdcvar.h>
static int fdc_isa_probe(device_t, cfdata_t, void *);
-static void fdc_isa_attach(device_t, device_t, void *);
+static int fdc_isa_attach(device_t, device_t, void *);
static int fdc_isa_detach(device_t, int);
struct fdc_isa_softc {
@@ -198,7 +198,7 @@ fdc_isa_detach(device_t self, int flags)
return 0;
}
-static void
+static int
fdc_isa_attach(device_t parent, device_t self, void *aux)
{
struct fdc_isa_softc *isc = device_private(self);
@@ -216,25 +216,26 @@ fdc_isa_attach(device_t parent, device_t
if (bus_space_map(fdc->sc_iot, ia->ia_io[0].ir_addr,
6 /* FDC_NPORT */, 0, &isc->sc_baseioh)) {
aprint_normal_dev(fdc->sc_dev, "unable to map I/O space\n");
- return;
+ return ENXIO;
}
if (bus_space_subregion(fdc->sc_iot, isc->sc_baseioh, 2, 4,
&fdc->sc_ioh)) {
aprint_normal_dev(fdc->sc_dev,
"unable to subregion I/O space\n");
- return;
+ return ENXIO;
}
if (bus_space_map(fdc->sc_iot, ia->ia_io[0].ir_addr + fdctl + 2, 1, 0,
&fdc->sc_fdctlioh)) {
aprint_normal_dev(fdc->sc_dev,
"unable to map CTL I/O space\n");
- return;
+ return ENXIO;
}
fdc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq,
IST_EDGE, IPL_BIO, fdcintr, fdc);
fdcattach(fdc);
+ return 0;
}
Index: sys/dev/isa/isa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/isa.c,v
retrieving revision 1.135
diff -u -p -r1.135 isa.c
--- sys/dev/isa/isa.c 7 Apr 2009 21:48:46 -0000 1.135
+++ sys/dev/isa/isa.c 1 May 2009 16:43:38 -0000
@@ -55,7 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: isa.c,v 1.13
#include "locators.h"
int isamatch(device_t, cfdata_t, void *);
-void isaattach(device_t, device_t, void *);
+int isaattach(device_t, device_t, void *);
int isarescan(device_t, const char *, const int *);
void isachilddetached(device_t, device_t);
int isaprint(void *, const char *);
@@ -79,7 +79,7 @@ isamatch(device_t parent, cfdata_t cf, v
return (1);
}
-void
+int
isaattach(device_t parent, device_t self, void *aux)
{
struct isa_softc *sc = device_private(self);
@@ -135,6 +135,7 @@ isaattach(device_t parent, device_t self
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
int
Index: sys/dev/isa/lpt_isa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/lpt_isa.c,v
retrieving revision 1.67
diff -u -p -r1.67 lpt_isa.c
--- sys/dev/isa/lpt_isa.c 31 May 2008 14:07:03 -0000 1.67
+++ sys/dev/isa/lpt_isa.c 1 May 2009 16:43:38 -0000
@@ -92,7 +92,7 @@ struct lpt_isa_softc {
};
int lpt_isa_probe(device_t, cfdata_t, void *);
-static void lpt_isa_attach(device_t, device_t, void *);
+static int lpt_isa_attach(device_t, device_t, void *);
static int lpt_isa_detach(device_t, int);
CFATTACH_DECL_NEW(lpt_isa, sizeof(struct lpt_isa_softc),
@@ -214,7 +214,7 @@ out:
return rv;
}
-void
+int
lpt_isa_attach(device_t parent, device_t self, void *aux)
{
struct lpt_isa_softc *sc = device_private(self);
@@ -240,7 +240,7 @@ lpt_isa_attach(device_t parent, device_t
iot = lsc->sc_iot = ia->ia_iot;
if (bus_space_map(iot, ia->ia_io[0].ir_addr, LPT_NPORTS, 0, &ioh)) {
aprint_normal_dev(self, "can't map i/o space\n");
- return;
+ return ENXIO;
}
lsc->sc_ioh = ioh;
@@ -250,6 +250,7 @@ lpt_isa_attach(device_t parent, device_t
if (sc->sc_irq != -1)
lsc->sc_ih = isa_intr_establish(sc->sc_ic, sc->sc_irq,
IST_EDGE, IPL_TTY, lptintr, lsc);
+ return 0;
}
static int
Index: sys/dev/isa/midi_pcppi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/midi_pcppi.c,v
retrieving revision 1.23
diff -u -p -r1.23 midi_pcppi.c
--- sys/dev/isa/midi_pcppi.c 10 Apr 2009 10:18:50 -0000 1.23
+++ sys/dev/isa/midi_pcppi.c 1 May 2009 16:43:38 -0000
@@ -61,7 +61,7 @@ struct midi_pcppi_softc {
};
static int midi_pcppi_match(device_t, cfdata_t , void *);
-static void midi_pcppi_attach(device_t, device_t, void *);
+static int midi_pcppi_attach(device_t, device_t, void *);
static int midi_pcppi_detach(device_t, int);
void midi_pcppi_on (midisyn *, uint_fast16_t, midipitch_t, int16_t);
@@ -88,7 +88,7 @@ midi_pcppi_match(device_t parent, cfdata
return (!midi_pcppi_attached);
}
-static void
+static int
midi_pcppi_attach(device_t parent, device_t self, void *aux)
{
struct midi_pcppi_softc *sc = device_private(self);
@@ -110,6 +110,7 @@ midi_pcppi_attach(device_t parent, devic
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self,
"couldn't establish power handler\n");
+ return 0;
}
static int
Index: sys/dev/isa/pckbc_isa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/pckbc_isa.c,v
retrieving revision 1.25
diff -u -p -r1.25 pckbc_isa.c
--- sys/dev/isa/pckbc_isa.c 25 May 2008 16:19:12 -0000 1.25
+++ sys/dev/isa/pckbc_isa.c 1 May 2009 16:43:39 -0000
@@ -48,7 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: pckbc_isa.c,
#include <dev/ic/pckbcvar.h>
int pckbc_isa_match(device_t, cfdata_t, void *);
-void pckbc_isa_attach(device_t, device_t, void *);
+int pckbc_isa_attach(device_t, device_t, void *);
struct pckbc_isa_softc {
struct pckbc_softc sc_pckbc;
@@ -141,7 +141,7 @@ pckbc_isa_match(device_t parent, cfdata_
return (ok);
}
-void
+int
pckbc_isa_attach(device_t parent, device_t self, void *aux)
{
struct pckbc_isa_softc *isc = device_private(self);
@@ -208,6 +208,7 @@ pckbc_isa_attach(device_t parent, device
/* Finish off the attach. */
pckbc_attach(sc);
+ return 0;
}
void
Index: sys/dev/isa/pcppi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/pcppi.c,v
retrieving revision 1.35
diff -u -p -r1.35 pcppi.c
--- sys/dev/isa/pcppi.c 17 Apr 2009 20:46:37 -0000 1.35
+++ sys/dev/isa/pcppi.c 1 May 2009 16:43:39 -0000
@@ -57,7 +57,7 @@ void pcppi_pckbd_bell(void *, u_int, u_i
#endif
int pcppi_match(device_t, cfdata_t, void *);
-void pcppi_isa_attach(device_t, device_t, void *);
+int pcppi_isa_attach(device_t, device_t, void *);
void pcppi_childdet(device_t, device_t);
CFATTACH_DECL3_NEW(pcppi, sizeof(struct pcppi_softc),
@@ -152,7 +152,7 @@ lose:
return (rv);
}
-void
+int
pcppi_isa_attach(device_t parent, device_t self, void *aux)
{
struct pcppi_softc *sc = device_private(self);
@@ -168,6 +168,7 @@ pcppi_isa_attach(device_t parent, device
aprint_normal("\n");
pcppi_attach(sc);
+ return 0;
}
void
Index: sys/dev/isa/wdc_isa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/wdc_isa.c,v
retrieving revision 1.56
diff -u -p -r1.56 wdc_isa.c
--- sys/dev/isa/wdc_isa.c 2 Apr 2009 00:09:33 -0000 1.56
+++ sys/dev/isa/wdc_isa.c 1 May 2009 16:43:39 -0000
@@ -68,7 +68,7 @@ struct wdc_isa_softc {
};
static int wdc_isa_probe(device_t , cfdata_t, void *);
-static void wdc_isa_attach(device_t, device_t, void *);
+static int wdc_isa_attach(device_t, device_t, void *);
static int wdc_isa_detach(device_t, int);
CFATTACH_DECL3_NEW(wdc_isa, sizeof(struct wdc_isa_softc),
@@ -164,7 +164,7 @@ wdc_isa_detach(device_t self, int flags)
return 0;
}
-static void
+static int
wdc_isa_attach(device_t parent, device_t self, void *aux)
{
struct wdc_isa_softc *sc = device_private(self);
@@ -184,7 +184,7 @@ wdc_isa_attach(device_t parent, device_t
ia->ia_io[0].ir_addr + WDC_ISA_AUXREG_OFFSET,
WDC_ISA_AUXREG_NPORTS, 0, &wdr->ctl_ioh)) {
aprint_error(": couldn't map registers\n");
- return;
+ return ENXIO;
}
for (i = 0; i < WDC_ISA_REG_NPORTS; i++) {
@@ -192,7 +192,7 @@ wdc_isa_attach(device_t parent, device_t
wdr->cmd_baseioh, i, i == 0 ? 4 : 1,
&wdr->cmd_iohs[i]) != 0) {
aprint_error(": couldn't subregion registers\n");
- return;
+ return ENXIO;
}
}
@@ -236,6 +236,7 @@ wdc_isa_attach(device_t parent, device_t
IST_EDGE, IPL_BIO, wdcintr, &sc->ata_channel);
wdcattach(&sc->ata_channel);
+ return 0;
}
#if 0
Index: sys/dev/mii/acphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/acphy.c,v
retrieving revision 1.23
diff -u -p -r1.23 acphy.c
--- sys/dev/mii/acphy.c 17 Nov 2008 03:04:27 -0000 1.23
+++ sys/dev/mii/acphy.c 1 May 2009 16:43:39 -0000
@@ -59,7 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: acphy.c,v 1.
#include <dev/mii/acphyreg.h>
static int acphymatch(device_t, cfdata_t, void *);
-static void acphyattach(device_t, device_t, void *);
+static int acphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(acphy, sizeof(struct mii_softc),
acphymatch, acphyattach, mii_phy_detach, mii_phy_activate);
@@ -100,7 +100,7 @@ acphymatch(device_t parent, cfdata_t mat
return (0);
}
-static void
+static int
acphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -146,6 +146,8 @@ acphyattach(device_t parent, device_t se
else
mii_phy_add_media(sc);
aprint_normal("\n");
+
+ return 0;
}
static int
Index: sys/dev/mii/amhphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/amhphy.c,v
retrieving revision 1.19
diff -u -p -r1.19 amhphy.c
--- sys/dev/mii/amhphy.c 17 Nov 2008 03:04:27 -0000 1.19
+++ sys/dev/mii/amhphy.c 1 May 2009 16:43:39 -0000
@@ -59,7 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1
#include <dev/mii/amhphyreg.h>
static int amhphymatch(device_t, cfdata_t, void *);
-static void amhphyattach(device_t, device_t, void *);
+static int amhphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(amhphy, sizeof(struct mii_softc),
amhphymatch, amhphyattach, mii_phy_detach, mii_phy_activate);
@@ -90,7 +90,7 @@ amhphymatch(device_t parent, cfdata_t ma
return (0);
}
-static void
+static int
amhphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -120,6 +120,8 @@ amhphyattach(device_t parent, device_t s
else
mii_phy_add_media(sc);
aprint_normal("\n");
+
+ return 0;
}
static int
Index: sys/dev/mii/atphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/atphy.c,v
retrieving revision 1.5
diff -u -p -r1.5 atphy.c
--- sys/dev/mii/atphy.c 27 Mar 2009 04:42:50 -0000 1.5
+++ sys/dev/mii/atphy.c 1 May 2009 16:43:39 -0000
@@ -75,7 +75,7 @@ __KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.
#define ATPHY_SSR_1000MBS 0x8000
static int atphy_match(device_t, cfdata_t, void *);
-static void atphy_attach(device_t, device_t, void *);
+static int atphy_attach(device_t, device_t, void *);
static int atphy_service(struct mii_softc *, struct mii_data *, int);
static void atphy_reset(struct mii_softc *);
@@ -109,7 +109,7 @@ atphy_match(device_t parent, cfdata_t ma
return 0;
}
-void
+static int
atphy_attach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -140,6 +140,8 @@ atphy_attach(device_t parent, device_t s
aprint_normal_dev(self, "");
mii_phy_add_media(sc);
aprint_normal("\n");
+
+ return 0;
}
int
Index: sys/dev/mii/bmtphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/bmtphy.c,v
retrieving revision 1.29
diff -u -p -r1.29 bmtphy.c
--- sys/dev/mii/bmtphy.c 18 Jan 2009 10:00:51 -0000 1.29
+++ sys/dev/mii/bmtphy.c 1 May 2009 16:43:39 -0000
@@ -85,7 +85,7 @@ __KERNEL_RCSID(0, "$NetBSD: bmtphy.c,v 1
#include <dev/mii/bmtphyreg.h>
static int bmtphymatch(device_t, cfdata_t, void *);
-static void bmtphyattach(device_t, device_t, void *);
+static int bmtphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(bmtphy, sizeof(struct mii_softc),
bmtphymatch, bmtphyattach, mii_phy_detach, mii_phy_activate);
@@ -129,7 +129,7 @@ bmtphymatch(device_t parent, cfdata_t ma
return (0);
}
-static void
+static int
bmtphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -164,6 +164,7 @@ bmtphyattach(device_t parent, device_t s
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/brgphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/brgphy.c,v
retrieving revision 1.44
diff -u -p -r1.44 brgphy.c
--- sys/dev/mii/brgphy.c 23 Apr 2009 10:47:43 -0000 1.44
+++ sys/dev/mii/brgphy.c 1 May 2009 16:43:39 -0000
@@ -91,7 +91,7 @@ __KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1
#endif
static int brgphymatch(device_t, cfdata_t, void *);
-static void brgphyattach(device_t, device_t, void *);
+static int brgphyattach(device_t, device_t, void *);
struct brgphy_softc {
struct mii_softc sc_mii;
@@ -198,7 +198,7 @@ brgphymatch(struct device *parent, struc
return (0);
}
-static void
+static int
brgphyattach(struct device *parent, struct device *self, void *aux)
{
struct brgphy_softc *bsc = device_private(self);
@@ -251,6 +251,7 @@ brgphyattach(struct device *parent, stru
prop_dictionary_get_uint32(dict, "phyflags",
&bsc->sc_bnx_flags);
}
+ return 0;
}
static int
Index: sys/dev/mii/ciphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/ciphy.c,v
retrieving revision 1.17
diff -u -p -r1.17 ciphy.c
--- sys/dev/mii/ciphy.c 14 Mar 2009 15:36:18 -0000 1.17
+++ sys/dev/mii/ciphy.c 1 May 2009 16:43:39 -0000
@@ -59,7 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.
#include <dev/mii/ciphyreg.h>
static int ciphymatch(device_t, cfdata_t, void *);
-static void ciphyattach(device_t, device_t, void *);
+static int ciphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(ciphy, sizeof(struct mii_softc),
ciphymatch, ciphyattach, mii_phy_detach, mii_phy_activate);
@@ -108,7 +108,7 @@ ciphymatch(struct device *parent, struct
return (0);
}
-static void
+static int
ciphyattach(struct device *parent, struct device *self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -142,6 +142,7 @@ ciphyattach(struct device *parent, struc
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/dmphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/dmphy.c,v
retrieving revision 1.33
diff -u -p -r1.33 dmphy.c
--- sys/dev/mii/dmphy.c 17 Nov 2008 03:04:27 -0000 1.33
+++ sys/dev/mii/dmphy.c 1 May 2009 16:43:39 -0000
@@ -84,7 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.
#include <dev/mii/dmphyreg.h>
static int dmphymatch(device_t, cfdata_t, void *);
-static void dmphyattach(device_t, device_t, void *);
+static int dmphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(dmphy, sizeof(struct mii_softc),
dmphymatch, dmphyattach, mii_phy_detach, mii_phy_activate);
@@ -121,7 +121,7 @@ dmphymatch(device_t parent, cfdata_t mat
return (0);
}
-static void
+static int
dmphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -151,6 +151,7 @@ dmphyattach(device_t parent, device_t se
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/exphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/exphy.c,v
retrieving revision 1.51
diff -u -p -r1.51 exphy.c
--- sys/dev/mii/exphy.c 17 Nov 2008 03:04:27 -0000 1.51
+++ sys/dev/mii/exphy.c 1 May 2009 16:43:39 -0000
@@ -80,7 +80,7 @@ __KERNEL_RCSID(0, "$NetBSD: exphy.c,v 1.
#include <dev/mii/miidevs.h>
static int exphymatch(device_t, cfdata_t, void *);
-static void exphyattach(device_t, device_t, void *);
+static int exphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(exphy, sizeof(struct mii_softc),
exphymatch, exphyattach, mii_phy_detach, mii_phy_activate);
@@ -113,7 +113,7 @@ exphymatch(device_t parent, cfdata_t mat
return (10);
}
-static void
+static int
exphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -138,7 +138,7 @@ exphyattach(device_t parent, device_t se
if (mii->mii_instance != 0) {
aprint_error_dev(self,
"ignoring this PHY, non-zero instance\n");
- return;
+ return ENXIO;
}
sc->mii_flags |= MIIF_NOISOLATE;
@@ -153,6 +153,7 @@ exphyattach(device_t parent, device_t se
mii_phy_add_media(sc);
aprint_normal("\n");
}
+ return 0;
}
static int
Index: sys/dev/mii/gentbi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/gentbi.c,v
retrieving revision 1.23
diff -u -p -r1.23 gentbi.c
--- sys/dev/mii/gentbi.c 17 Nov 2008 03:04:27 -0000 1.23
+++ sys/dev/mii/gentbi.c 1 May 2009 16:43:39 -0000
@@ -84,7 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: gentbi.c,v 1
#include <dev/mii/miidevs.h>
static int gentbimatch(device_t, cfdata_t, void *);
-static void gentbiattach(device_t, device_t, void *);
+static int gentbiattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(gentbi, sizeof(struct mii_softc),
gentbimatch, gentbiattach, mii_phy_detach, mii_phy_activate);
@@ -129,7 +129,7 @@ gentbimatch(device_t parent, cfdata_t ma
return (0);
}
-static void
+static int
gentbiattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -166,6 +166,7 @@ gentbiattach(device_t parent, device_t s
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/glxtphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/glxtphy.c,v
retrieving revision 1.22
diff -u -p -r1.22 glxtphy.c
--- sys/dev/mii/glxtphy.c 17 Nov 2008 03:04:27 -0000 1.22
+++ sys/dev/mii/glxtphy.c 1 May 2009 16:43:39 -0000
@@ -83,7 +83,7 @@ __KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v
#include <dev/mii/glxtphyreg.h>
static int glxtphymatch(device_t, cfdata_t, void *);
-static void glxtphyattach(device_t, device_t, void *);
+static int glxtphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(glxtphy, sizeof(struct mii_softc),
glxtphymatch, glxtphyattach, mii_phy_detach, mii_phy_activate);
@@ -118,7 +118,7 @@ glxtphymatch(device_t parent, cfdata_t m
return (0);
}
-static void
+static int
glxtphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -152,6 +152,7 @@ glxtphyattach(device_t parent, device_t
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/gphyter.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/gphyter.c,v
retrieving revision 1.26
diff -u -p -r1.26 gphyter.c
--- sys/dev/mii/gphyter.c 17 Nov 2008 03:04:27 -0000 1.26
+++ sys/dev/mii/gphyter.c 1 May 2009 16:43:39 -0000
@@ -87,7 +87,7 @@ __KERNEL_RCSID(0, "$NetBSD: gphyter.c,v
#include <dev/mii/gphyterreg.h>
static int gphytermatch(device_t, cfdata_t, void *);
-static void gphyterattach(device_t, device_t, void *);
+static int gphyterattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(gphyter, sizeof(struct mii_softc),
gphytermatch, gphyterattach, mii_phy_detach, mii_phy_activate);
@@ -122,7 +122,7 @@ gphytermatch(device_t parent, cfdata_t m
return (0);
}
-static void
+static int
gphyterattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -177,6 +177,7 @@ gphyterattach(device_t parent, device_t
if (strap & STRAP_NC_MODE)
aprint_normal(", pre-C5 BCM5400 compat enabled");
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/icsphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/icsphy.c,v
retrieving revision 1.47
diff -u -p -r1.47 icsphy.c
--- sys/dev/mii/icsphy.c 17 Nov 2008 03:04:27 -0000 1.47
+++ sys/dev/mii/icsphy.c 1 May 2009 16:43:39 -0000
@@ -83,7 +83,7 @@ __KERNEL_RCSID(0, "$NetBSD: icsphy.c,v 1
#include <dev/mii/icsphyreg.h>
static int icsphymatch(device_t, cfdata_t, void *);
-static void icsphyattach(device_t, device_t, void *);
+static int icsphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(icsphy, sizeof(struct mii_softc),
icsphymatch, icsphyattach, mii_phy_detach, mii_phy_activate);
@@ -124,7 +124,7 @@ icsphymatch(device_t parent, cfdata_t ma
return (0);
}
-static void
+static int
icsphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -155,6 +155,7 @@ icsphyattach(device_t parent, device_t s
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/igphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/igphy.c,v
retrieving revision 1.17
diff -u -p -r1.17 igphy.c
--- sys/dev/mii/igphy.c 17 Nov 2008 03:04:27 -0000 1.17
+++ sys/dev/mii/igphy.c 1 May 2009 16:43:39 -0000
@@ -100,7 +100,7 @@ static void igphy_load_dspcode(struct mi
static void igphy_smartspeed_workaround(struct mii_softc *sc);
static int igphymatch(device_t, cfdata_t, void *);
-static void igphyattach(device_t, device_t, void *);
+static int igphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(igphy, sizeof(struct igphy_softc),
igphymatch, igphyattach, mii_phy_detach, mii_phy_activate);
@@ -134,7 +134,7 @@ igphymatch(device_t parent, cfdata_t mat
return 0;
}
-static void
+static int
igphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -167,6 +167,7 @@ igphyattach(device_t parent, device_t se
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static void
Index: sys/dev/mii/ikphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/ikphy.c,v
retrieving revision 1.8
diff -u -p -r1.8 ikphy.c
--- sys/dev/mii/ikphy.c 17 Nov 2008 03:04:27 -0000 1.8
+++ sys/dev/mii/ikphy.c 1 May 2009 16:43:39 -0000
@@ -83,7 +83,7 @@ __KERNEL_RCSID(0, "$NetBSD: ikphy.c,v 1.
#include <dev/mii/ikphyreg.h>
static int ikphymatch(device_t, cfdata_t, void *);
-static void ikphyattach(device_t, device_t, void *);
+static int ikphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(ikphy, sizeof(struct mii_softc),
ikphymatch, ikphyattach, mii_phy_detach, mii_phy_activate);
@@ -115,7 +115,7 @@ ikphymatch(device_t parent, cfdata_t mat
return (0);
}
-static void
+static int
ikphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -148,6 +148,7 @@ ikphyattach(device_t parent, device_t se
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/inphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/inphy.c,v
retrieving revision 1.51
diff -u -p -r1.51 inphy.c
--- sys/dev/mii/inphy.c 16 Feb 2009 08:00:42 -0000 1.51
+++ sys/dev/mii/inphy.c 1 May 2009 16:43:39 -0000
@@ -84,7 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: inphy.c,v 1.
#include <dev/mii/inphyreg.h>
static int inphymatch(device_t, cfdata_t, void *);
-static void inphyattach(device_t, device_t, void *);
+static int inphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(inphy, sizeof(struct mii_softc),
inphymatch, inphyattach, mii_phy_detach, mii_phy_activate);
@@ -127,7 +127,7 @@ inphymatch(device_t parent, cfdata_t mat
return (0);
}
-static void
+static int
inphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -157,6 +157,7 @@ inphyattach(device_t parent, device_t se
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/iophy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/iophy.c,v
retrieving revision 1.35
diff -u -p -r1.35 iophy.c
--- sys/dev/mii/iophy.c 16 Feb 2009 08:00:42 -0000 1.35
+++ sys/dev/mii/iophy.c 1 May 2009 16:43:39 -0000
@@ -82,7 +82,7 @@ __KERNEL_RCSID(0, "$NetBSD: iophy.c,v 1.
#include <dev/mii/iophyreg.h>
static int iophymatch(device_t, cfdata_t, void *);
-static void iophyattach(device_t, device_t, void *);
+static int iophyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(iophy, sizeof(struct mii_softc),
iophymatch, iophyattach, mii_phy_detach, mii_phy_activate);
@@ -116,7 +116,7 @@ iophymatch(device_t parent, cfdata_t mat
return (0);
}
-static void
+static int
iophyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -146,6 +146,7 @@ iophyattach(device_t parent, device_t se
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/lxtphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/lxtphy.c,v
retrieving revision 1.47
diff -u -p -r1.47 lxtphy.c
--- sys/dev/mii/lxtphy.c 17 Nov 2008 03:04:27 -0000 1.47
+++ sys/dev/mii/lxtphy.c 1 May 2009 16:43:39 -0000
@@ -84,7 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: lxtphy.c,v 1
#include <dev/mii/lxtphyreg.h>
static int lxtphymatch(device_t, cfdata_t, void *);
-static void lxtphyattach(device_t, device_t, void *);
+static int lxtphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(lxtphy, sizeof(struct mii_softc),
lxtphymatch, lxtphyattach, mii_phy_detach, mii_phy_activate);
@@ -126,7 +126,7 @@ lxtphymatch(device_t parent, cfdata_t ma
return (0);
}
-static void
+static int
lxtphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -171,6 +171,7 @@ lxtphyattach(device_t parent, device_t s
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/makphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/makphy.c,v
retrieving revision 1.31
diff -u -p -r1.31 makphy.c
--- sys/dev/mii/makphy.c 19 Apr 2009 11:17:46 -0000 1.31
+++ sys/dev/mii/makphy.c 1 May 2009 16:43:39 -0000
@@ -83,7 +83,7 @@ __KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1
#include <dev/mii/makphyreg.h>
static int makphymatch(device_t, cfdata_t, void *);
-static void makphyattach(device_t, device_t, void *);
+static int makphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(makphy, sizeof(struct mii_softc),
makphymatch, makphyattach, mii_phy_detach, mii_phy_activate);
@@ -127,7 +127,7 @@ makphymatch(device_t parent, cfdata_t ma
return (0);
}
-static void
+static int
makphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -161,6 +161,7 @@ makphyattach(device_t parent, device_t s
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static void
Index: sys/dev/mii/nsphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/nsphy.c,v
retrieving revision 1.56
diff -u -p -r1.56 nsphy.c
--- sys/dev/mii/nsphy.c 16 Feb 2009 08:00:42 -0000 1.56
+++ sys/dev/mii/nsphy.c 1 May 2009 16:43:39 -0000
@@ -84,7 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: nsphy.c,v 1.
#include <dev/mii/nsphyreg.h>
static int nsphymatch(device_t, cfdata_t, void *);
-static void nsphyattach(device_t, device_t, void *);
+static int nsphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(nsphy, sizeof(struct mii_softc),
nsphymatch, nsphyattach, mii_phy_detach, mii_phy_activate);
@@ -116,7 +116,7 @@ nsphymatch(device_t parent, cfdata_t mat
return (0);
}
-static void
+static int
nsphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -146,6 +146,7 @@ nsphyattach(device_t parent, device_t se
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/nsphyter.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/nsphyter.c,v
retrieving revision 1.34
diff -u -p -r1.34 nsphyter.c
--- sys/dev/mii/nsphyter.c 2 Apr 2009 00:09:33 -0000 1.34
+++ sys/dev/mii/nsphyter.c 1 May 2009 16:43:39 -0000
@@ -87,7 +87,7 @@ __KERNEL_RCSID(0, "$NetBSD: nsphyter.c,v
#include <dev/mii/nsphyterreg.h>
static int nsphytermatch(device_t, cfdata_t, void *);
-static void nsphyterattach(device_t, device_t, void *);
+static int nsphyterattach(device_t, device_t, void *);
CFATTACH_DECL3_NEW(nsphyter, sizeof(struct mii_softc),
nsphytermatch, nsphyterattach, mii_phy_detach, mii_phy_activate, NULL,
@@ -126,7 +126,7 @@ nsphytermatch(device_t parent, cfdata_t
return (0);
}
-static void
+static int
nsphyterattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -156,6 +156,7 @@ nsphyterattach(device_t parent, device_t
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/pnaphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/pnaphy.c,v
retrieving revision 1.20
diff -u -p -r1.20 pnaphy.c
--- sys/dev/mii/pnaphy.c 17 Nov 2008 03:04:27 -0000 1.20
+++ sys/dev/mii/pnaphy.c 1 May 2009 16:43:39 -0000
@@ -64,7 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: pnaphy.c,v 1
#include <dev/mii/miidevs.h>
static int pnaphymatch(device_t, cfdata_t, void *);
-static void pnaphyattach(device_t, device_t, void *);
+static int pnaphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(pnaphy, sizeof(struct mii_softc),
pnaphymatch, pnaphyattach, mii_phy_detach, mii_phy_activate);
@@ -100,7 +100,7 @@ pnaphymatch(device_t parent, cfdata_t ma
return (0);
}
-static void
+static int
pnaphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -130,6 +130,7 @@ pnaphyattach(device_t parent, device_t s
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/qsphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/qsphy.c,v
retrieving revision 1.46
diff -u -p -r1.46 qsphy.c
--- sys/dev/mii/qsphy.c 17 Nov 2008 03:04:27 -0000 1.46
+++ sys/dev/mii/qsphy.c 1 May 2009 16:43:39 -0000
@@ -83,7 +83,7 @@ __KERNEL_RCSID(0, "$NetBSD: qsphy.c,v 1.
#include <dev/mii/qsphyreg.h>
static int qsphymatch(device_t, cfdata_t, void *);
-static void qsphyattach(device_t, device_t, void *);
+static int qsphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(qsphy, sizeof(struct mii_softc),
qsphymatch, qsphyattach, mii_phy_detach, mii_phy_activate);
@@ -115,7 +115,7 @@ qsphymatch(device_t parent, cfdata_t mat
return (0);
}
-static void
+static int
qsphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -145,6 +145,7 @@ qsphyattach(device_t parent, device_t se
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/rgephy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/rgephy.c,v
retrieving revision 1.27
diff -u -p -r1.27 rgephy.c
--- sys/dev/mii/rgephy.c 28 Apr 2009 13:25:17 -0000 1.27
+++ sys/dev/mii/rgephy.c 1 May 2009 16:43:39 -0000
@@ -59,7 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1
#include <dev/ic/rtl81x9reg.h>
static int rgephy_match(device_t, cfdata_t, void *);
-static void rgephy_attach(device_t, device_t, void *);
+static int rgephy_attach(device_t, device_t, void *);
struct rgephy_softc {
struct mii_softc mii_sc;
@@ -103,7 +103,7 @@ rgephy_match(device_t parent, cfdata_t m
return 0;
}
-static void
+static int
rgephy_attach(device_t parent, device_t self, void *aux)
{
struct rgephy_softc *rsc = device_private(self);
@@ -164,6 +164,7 @@ rgephy_attach(device_t parent, device_t
rgephy_reset(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/rlphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/rlphy.c,v
retrieving revision 1.25
diff -u -p -r1.25 rlphy.c
--- sys/dev/mii/rlphy.c 16 Feb 2009 08:00:42 -0000 1.25
+++ sys/dev/mii/rlphy.c 1 May 2009 16:43:39 -0000
@@ -62,7 +62,7 @@ struct rlphy_softc {
};
int rlphymatch(device_t, cfdata_t, void *);
-void rlphyattach(device_t, device_t, void *);
+int rlphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(rlphy, sizeof(struct rlphy_softc),
rlphymatch, rlphyattach, mii_phy_detach, mii_phy_activate);
@@ -108,7 +108,7 @@ rlphymatch(device_t parent, cfdata_t mat
return 5;
}
-void
+int
rlphyattach(device_t parent, device_t self, void *aux)
{
struct rlphy_softc *rsc = device_private(self);
@@ -141,6 +141,7 @@ rlphyattach(device_t parent, device_t se
if (sc->mii_capabilities & BMSR_MEDIAMASK)
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
int
Index: sys/dev/mii/sqphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/sqphy.c,v
retrieving revision 1.48
diff -u -p -r1.48 sqphy.c
--- sys/dev/mii/sqphy.c 17 Nov 2008 03:04:27 -0000 1.48
+++ sys/dev/mii/sqphy.c 1 May 2009 16:43:39 -0000
@@ -84,7 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: sqphy.c,v 1.
#include <dev/mii/sqphyreg.h>
static int sqphymatch(device_t, cfdata_t, void *);
-static void sqphyattach(device_t, device_t, void *);
+static int sqphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(sqphy, sizeof(struct mii_softc),
sqphymatch, sqphyattach, mii_phy_detach, mii_phy_activate);
@@ -126,7 +126,7 @@ sqphymatch(device_t parent, cfdata_t mat
return (0);
}
-static void
+static int
sqphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -165,6 +165,7 @@ sqphyattach(device_t parent, device_t se
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/tlphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/tlphy.c,v
retrieving revision 1.58
diff -u -p -r1.58 tlphy.c
--- sys/dev/mii/tlphy.c 17 Nov 2008 03:04:27 -0000 1.58
+++ sys/dev/mii/tlphy.c 1 May 2009 16:43:39 -0000
@@ -97,7 +97,7 @@ struct tlphy_softc {
};
static int tlphymatch(device_t, cfdata_t, void *);
-static void tlphyattach(device_t, device_t, void *);
+static int tlphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(tlphy, sizeof(struct tlphy_softc),
tlphymatch, tlphyattach, mii_phy_detach, mii_phy_activate);
@@ -130,7 +130,7 @@ tlphymatch(device_t parent, cfdata_t mat
return (0);
}
-static void
+static int
tlphyattach(device_t parent, device_t self, void *aux)
{
struct tlphy_softc *tsc = device_private(self);
@@ -198,6 +198,7 @@ tlphyattach(device_t parent, device_t se
aprint_normal("\n");
#undef ADD
#undef PRINT
+ return 0;
}
static int
Index: sys/dev/mii/tqphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/tqphy.c,v
retrieving revision 1.37
diff -u -p -r1.37 tqphy.c
--- sys/dev/mii/tqphy.c 17 Nov 2008 03:04:27 -0000 1.37
+++ sys/dev/mii/tqphy.c 1 May 2009 16:43:39 -0000
@@ -84,7 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: tqphy.c,v 1.
#include <dev/mii/tqphyreg.h>
static int tqphymatch(device_t, cfdata_t, void *);
-static void tqphyattach(device_t, device_t, void *);
+static int tqphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(tqphy, sizeof(struct mii_softc),
tqphymatch, tqphyattach, mii_phy_detach, mii_phy_activate);
@@ -123,7 +123,7 @@ tqphymatch(device_t parent, cfdata_t mat
return (0);
}
-static void
+static int
tqphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -158,6 +158,7 @@ tqphyattach(device_t parent, device_t se
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/ukphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/ukphy.c,v
retrieving revision 1.36
diff -u -p -r1.36 ukphy.c
--- sys/dev/mii/ukphy.c 17 Nov 2008 03:04:27 -0000 1.36
+++ sys/dev/mii/ukphy.c 1 May 2009 16:43:39 -0000
@@ -92,7 +92,7 @@ struct mii_knowndev {
#endif
static int ukphymatch(device_t, cfdata_t, void *);
-static void ukphyattach(device_t, device_t, void *);
+static int ukphyattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(ukphy, sizeof(struct mii_softc),
ukphymatch, ukphyattach, mii_phy_detach, mii_phy_activate);
@@ -113,7 +113,7 @@ ukphymatch(device_t parent, cfdata_t mat
return (1);
}
-static void
+static int
ukphyattach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -168,6 +168,7 @@ ukphyattach(device_t parent, device_t se
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/mii/urlphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/urlphy.c,v
retrieving revision 1.25
diff -u -p -r1.25 urlphy.c
--- sys/dev/mii/urlphy.c 31 Jan 2009 05:44:05 -0000 1.25
+++ sys/dev/mii/urlphy.c 1 May 2009 16:43:39 -0000
@@ -60,7 +60,7 @@ int urlphydebug = URLPHY_DEBUG;
#endif
static int urlphy_match(device_t, cfdata_t, void *);
-static void urlphy_attach(device_t, device_t, void *);
+static int urlphy_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(urlphy, sizeof(struct mii_softc),
urlphy_match, urlphy_attach, mii_phy_detach, mii_phy_activate);
@@ -93,7 +93,7 @@ urlphy_match(device_t parent, cfdata_t m
return (10);
}
-static void
+static int
urlphy_attach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -120,7 +120,7 @@ urlphy_attach(device_t parent, device_t
if (mii->mii_instance != 0) {
aprint_error_dev(self, "ignoring this PHY, non-zero
instance\n");
- return;
+ return ENXIO;
}
PHY_RESET(sc);
@@ -131,6 +131,7 @@ urlphy_attach(device_t parent, device_t
else
mii_phy_add_media(sc);
aprint_normal("\n");
+ return 0;
}
static int
Index: sys/dev/pad/pad.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pad/pad.c,v
retrieving revision 1.11
diff -u -p -r1.11 pad.c
--- sys/dev/pad/pad.c 14 Mar 2009 11:08:28 -0000 1.11
+++ sys/dev/pad/pad.c 1 May 2009 16:43:39 -0000
@@ -73,7 +73,7 @@ enum {
};
static int pad_match(device_t, cfdata_t, void *);
-static void pad_attach(device_t, device_t, void *);
+static int pad_attach(device_t, device_t, void *);
static int pad_detach(device_t, int);
static void pad_childdet(device_t, device_t);
@@ -238,7 +238,7 @@ pad_childdet(device_t self, device_t chi
sc->sc_audiodev = NULL;
}
-static void
+static int
pad_attach(device_t parent, device_t self, void *opaque)
{
pad_softc_t *sc = device_private(self);
@@ -250,7 +250,7 @@ pad_attach(device_t parent, device_t sel
if (auconv_create_encodings(pad_formats, PAD_NFORMATS,
&sc->sc_encodings) != 0) {
aprint_error_dev(self, "couldn't create encodings\n");
- return;
+ return ENXIO;
}
cv_init(&sc->sc_condvar, device_xname(self));
@@ -264,7 +264,7 @@ pad_attach(device_t parent, device_t sel
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
- return;
+ return 0;
}
static int
Index: sys/dev/pci/aac_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/aac_pci.c,v
retrieving revision 1.26
diff -u -p -r1.26 aac_pci.c
--- sys/dev/pci/aac_pci.c 2 Jan 2009 22:03:07 -0000 1.26
+++ sys/dev/pci/aac_pci.c 1 May 2009 16:43:39 -0000
@@ -454,7 +454,7 @@ aac_pci_match(struct device *parent, str
return (aac_find_ident(pa) != NULL);
}
-static void
+static int
aac_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa;
@@ -556,13 +556,15 @@ aac_pci_attach(struct device *parent, st
sc->sc_intr_set = aac_pci_intr_set;
if (!aac_attach(sc))
- return;
+ return 0;
bail_out:
if (state > 1)
pci_intr_disestablish(pc, sc->sc_ih);
if (state > 0)
bus_space_unmap(sc->sc_memt, sc->sc_memh, memsize);
+
+ return ENXIO;
}
CFATTACH_DECL(aac_pci, sizeof(struct aac_pci_softc),
Index: sys/dev/pci/acardide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/acardide.c,v
retrieving revision 1.23
diff -u -p -r1.23 acardide.c
--- sys/dev/pci/acardide.c 14 May 2008 13:29:29 -0000 1.23
+++ sys/dev/pci/acardide.c 1 May 2009 16:43:39 -0000
@@ -42,8 +42,8 @@ static void acard_setup_channel(struct a
static int acard_pci_intr(void *);
#endif
-static int acardide_match(device_t, cfdata_t, void *);
-static void acardide_attach(device_t, device_t, void *);
+static int acardide_match(device_t, cfdata_t, void *);
+static int acardide_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(acardide, sizeof(struct pciide_softc),
acardide_match, acardide_attach, NULL, NULL);
@@ -93,7 +93,7 @@ acardide_match(device_t parent, cfdata_t
return (0);
}
-static void
+static int
acardide_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -104,6 +104,7 @@ acardide_attach(device_t parent, device_
pciide_common_attach(sc, pa,
pciide_lookup_product(pa->pa_id, pciide_acard_products));
+ return 0;
}
#define ACARD_IS_850(sc)
\
Index: sys/dev/pci/aceride.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/aceride.c,v
retrieving revision 1.25
diff -u -p -r1.25 aceride.c
--- sys/dev/pci/aceride.c 18 Mar 2008 20:46:36 -0000 1.25
+++ sys/dev/pci/aceride.c 1 May 2009 16:43:40 -0000
@@ -47,8 +47,8 @@ static void acer_chip_map(struct pciide_
static void acer_setup_channel(struct ata_channel*);
static int acer_pci_intr(void *);
-static int aceride_match(device_t, cfdata_t, void *);
-static void aceride_attach(device_t, device_t, void *);
+static int aceride_match(device_t, cfdata_t, void *);
+static int aceride_attach(device_t, device_t, void *);
struct aceride_softc {
struct pciide_softc pciide_sc;
@@ -85,7 +85,7 @@ aceride_match(device_t parent, cfdata_t
return (0);
}
-static void
+static int
aceride_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -95,6 +95,8 @@ aceride_attach(device_t parent, device_t
pciide_common_attach(sc, pa,
pciide_lookup_product(pa->pa_id, pciide_acer_products));
+
+ return 0;
}
static int
Index: sys/dev/pci/adv_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/adv_pci.c,v
retrieving revision 1.23
diff -u -p -r1.23 adv_pci.c
--- sys/dev/pci/adv_pci.c 28 Apr 2008 20:23:54 -0000 1.23
+++ sys/dev/pci/adv_pci.c 1 May 2009 16:43:40 -0000
@@ -106,7 +106,7 @@ adv_pci_match(struct device *parent, str
return 0;
}
-static void
+static int
adv_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -147,7 +147,7 @@ adv_pci_attach(struct device *parent, st
default:
aprint_error(": unknown model!\n");
- return;
+ return ENXIO;
}
@@ -192,7 +192,7 @@ adv_pci_attach(struct device *parent, st
if (pci_mapreg_map(pa, PCI_BASEADR_IO, PCI_MAPREG_TYPE_IO, 0,
&iot, &ioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "unable to map device
registers\n");
- return;
+ return ENXIO;
}
ASC_SET_CHIP_CONTROL(iot, ioh, ASC_CC_HALT);
@@ -216,7 +216,7 @@ adv_pci_attach(struct device *parent, st
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
@@ -229,7 +229,7 @@ adv_pci_attach(struct device *parent, st
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
@@ -237,6 +237,8 @@ adv_pci_attach(struct device *parent, st
* Attach all the sub-devices we can find
*/
adv_attach(sc);
+
+ return 0;
}
CFATTACH_DECL(adv_pci, sizeof(ASC_SOFTC),
Index: sys/dev/pci/adw_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/adw_pci.c,v
retrieving revision 1.22
diff -u -p -r1.22 adw_pci.c
--- sys/dev/pci/adw_pci.c 28 Apr 2008 20:23:54 -0000 1.22
+++ sys/dev/pci/adw_pci.c 1 May 2009 16:43:40 -0000
@@ -93,7 +93,7 @@ adw_pci_match(struct device *parent, str
}
-static void
+static int
adw_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -129,7 +129,7 @@ adw_pci_attach(struct device *parent, st
default:
aprint_error(": unknown model!\n");
- return;
+ return ENXIO;
}
@@ -150,7 +150,7 @@ adw_pci_attach(struct device *parent, st
if (pci_mapreg_map(pa, PCI_BASEADR_IO, PCI_MAPREG_TYPE_IO, 0,
&iot, &ioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "unable to map device
registers\n");
- return;
+ return ENXIO;
}
sc->sc_iot = iot;
sc->sc_ioh = ioh;
@@ -161,7 +161,7 @@ adw_pci_attach(struct device *parent, st
*/
if (adw_init(sc)) {
aprint_error_dev(&sc->sc_dev, "adw_init failed");
- return;
+ return ENXIO;
}
/*
@@ -169,7 +169,7 @@ adw_pci_attach(struct device *parent, st
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
@@ -182,7 +182,7 @@ adw_pci_attach(struct device *parent, st
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
@@ -190,6 +190,8 @@ adw_pci_attach(struct device *parent, st
* Attach all the sub-devices we can find
*/
adw_attach(sc);
+
+ return 0;
}
CFATTACH_DECL(adw_pci, sizeof(ADW_SOFTC),
Index: sys/dev/pci/agp.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/agp.c,v
retrieving revision 1.65
diff -u -p -r1.65 agp.c
--- sys/dev/pci/agp.c 27 Jan 2009 08:39:33 -0000 1.65
+++ sys/dev/pci/agp.c 1 May 2009 16:43:40 -0000
@@ -303,7 +303,7 @@ static const int agp_max[][2] = {
};
#define agp_max_size (sizeof(agp_max) / sizeof(agp_max[0]))
-static void
+static int
agpattach(device_t parent, device_t self, void *aux)
{
struct agpbus_attach_args *apa = aux;
@@ -357,6 +357,8 @@ agpattach(device_t parent, device_t self
aprint_error_dev(self, "couldn't establish power "
"handler\n");
}
+
+ return 0;
}
CFATTACH_DECL_NEW(agp, sizeof(struct agp_softc),
Index: sys/dev/pci/ahc_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ahc_pci.c,v
retrieving revision 1.64
diff -u -p -r1.64 ahc_pci.c
--- sys/dev/pci/ahc_pci.c 3 Jan 2009 03:43:22 -0000 1.64
+++ sys/dev/pci/ahc_pci.c 1 May 2009 16:43:40 -0000
@@ -755,7 +755,7 @@ ahc_pci_probe(device_t parent, struct cf
return (entry != NULL && entry->setup != NULL) ? 1 : 0;
}
-static void
+static int
ahc_pci_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -791,7 +791,7 @@ ahc_pci_attach(device_t parent, device_t
subid = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
entry = ahc_find_pci_device(pa->pa_id, subid, pa->pa_function);
if (entry == NULL)
- return;
+ return ENXIO;
printf(": %s\n", entry->name);
/* Keep information about the PCI bus */
@@ -799,7 +799,7 @@ ahc_pci_attach(device_t parent, device_t
if (bd == NULL) {
printf("%s: unable to allocate bus-specific data\n",
ahc_name(ahc));
- return;
+ return ENXIO;
}
memset(bd, 0, sizeof(struct ahc_pci_busdata));
@@ -815,7 +815,7 @@ ahc_pci_attach(device_t parent, device_t
error = entry->setup(ahc);
if (error != 0)
- return;
+ return ENXIO;
ioh_valid = 0;
@@ -851,7 +851,7 @@ ahc_pci_attach(device_t parent, device_t
#endif
} else {
printf(": unable to map registers\n");
- return;
+ return ENXIO;
}
ahc->tag = st;
ahc->bsh = sh;
@@ -951,7 +951,7 @@ ahc_pci_attach(device_t parent, device_t
if (pci_intr_map(pa, &ih)) {
printf("%s: couldn't map interrupt\n", ahc_name(ahc));
ahc_free(ahc);
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
ahc->ih = pci_intr_establish(pa->pa_pc, ih, IPL_BIO, ahc_intr, ahc);
@@ -962,7 +962,7 @@ ahc_pci_attach(device_t parent, device_t
printf(" at %s", intrstr);
printf("\n");
ahc_free(ahc);
- return;
+ return ENXIO;
}
if (intrstr != NULL)
printf("%s: interrupting at %s\n", ahc_name(ahc), intrstr);
@@ -1104,11 +1104,11 @@ ahc_pci_attach(device_t parent, device_t
pmf_device_register(self, ahc_pci_suspend, ahc_pci_resume);
ahc_attach(ahc);
- return;
+ return 0;
error_out:
ahc_free(ahc);
- return;
+ return ENXIO;
}
/*
Index: sys/dev/pci/ahcisata_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ahcisata_pci.c,v
retrieving revision 1.14
diff -u -p -r1.14 ahcisata_pci.c
--- sys/dev/pci/ahcisata_pci.c 27 Mar 2009 06:36:49 -0000 1.14
+++ sys/dev/pci/ahcisata_pci.c 1 May 2009 16:43:40 -0000
@@ -74,7 +74,7 @@ struct ahci_pci_softc {
static int ahci_pci_match(device_t, cfdata_t, void *);
-static void ahci_pci_attach(device_t, device_t, void *);
+static int ahci_pci_attach(device_t, device_t, void *);
const struct pci_quirkdata *ahci_pci_lookup_quirkdata(pci_vendor_id_t,
pci_product_id_t);
static bool ahci_pci_resume(device_t PMF_FN_PROTO);
@@ -119,7 +119,7 @@ ahci_pci_match(device_t parent, cfdata_t
return ret;
}
-static void
+static int
ahci_pci_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -137,7 +137,7 @@ ahci_pci_attach(device_t parent, device_
PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
&sc->sc_ahcit, &sc->sc_ahcih, NULL, &size) != 0) {
aprint_error_dev(self, "can't map ahci registers\n");
- return;
+ return ENXIO;
}
psc->sc_pc = pa->pa_pc;
psc->sc_pcitag = pa->pa_tag;
@@ -148,13 +148,13 @@ ahci_pci_attach(device_t parent, device_
if (pci_intr_map(pa, &intrhandle) != 0) {
aprint_error("%s: couldn't map interrupt\n", AHCINAME(sc));
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, intrhandle);
ih = pci_intr_establish(pa->pa_pc, intrhandle, IPL_BIO, ahci_intr, sc);
if (ih == NULL) {
aprint_error("%s: couldn't establish interrupt", AHCINAME(sc));
- return;
+ return ENXIO;
}
aprint_normal("%s: interrupting at %s\n", AHCINAME(sc),
intrstr ? intrstr : "unknown interrupt");
@@ -171,6 +171,8 @@ ahci_pci_attach(device_t parent, device_
if (!pmf_device_register(self, NULL, ahci_pci_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+
+ return 0;
}
static bool
Index: sys/dev/pci/ahd_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ahd_pci.c,v
retrieving revision 1.27
diff -u -p -r1.27 ahd_pci.c
--- sys/dev/pci/ahd_pci.c 21 Mar 2008 08:17:30 -0000 1.27
+++ sys/dev/pci/ahd_pci.c 1 May 2009 16:43:40 -0000
@@ -297,7 +297,7 @@ ahd_pci_probe(device_t parent, struct cf
return entry != NULL ? 1 : 0;
}
-static void
+static int
ahd_pci_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -324,13 +324,13 @@ ahd_pci_attach(device_t parent, device_t
subid = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
entry = ahd_find_pci_device(pa->pa_id, subid);
if (entry == NULL)
- return;
+ return ENXIO;
/* Keep information about the PCI bus */
bd = malloc(sizeof (struct ahd_pci_busdata), M_DEVBUF, M_NOWAIT);
if (bd == NULL) {
aprint_error("%s: unable to allocate bus-specific data\n",
ahd_name(ahd));
- return;
+ return ENXIO;
}
memset(bd, 0, sizeof(struct ahd_pci_busdata));
@@ -347,7 +347,7 @@ ahd_pci_attach(device_t parent, device_t
M_DEVBUF, M_NOWAIT);
if (ahd->seep_config == NULL) {
aprint_error("%s: cannot malloc seep_config!\n", ahd_name(ahd));
- return;
+ return ENXIO;
}
memset(ahd->seep_config, 0, sizeof(*ahd->seep_config));
@@ -364,7 +364,7 @@ ahd_pci_attach(device_t parent, device_t
if (ahd_platform_alloc(ahd, NULL) != 0) {
ahd_free(ahd);
- return;
+ return ENXIO;
}
/*
@@ -376,7 +376,7 @@ ahd_pci_attach(device_t parent, device_t
error = entry->setup(ahd, pa);
if (error != 0)
- return;
+ return ENXIO;
devconfig = pci_conf_read(pa->pa_pc, pa->pa_tag, DEVCONFIG);
if ((devconfig & PCIXINITPAT) == PCIXINIT_PCI33_66) {
@@ -472,7 +472,7 @@ ahd_pci_attach(device_t parent, device_t
if (memh_valid == 0 && (ioh_valid == 0 || ioh2_valid == 0)) {
aprint_error("%s: unable to map registers\n", ahd_name(ahd));
- return;
+ return ENXIO;
}
aprint_normal("\n");
@@ -482,7 +482,7 @@ ahd_pci_attach(device_t parent, device_t
if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self,
pci_activate_null)) && error != EOPNOTSUPP) {
aprint_error_dev(&ahd->sc_dev, "cannot activate %d\n", error);
- return;
+ return ENXIO;
}
/*
* Should we bother disabling 39Bit addressing
@@ -521,13 +521,13 @@ ahd_pci_attach(device_t parent, device_t
error = ahd_reset(ahd, /*reinit*/FALSE);
if (error != 0) {
ahd_free(ahd);
- return;
+ return ENXIO;
}
if (pci_intr_map(pa, &ih)) {
aprint_error("%s: couldn't map interrupt\n", ahd_name(ahd));
ahd_free(ahd);
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
ahd->ih = pci_intr_establish(pa->pa_pc, ih, IPL_BIO, ahd_intr, ahd);
@@ -538,7 +538,7 @@ ahd_pci_attach(device_t parent, device_t
aprint_error(" at %s", intrstr);
aprint_error("\n");
ahd_free(ahd);
- return;
+ return ENXIO;
}
if (intrstr != NULL)
aprint_normal("%s: interrupting at %s\n", ahd_name(ahd),
@@ -552,17 +552,19 @@ ahd_pci_attach(device_t parent, device_t
/* See if we have a SEEPROM and perform auto-term */
error = ahd_check_extport(ahd);
if (error != 0)
- return;
+ return ENXIO;
/* Core initialization */
error = ahd_init(ahd);
if (error != 0)
- return;
+ return ENXIO;
/*
* Link this softc in with all other ahd instances.
*/
ahd_attach(ahd);
+
+ return 0;
}
CFATTACH_DECL(ahd_pci, sizeof(struct ahd_softc),
Index: sys/dev/pci/amdpm.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/amdpm.c,v
retrieving revision 1.30
diff -u -p -r1.30 amdpm.c
--- sys/dev/pci/amdpm.c 28 Apr 2008 20:23:54 -0000 1.30
+++ sys/dev/pci/amdpm.c 1 May 2009 16:43:40 -0000
@@ -83,7 +83,7 @@ amdpm_match(struct device *parent, struc
return (0);
}
-static void
+static int
amdpm_attach(struct device *parent, struct device *self, void *aux)
{
struct amdpm_softc *sc = (struct amdpm_softc *) self;
@@ -126,7 +126,7 @@ amdpm_attach(struct device *parent, stru
if ((confreg & AMDPM_PMIOEN) == 0) {
aprint_error_dev(&sc->sc_dev, "PMxx space isn't enabled\n");
- return;
+ return ENXIO;
}
if (sc->sc_nforce) {
@@ -136,14 +136,14 @@ amdpm_attach(struct device *parent, stru
if (bus_space_map(sc->sc_iot, NFORCE_PMBASE(pmptrreg),
AMDPM_PMSIZE, 0, &sc->sc_ioh)) {
aprint_error_dev(&sc->sc_dev, "failed to map PMxx
space\n");
- return;
+ return ENXIO;
}
} else {
pmptrreg = pci_conf_read(pa->pa_pc, pa->pa_tag, AMDPM_PMPTR);
if (bus_space_map(sc->sc_iot, AMDPM_PMBASE(pmptrreg),
AMDPM_PMSIZE, 0, &sc->sc_ioh)) {
aprint_error_dev(&sc->sc_dev, "failed to map PMxx
space\n");
- return;
+ return ENXIO;
}
}
@@ -204,6 +204,8 @@ amdpm_attach(struct device *parent, stru
amdpm_rnd_callout(sc);
}
}
+
+ return 0;
}
CFATTACH_DECL(amdpm, sizeof(struct amdpm_softc),
Index: sys/dev/pci/amr.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/amr.c,v
retrieving revision 1.49
diff -u -p -r1.49 amr.c
--- sys/dev/pci/amr.c 8 Jun 2008 12:43:52 -0000 1.49
+++ sys/dev/pci/amr.c 1 May 2009 16:43:41 -0000
@@ -91,7 +91,7 @@ __KERNEL_RCSID(0, "$NetBSD: amr.c,v 1.49
#include "locators.h"
-static void amr_attach(struct device *, struct device *, void *);
+static int amr_attach(struct device *, struct device *, void *);
static void amr_ccb_dump(struct amr_softc *, struct amr_ccb *);
static void *amr_enquire(struct amr_softc *, u_int8_t, u_int8_t, u_int8_t,
void *);
@@ -255,7 +255,7 @@ amr_match(struct device *parent, struct
/*
* Attach a supported device.
*/
-static void
+static int
amr_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa;
@@ -307,7 +307,7 @@ amr_attach(struct device *parent, struct
else {
aprint_error("can't map control registers\n");
amr_teardown(amr);
- return;
+ return ENXIO;
}
amr->amr_flags |= AMRF_PCI_REGS;
@@ -323,7 +323,7 @@ amr_attach(struct device *parent, struct
if (pci_intr_map(pa, &ih)) {
aprint_error("can't map interrupt\n");
amr_teardown(amr);
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
amr->amr_ih = pci_intr_establish(pc, ih, IPL_BIO, amr_intr, amr);
@@ -333,7 +333,7 @@ amr_attach(struct device *parent, struct
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
amr_teardown(amr);
- return;
+ return ENXIO;
}
amr->amr_flags |= AMRF_PCI_INTR;
@@ -354,7 +354,7 @@ amr_attach(struct device *parent, struct
aprint_error_dev(&amr->amr_dv, "unable to allocate buffer, rv =
%d\n",
rv);
amr_teardown(amr);
- return;
+ return ENXIO;
}
amr->amr_flags |= AMRF_DMA_ALLOC;
@@ -364,7 +364,7 @@ amr_attach(struct device *parent, struct
aprint_error_dev(&amr->amr_dv, "unable to map buffer, rv =
%d\n",
rv);
amr_teardown(amr);
- return;
+ return ENXIO;
}
amr->amr_flags |= AMRF_DMA_MAP;
@@ -373,7 +373,7 @@ amr_attach(struct device *parent, struct
aprint_error_dev(&amr->amr_dv, "unable to create buffer DMA
map, rv = %d\n",
rv);
amr_teardown(amr);
- return;
+ return ENXIO;
}
amr->amr_flags |= AMRF_DMA_CREATE;
@@ -382,7 +382,7 @@ amr_attach(struct device *parent, struct
aprint_error_dev(&amr->amr_dv, "unable to load buffer DMA map,
rv = %d\n",
rv);
amr_teardown(amr);
- return;
+ return ENXIO;
}
amr->amr_flags |= AMRF_DMA_LOAD;
@@ -420,7 +420,7 @@ amr_attach(struct device *parent, struct
if (i != AMR_MAX_CMDS) {
aprint_error_dev(&amr->amr_dv, "memory exhausted\n");
amr_teardown(amr);
- return;
+ return ENXIO;
}
/*
@@ -452,7 +452,7 @@ amr_attach(struct device *parent, struct
aprint_normal(": AMI RAID ");
if (amr_init(amr, intrstr, pa) != 0) {
amr_teardown(amr);
- return;
+ return ENXIO;
}
/*
@@ -492,6 +492,8 @@ amr_attach(struct device *parent, struct
else
amr->amr_flags |= AMRF_THREAD;
}
+
+ return 0;
}
/*
Index: sys/dev/pci/arcmsr.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/arcmsr.c,v
retrieving revision 1.22
diff -u -p -r1.22 arcmsr.c
--- sys/dev/pci/arcmsr.c 23 Sep 2008 22:22:41 -0000 1.22
+++ sys/dev/pci/arcmsr.c 1 May 2009 16:43:41 -0000
@@ -80,7 +80,7 @@ static struct arc_fw_hdr arc_fw_hdr = {
* autoconf(9) glue.
*/
static int arc_match(device_t, cfdata_t, void *);
-static void arc_attach(device_t, device_t, void *);
+static int arc_attach(device_t, device_t, void *);
static int arc_detach(device_t, int);
static bool arc_shutdown(device_t, int);
static int arc_intr(void *);
@@ -144,7 +144,7 @@ arc_match(device_t parent, cfdata_t matc
return 0;
}
-static void
+static int
arc_attach(device_t parent, device_t self, void *aux)
{
struct arc_softc *sc = device_private(self);
@@ -160,7 +160,7 @@ arc_attach(device_t parent, device_t sel
if (arc_map_pci_resources(self, pa) != 0) {
/* error message printed by arc_map_pci_resources */
- return;
+ return ENXIO;
}
if (arc_query_firmware(self) != 0) {
@@ -221,10 +221,11 @@ arc_attach(device_t parent, device_t sel
device_xname(self));
#endif
- return;
+ return 0;
unmap_pci:
arc_unmap_pci_resources(sc);
+ return ENXIO;
}
static int
Index: sys/dev/pci/artsata.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/artsata.c,v
retrieving revision 1.18
diff -u -p -r1.18 artsata.c
--- sys/dev/pci/artsata.c 28 Apr 2008 20:23:54 -0000 1.18
+++ sys/dev/pci/artsata.c 1 May 2009 16:43:41 -0000
@@ -52,7 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: artsata.c,v
static void artisea_chip_map(struct pciide_softc*, struct pci_attach_args *);
static int artsata_match(device_t, cfdata_t, void *);
-static void artsata_attach(device_t, device_t, void *);
+static int artsata_attach(device_t, device_t, void *);
static const struct pciide_product_desc pciide_artsata_products[] = {
{ PCI_PRODUCT_INTEL_31244,
@@ -104,7 +104,7 @@ artsata_match(device_t parent, cfdata_t
return (0);
}
-static void
+static int
artsata_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -114,7 +114,7 @@ artsata_attach(device_t parent, device_t
pciide_common_attach(sc, pa,
pciide_lookup_product(pa->pa_id, pciide_artsata_products));
-
+ return 0;
}
static void
Index: sys/dev/pci/auacer.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/auacer.c,v
retrieving revision 1.21
diff -u -p -r1.21 auacer.c
--- sys/dev/pci/auacer.c 28 Apr 2008 20:23:54 -0000 1.21
+++ sys/dev/pci/auacer.c 1 May 2009 16:43:41 -0000
@@ -248,7 +248,7 @@ auacer_match(struct device *parent, stru
return 0;
}
-static void
+static int
auacer_attach(struct device *parent, struct device *self, void *aux)
{
struct auacer_softc *sc;
@@ -266,7 +266,7 @@ auacer_attach(struct device *parent, str
if (pci_mapreg_map(pa, 0x10, PCI_MAPREG_TYPE_IO, 0, &sc->iot,
&sc->aud_ioh, NULL, &aud_size)) {
aprint_error(": can't map i/o space\n");
- return;
+ return ENXIO;
}
sc->sc_pc = pa->pa_pc;
@@ -283,7 +283,7 @@ auacer_attach(struct device *parent, str
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "can't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_AUDIO,
@@ -293,7 +293,7 @@ auacer_attach(struct device *parent, str
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
@@ -318,7 +318,7 @@ auacer_attach(struct device *parent, str
sc->host_if.reset = auacer_reset_codec;
if (ac97_attach(&sc->host_if, self) != 0)
- return;
+ return ENXIO;
/* setup audio_format */
memcpy(sc->sc_formats, auacer_formats, sizeof(auacer_formats));
@@ -335,7 +335,7 @@ auacer_attach(struct device *parent, str
if (0 != auconv_create_encodings(sc->sc_formats, AUACER_NFORMATS,
&sc->sc_encodings)) {
- return;
+ return ENXIO;
}
audio_attach_mi(&auacer_hw_if, sc, &sc->sc_dev);
@@ -344,6 +344,8 @@ auacer_attach(struct device *parent, str
if (!pmf_device_register(self, NULL, auacer_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+
+ return 0;
}
CFATTACH_DECL(auacer, sizeof(struct auacer_softc),
Index: sys/dev/pci/auich.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/auich.c,v
retrieving revision 1.129
diff -u -p -r1.129 auich.c
--- sys/dev/pci/auich.c 17 Mar 2009 19:38:34 -0000 1.129
+++ sys/dev/pci/auich.c 1 May 2009 16:43:42 -0000
@@ -239,7 +239,7 @@ int auich_debug = 0xfffe;
#endif
static int auich_match(device_t, cfdata_t, void *);
-static void auich_attach(device_t, device_t, void *);
+static int auich_attach(device_t, device_t, void *);
static int auich_detach(device_t, int);
static void auich_childdet(device_t, device_t);
static int auich_activate(device_t, enum devact);
@@ -442,7 +442,7 @@ auich_match(device_t parent, cfdata_t ma
return 0;
}
-static void
+static int
auich_attach(device_t parent, device_t self, void *aux)
{
struct auich_softc *sc = device_private(self);
@@ -491,7 +491,7 @@ auich_attach(device_t parent, device_t s
0, &sc->iot, &sc->mix_ioh, NULL,
&sc->mix_size)) {
aprint_error_dev(self, "can't map codec i/o
space\n");
- return;
+ return ENXIO;
}
}
if (pci_mapreg_map(pa, ICH_MBBAR, PCI_MAPREG_TYPE_MEM, 0,
@@ -503,19 +503,19 @@ auich_attach(device_t parent, device_t s
0, &sc->iot, &sc->aud_ioh, NULL,
&sc->aud_size)) {
aprint_error_dev(self, "can't map device i/o
space\n");
- return;
+ return ENXIO;
}
}
} else {
if (pci_mapreg_map(pa, ICH_NAMBAR, PCI_MAPREG_TYPE_IO, 0,
&sc->iot, &sc->mix_ioh, NULL,
&sc->mix_size)) {
aprint_error_dev(self, "can't map codec i/o space\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, ICH_NABMBAR, PCI_MAPREG_TYPE_IO, 0,
&sc->iot, &sc->aud_ioh, NULL,
&sc->aud_size)) {
aprint_error_dev(self, "can't map device i/o space\n");
- return;
+ return ENXIO;
}
}
sc->dmat = pa->pa_dmat;
@@ -528,7 +528,7 @@ auich_attach(device_t parent, device_t s
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &sc->intrh)) {
aprint_error_dev(self, "can't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, sc->intrh);
sc->sc_ih = pci_intr_establish(pa->pa_pc, sc->intrh, IPL_AUDIO,
@@ -538,7 +538,7 @@ auich_attach(device_t parent, device_t s
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -602,7 +602,7 @@ auich_attach(device_t parent, device_t s
}
if (ac97_attach_type(&sc->host_if, self, sc->sc_codectype) != 0)
- return;
+ return ENXIO;
sc->codec_if->vtbl->unlock(sc->codec_if);
/* setup audio_format */
@@ -620,15 +620,15 @@ auich_attach(device_t parent, device_t s
}
if (0 != auconv_create_encodings(sc->sc_audio_formats,
AUICH_AUDIO_NFORMATS,
&sc->sc_encodings))
- return;
+ return ENXIO;
if (0 != auconv_create_encodings(auich_spdif_formats,
AUICH_SPDIF_NFORMATS,
&sc->sc_spdif_encodings))
- return;
+ return ENXIO;
} else {
memcpy(sc->sc_modem_formats, auich_modem_formats,
sizeof(auich_modem_formats));
if (0 != auconv_create_encodings(sc->sc_modem_formats,
AUICH_MODEM_NFORMATS,
&sc->sc_encodings))
- return;
+ return ENXIO;
}
/* Watch for power change */
@@ -640,7 +640,7 @@ auich_attach(device_t parent, device_t s
/* sysctl setup */
if (AC97_IS_FIXED_RATE(sc->codec_if) &&
sc->sc_codectype == AC97_CODEC_TYPE_AUDIO)
- return;
+ return ENXIO;
err = sysctl_createv(&sc->sc_log, 0, NULL, NULL, 0,
CTLTYPE_NODE, "hw", NULL, NULL, 0, NULL, 0,
@@ -667,12 +667,12 @@ auich_attach(device_t parent, device_t s
sc->sc_ac97_clock_mib = node_ac97clock->sysctl_num;
}
- return;
+ return 0;
sysctl_err:
printf("%s: failed to add sysctl nodes. (%d)\n",
device_xname(self), err);
- return; /* failure of sysctl is not fatal. */
+ return ENXIO; /* failure of sysctl is not fatal. */
}
static int
Index: sys/dev/pci/auixp.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/auixp.c,v
retrieving revision 1.30
diff -u -p -r1.30 auixp.c
--- sys/dev/pci/auixp.c 18 Mar 2009 16:00:19 -0000 1.30
+++ sys/dev/pci/auixp.c 1 May 2009 16:43:42 -0000
@@ -131,7 +131,7 @@ struct audio_device auixp_device = {
/* autoconfig */
static int auixp_match(device_t, struct cfdata *, void *);
-static void auixp_attach(device_t, device_t, void *);
+static int auixp_attach(device_t, device_t, void *);
static int auixp_detach(device_t, int);
@@ -1085,7 +1085,7 @@ auixp_match(device_t dev, struct cfdata
/* it is... now hook up and set up the resources we need */
-static void
+static int
auixp_attach(device_t parent, device_t self, void *aux)
{
struct auixp_softc *sc;
@@ -1132,7 +1132,7 @@ auixp_attach(device_t parent, device_t s
if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc_iot, &sc->sc_ioh, &sc->sc_iob, &sc->sc_ios)) {
aprint_error_dev(&sc->sc_dev, "can't map memory space\n");
- return;
+ return ENXIO;
}
/* Initialize softc */
@@ -1147,7 +1147,7 @@ auixp_attach(device_t parent, device_t s
/* when that fails we are dead in the water */
if (!sc->sc_output_dma || !sc->sc_input_dma)
- return;
+ return ENXIO;
#if 0
/* could preliminary program DMA chain */
@@ -1158,7 +1158,7 @@ auixp_attach(device_t parent, device_t s
/* map interrupt on the pci bus */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "can't map interrupt\n");
- return;
+ return ENXIO;
}
/* where are we connected at ? */
@@ -1171,7 +1171,7 @@ auixp_attach(device_t parent, device_t s
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
@@ -1180,13 +1180,13 @@ auixp_attach(device_t parent, device_t s
pci_activate_null)) && error != EOPNOTSUPP) {
aprint_error_dev(&sc->sc_dev, "cannot activate %d\n",
error);
- return;
+ return ENXIO;
}
/* init chip */
if (auixp_init(sc) == -1) {
aprint_error_dev(&sc->sc_dev, "auixp_attach: unable to
initialize the card\n");
- return;
+ return ENXIO;
}
if (!pmf_device_register(self, NULL, auixp_resume))
@@ -1197,6 +1197,7 @@ auixp_attach(device_t parent, device_t s
* are enabled.
*/
config_interrupts(self, auixp_post_config);
+ return 0;
}
Index: sys/dev/pci/autri.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/autri.c,v
retrieving revision 1.40
diff -u -p -r1.40 autri.c
--- sys/dev/pci/autri.c 3 Jul 2008 12:26:41 -0000 1.40
+++ sys/dev/pci/autri.c 1 May 2009 16:43:43 -0000
@@ -511,7 +511,7 @@ autri_match(struct device *parent, struc
return 0;
}
-static void
+static int
autri_attach(struct device *parent, struct device *self, void *aux)
{
struct autri_softc *sc;
@@ -540,13 +540,13 @@ autri_attach(struct device *parent, stru
if (pci_mapreg_map(pa, AUTRI_PCI_MEMORY_BASE,
PCI_MAPREG_TYPE_MEM, 0, &sc->memt, &sc->memh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "can't map memory space\n");
- return;
+ return ENXIO;
}
/* map and establish the interrupt */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_AUDIO, autri_intr, sc);
@@ -555,7 +555,7 @@ autri_attach(struct device *parent, stru
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
@@ -585,7 +585,7 @@ autri_attach(struct device *parent, stru
if ((r = ac97_attach(&codec->host_if, self)) != 0) {
aprint_error_dev(&sc->sc_dev, "can't attach codec (error
0x%X)\n", r);
- return;
+ return ENXIO;
}
if (!pmf_device_register(self, NULL, autri_resume))
@@ -596,6 +596,7 @@ autri_attach(struct device *parent, stru
#if NMIDI > 0
midi_attach_mi(&autri_midi_hw_if, sc, &sc->sc_dev);
#endif
+ return 0;
}
CFATTACH_DECL(autri, sizeof(struct autri_softc),
Index: sys/dev/pci/auvia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/auvia.c,v
retrieving revision 1.67
diff -u -p -r1.67 auvia.c
--- sys/dev/pci/auvia.c 11 Oct 2008 20:08:15 -0000 1.67
+++ sys/dev/pci/auvia.c 1 May 2009 16:43:43 -0000
@@ -80,7 +80,7 @@ struct auvia_dma_op {
};
static int auvia_match(device_t, struct cfdata *, void *);
-static void auvia_attach(device_t, device_t, void *);
+static int auvia_attach(device_t, device_t, void *);
static int auvia_detach(device_t, int);
static void auvia_childdet(device_t, device_t);
static int auvia_open(void *, int);
@@ -318,7 +318,7 @@ auvia_detach(device_t self, int flags)
return 0;
}
-static void
+static int
auvia_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa;
@@ -351,7 +351,7 @@ auvia_attach(device_t parent, device_t s
if (pci_mapreg_map(pa, 0x10, PCI_MAPREG_TYPE_IO, 0, &sc->sc_iot,
&sc->sc_ioh, NULL, &sc->sc_iosize)) {
aprint_error(": can't map i/o space\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -405,7 +405,7 @@ auvia_attach(device_t parent, device_t s
if (pci_intr_map(pa, &ih)) {
aprint_error(": couldn't map interrupt\n");
bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_iosize);
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
@@ -416,7 +416,7 @@ auvia_attach(device_t parent, device_t s
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_iosize);
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
@@ -445,7 +445,7 @@ auvia_attach(device_t parent, device_t s
aprint_error_dev(&sc->sc_dev, "can't attach codec (error
0x%X)\n", r);
pci_intr_disestablish(pc, sc->sc_ih);
bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_iosize);
- return;
+ return ENXIO;
}
/* setup audio_format */
@@ -471,7 +471,7 @@ auvia_attach(device_t parent, device_t s
pci_intr_disestablish(pc, sc->sc_ih);
bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_iosize);
aprint_error_dev(&sc->sc_dev, "can't create encodings\n");
- return;
+ return ENXIO;
}
if (0 != auconv_create_encodings(auvia_spdif_formats,
AUVIA_SPDIF_NFORMATS, &sc->sc_spdif_encodings)) {
@@ -479,7 +479,7 @@ auvia_attach(device_t parent, device_t s
pci_intr_disestablish(pc, sc->sc_ih);
bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_iosize);
aprint_error_dev(&sc->sc_dev, "can't create spdif encodings\n");
- return;
+ return ENXIO;
}
if (!pmf_device_register(self, NULL, auvia_resume))
@@ -487,7 +487,7 @@ auvia_attach(device_t parent, device_t s
audio_attach_mi(&auvia_hw_if, sc, &sc->sc_dev);
sc->codec_if->vtbl->unlock(sc->codec_if);
- return;
+ return 0;
}
static int
Index: sys/dev/pci/azalia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/azalia.c,v
retrieving revision 1.68
diff -u -p -r1.68 azalia.c
--- sys/dev/pci/azalia.c 2 Apr 2009 01:06:49 -0000 1.68
+++ sys/dev/pci/azalia.c 1 May 2009 16:43:43 -0000
@@ -154,7 +154,7 @@ typedef struct azalia_t {
/* prototypes */
static int azalia_pci_match(device_t, struct cfdata *, void *);
-static void azalia_pci_attach(device_t, device_t, void *);
+static int azalia_pci_attach(device_t, device_t, void *);
static int azalia_pci_activate(device_t, enum devact);
static int azalia_pci_detach(device_t, int);
static bool azalia_pci_resume(device_t PMF_FN_PROTO);
@@ -292,7 +292,7 @@ azalia_pci_match(device_t parent, struct
return 0;
}
-static void
+static int
azalia_pci_attach(device_t parent, device_t self, void *aux)
{
azalia_t *sc = device_private(self);
@@ -313,7 +313,7 @@ azalia_pci_attach(device_t parent, devic
if (pci_mapreg_map(pa, ICH_PCI_HDBARL, v, 0,
&sc->iot, &sc->ioh, NULL, &sc->map_size)) {
aprint_error_dev(self, "can't map device i/o space\n");
- return;
+ return ENXIO;
}
/* enable bus mastering */
@@ -324,7 +324,7 @@ azalia_pci_attach(device_t parent, devic
/* interrupt */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "can't map interrupt\n");
- return;
+ return ENXIO;
}
sc->pc = pa->pa_pc;
sc->tag = pa->pa_tag;
@@ -335,7 +335,7 @@ azalia_pci_attach(device_t parent, devic
if (intrrupt_str != NULL)
aprint_error(" at %s", intrrupt_str);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrrupt_str);
@@ -357,11 +357,12 @@ azalia_pci_attach(device_t parent, devic
if (azalia_attach(sc)) {
aprint_error_dev(self, "initialization failure\n");
azalia_pci_detach(self, 0);
- return;
+ return ENXIO;
}
sc->subid = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
config_interrupts(self, azalia_attach_intr);
+ return 0;
}
static int
Index: sys/dev/pci/bha_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/bha_pci.c,v
retrieving revision 1.33
diff -u -p -r1.33 bha_pci.c
--- sys/dev/pci/bha_pci.c 28 Apr 2008 20:23:54 -0000 1.33
+++ sys/dev/pci/bha_pci.c 1 May 2009 16:43:43 -0000
@@ -86,7 +86,7 @@ bha_pci_match(struct device *parent, str
/*
* Attach all the sub-devices we can find
*/
-static void
+static int
bha_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -111,7 +111,7 @@ bha_pci_attach(struct device *parent, st
if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0, &iot, &ioh,
NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "unable to map device
registers\n");
- return;
+ return ENXIO;
}
sc->sc_iot = iot;
@@ -128,7 +128,7 @@ bha_pci_attach(struct device *parent, st
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_BIO, bha_intr, sc);
@@ -137,13 +137,14 @@ bha_pci_attach(struct device *parent, st
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
bha_attach(sc);
bha_disable_isacompat(sc);
+ return 0;
}
CFATTACH_DECL(bha_pci, sizeof(struct bha_softc),
Index: sys/dev/pci/cac_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/cac_pci.c,v
retrieving revision 1.28
diff -u -p -r1.28 cac_pci.c
--- sys/dev/pci/cac_pci.c 28 Apr 2008 20:23:54 -0000 1.28
+++ sys/dev/pci/cac_pci.c 1 May 2009 16:43:43 -0000
@@ -137,7 +137,7 @@ cac_pci_match(struct device *parent, str
return (cac_pci_findtype(aux) != NULL);
}
-static void
+static int
cac_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa;
@@ -187,7 +187,7 @@ cac_pci_attach(struct device *parent, st
ior = -1;
if (memr == -1 && ior == -1) {
aprint_error_dev(self, "can't map i/o or memory space\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -200,7 +200,7 @@ cac_pci_attach(struct device *parent, st
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error("can't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_BIO, cac_intr, sc);
@@ -209,14 +209,14 @@ cac_pci_attach(struct device *parent, st
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal(": Compaq %s\n", ct->ct_typestr);
/* Now attach to the bus-independent code. */
memcpy(&sc->sc_cl, ct->ct_linkage, sizeof(sc->sc_cl));
- cac_init(sc, intrstr, (ct->ct_flags & CT_STARTFW) != 0);
+ return cac_init(sc, intrstr, (ct->ct_flags & CT_STARTFW) != 0);
}
CFATTACH_DECL(cac_pci, sizeof(struct cac_softc),
Index: sys/dev/pci/ciss_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ciss_pci.c,v
retrieving revision 1.5
diff -u -p -r1.5 ciss_pci.c
--- sys/dev/pci/ciss_pci.c 10 Apr 2008 19:13:36 -0000 1.5
+++ sys/dev/pci/ciss_pci.c 1 May 2009 16:43:43 -0000
@@ -42,7 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: ciss_pci.c,v
#define CISS_BAR 0x10
int ciss_pci_match(struct device *, struct cfdata *, void *);
-void ciss_pci_attach(struct device *, struct device *, void *);
+int ciss_pci_attach(struct device *, struct device *, void *);
CFATTACH_DECL(ciss_pci, sizeof(struct ciss_softc),
ciss_pci_match, ciss_pci_attach, NULL, NULL);
@@ -244,7 +244,7 @@ ciss_pci_match(struct device *parent, st
return 0;
}
-void
+int
ciss_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct ciss_softc *sc = (struct ciss_softc *)self;
@@ -272,12 +272,12 @@ ciss_pci_attach(struct device *parent, s
if (memtype != (PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT) &&
memtype != (PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT)) {
printf(": wrong BAR type\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, CISS_BAR, memtype, 0,
&sc->sc_iot, &sc->sc_ioh, NULL, &size)) {
printf(": can't map controller i/o space\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -296,7 +296,7 @@ ciss_pci_attach(struct device *parent, s
NULL, &sc->cfg_ioh, NULL, &cfgsz)) {
printf(": can't map controller config space\n");
bus_space_unmap(sc->sc_iot, sc->sc_ioh, size);
- return;
+ return ENXIO;
}
} else {
sc->cfg_ioh = sc->sc_ioh;
@@ -308,7 +308,7 @@ ciss_pci_attach(struct device *parent, s
bus_space_unmap(sc->sc_iot, sc->sc_ioh, size);
if (cfg_bar != CISS_BAR)
bus_space_unmap(sc->sc_iot, sc->cfg_ioh, cfgsz);
- return;
+ return ENXIO;
}
/* disable interrupts until ready */
@@ -320,7 +320,7 @@ ciss_pci_attach(struct device *parent, s
bus_space_unmap(sc->sc_iot, sc->sc_ioh, size);
if (cfg_bar != CISS_BAR)
bus_space_unmap(sc->sc_iot, sc->cfg_ioh, cfgsz);
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_BIO, ciss_intr, sc);
@@ -343,10 +343,11 @@ ciss_pci_attach(struct device *parent, s
bus_space_unmap(sc->sc_iot, sc->sc_ioh, size);
if (cfg_bar != CISS_BAR)
bus_space_unmap(sc->sc_iot, sc->cfg_ioh, cfgsz);
- return;
+ return ENXIO;
}
/* enable interrupts now */
bus_space_write_4(sc->sc_iot, sc->sc_ioh, CISS_IMR,
bus_space_read_4(sc->sc_iot, sc->sc_ioh, CISS_IMR) & ~sc->iem);
+ return 0;
}
Index: sys/dev/pci/cmdide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/cmdide.c,v
retrieving revision 1.28
diff -u -p -r1.28 cmdide.c
--- sys/dev/pci/cmdide.c 18 Mar 2008 20:46:36 -0000 1.28
+++ sys/dev/pci/cmdide.c 1 May 2009 16:43:43 -0000
@@ -44,7 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: cmdide.c,v 1
static int cmdide_match(device_t, cfdata_t, void *);
-static void cmdide_attach(device_t, device_t, void *);
+static int cmdide_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(cmdide, sizeof(struct pciide_softc),
cmdide_match, cmdide_attach, NULL, NULL);
@@ -111,7 +111,7 @@ cmdide_match(device_t parent, cfdata_t m
return (0);
}
-static void
+static int
cmdide_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -121,7 +121,7 @@ cmdide_attach(device_t parent, device_t
pciide_common_attach(sc, pa,
pciide_lookup_product(pa->pa_id, pciide_cmd_products));
-
+ return 0;
}
static void
Index: sys/dev/pci/cmpci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/cmpci.c,v
retrieving revision 1.38
diff -u -p -r1.38 cmpci.c
--- sys/dev/pci/cmpci.c 10 Apr 2008 19:13:36 -0000 1.38
+++ sys/dev/pci/cmpci.c 1 May 2009 16:43:43 -0000
@@ -107,7 +107,7 @@ static int cmpci_set_in_ports(struct cmp
* autoconf interface
*/
static int cmpci_match(struct device *, struct cfdata *, void *);
-static void cmpci_attach(struct device *, struct device *, void *);
+static int cmpci_attach(struct device *, struct device *, void *);
CFATTACH_DECL(cmpci, sizeof (struct cmpci_softc),
cmpci_match, cmpci_attach, NULL, NULL);
@@ -375,7 +375,7 @@ cmpci_match(struct device *parent, struc
return 0;
}
-static void
+static int
cmpci_attach(struct device *parent, struct device *self, void *aux)
{
struct cmpci_softc *sc;
@@ -412,13 +412,13 @@ cmpci_attach(struct device *parent, stru
if (pci_mapreg_map(pa, CMPCI_PCI_IOBASEREG, PCI_MAPREG_TYPE_IO, 0,
&sc->sc_iot, &sc->sc_ioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "failed to map I/O space\n");
- return;
+ return ENXIO;
}
/* interrupt */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "failed to map interrupt\n");
- return;
+ return ENXIO;
}
strintr = pci_intr_string(pa->pa_pc, ih);
sc->sc_ih=pci_intr_establish(pa->pa_pc, ih, IPL_AUDIO, cmpci_intr, sc);
@@ -427,7 +427,7 @@ cmpci_attach(struct device *parent, stru
if (strintr != NULL)
aprint_normal(" at %s", strintr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", strintr);
@@ -516,6 +516,7 @@ cmpci_attach(struct device *parent, stru
sc->sc_gain[i][CMPCI_LEFT] = sc->sc_gain[i][CMPCI_RIGHT] = v;
cmpci_set_mixer_gain(sc, i);
}
+ return 0;
}
static int
Index: sys/dev/pci/com_puc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/com_puc.c,v
retrieving revision 1.18
diff -u -p -r1.18 com_puc.c
--- sys/dev/pci/com_puc.c 14 Mar 2008 15:09:11 -0000 1.18
+++ sys/dev/pci/com_puc.c 1 May 2009 16:43:43 -0000
@@ -74,7 +74,7 @@ com_puc_probe(device_t parent, cfdata_t
return (1);
}
-static void
+static int
com_puc_attach(device_t parent, device_t self, void *aux)
{
struct com_puc_softc *psc = device_private(self);
@@ -126,12 +126,13 @@ com_puc_attach(device_t parent, device_t
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal(": interrupting at %s\n", intrstr);
aprint_normal("%s", device_xname(self));
com_attach_subr(sc);
+ return 0;
}
CFATTACH_DECL_NEW(com_puc, sizeof(struct com_puc_softc),
Index: sys/dev/pci/cs4280.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/cs4280.c,v
retrieving revision 1.51
diff -u -p -r1.51 cs4280.c
--- sys/dev/pci/cs4280.c 21 Mar 2008 08:20:04 -0000 1.51
+++ sys/dev/pci/cs4280.c 1 May 2009 16:43:44 -0000
@@ -90,7 +90,7 @@ __KERNEL_RCSID(0, "$NetBSD: cs4280.c,v 1
/* IF functions for audio driver */
static int cs4280_match(struct device *, struct cfdata *, void *);
-static void cs4280_attach(struct device *, struct device *, void *);
+static int cs4280_attach(struct device *, struct device *, void *);
static int cs4280_intr(void *);
static int cs4280_query_encoding(void *, struct audio_encoding *);
static int cs4280_set_params(void *, int, int, audio_params_t *,
@@ -235,7 +235,7 @@ cs4280_match(struct device *parent, stru
return 0;
}
-static void
+static int
cs4280_attach(struct device *parent, struct device *self, void *aux)
{
struct cs428x_softc *sc;
@@ -275,13 +275,13 @@ cs4280_attach(struct device *parent, str
PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0,
&sc->ba0t, &sc->ba0h, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "can't map BA0 space\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, PCI_BA1,
PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0,
&sc->ba1t, &sc->ba1h, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "can't map BA1 space\n");
- return;
+ return ENXIO;
}
sc->sc_dmatag = pa->pa_dmat;
@@ -290,7 +290,7 @@ cs4280_attach(struct device *parent, str
if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self,
pci_activate_null)) && error != EOPNOTSUPP) {
aprint_error_dev(&sc->sc_dev, "cannot activate %d\n", error);
- return;
+ return ENXIO;
}
/* Enable the device (set bus master flag) */
@@ -312,7 +312,7 @@ cs4280_attach(struct device *parent, str
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &sc->intrh)) {
aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, sc->intrh);
@@ -323,13 +323,13 @@ cs4280_attach(struct device *parent, str
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
/* Initialization */
if(cs4280_init(sc, 1) != 0)
- return;
+ return ENXIO;
sc->type = TYPE_CS4280;
sc->halt_input = cs4280_halt_input;
@@ -353,7 +353,7 @@ cs4280_attach(struct device *parent, str
sc->host_if.flags = cs4280_flags_codec;
if (ac97_attach(&sc->host_if, self) != 0) {
aprint_error_dev(&sc->sc_dev, "ac97_attach failed\n");
- return;
+ return ENXIO;
}
audio_attach_mi(&cs4280_hw_if, sc, &sc->sc_dev);
@@ -364,6 +364,7 @@ cs4280_attach(struct device *parent, str
if (!pmf_device_register(self, cs4280_suspend, cs4280_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
/* Interrupt handling function */
Index: sys/dev/pci/cs4281.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/cs4281.c,v
retrieving revision 1.39
diff -u -p -r1.39 cs4281.c
--- sys/dev/pci/cs4281.c 21 Mar 2008 08:20:04 -0000 1.39
+++ sys/dev/pci/cs4281.c 1 May 2009 16:43:44 -0000
@@ -81,7 +81,7 @@ __KERNEL_RCSID(0, "$NetBSD: cs4281.c,v 1
/* IF functions for audio driver */
static int cs4281_match(struct device *, struct cfdata *, void *);
-static void cs4281_attach(struct device *, struct device *, void *);
+static int cs4281_attach(struct device *, struct device *, void *);
static int cs4281_intr(void *);
static int cs4281_query_encoding(void *, struct audio_encoding *);
static int cs4281_set_params(void *, int, int, audio_params_t *,
@@ -181,7 +181,7 @@ cs4281_match(struct device *parent, stru
return 0;
}
-static void
+static int
cs4281_attach(struct device *parent, struct device *self, void *aux)
{
struct cs428x_softc *sc;
@@ -209,13 +209,13 @@ cs4281_attach(struct device *parent, str
PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0,
&sc->ba0t, &sc->ba0h, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "can't map BA0 space\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, PCI_BA1,
PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0,
&sc->ba1t, &sc->ba1h, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "can't map BA1 space\n");
- return;
+ return ENXIO;
}
sc->sc_dmatag = pa->pa_dmat;
@@ -224,7 +224,7 @@ cs4281_attach(struct device *parent, str
if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self,
pci_activate_null)) && error != EOPNOTSUPP) {
aprint_error_dev(&sc->sc_dev, "cannot activate %d\n", error);
- return;
+ return ENXIO;
}
/* Enable the device (set bus master flag) */
@@ -245,7 +245,7 @@ cs4281_attach(struct device *parent, str
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &sc->intrh)) {
aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, sc->intrh);
@@ -256,7 +256,7 @@ cs4281_attach(struct device *parent, str
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
@@ -264,7 +264,7 @@ cs4281_attach(struct device *parent, str
* Sound System start-up
*/
if (cs4281_init(sc, 1) != 0)
- return;
+ return ENXIO;
sc->type = TYPE_CS4281;
sc->halt_input = cs4281_halt_input;
@@ -282,7 +282,7 @@ cs4281_attach(struct device *parent, str
sc->host_if.reset = cs4281_reset_codec;
if (ac97_attach(&sc->host_if, self) != 0) {
aprint_error_dev(&sc->sc_dev, "ac97_attach failed\n");
- return;
+ return ENXIO;
}
audio_attach_mi(&cs4281_hw_if, sc, &sc->sc_dev);
@@ -292,6 +292,7 @@ cs4281_attach(struct device *parent, str
if (!pmf_device_register(self, cs4281_suspend, cs4281_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static int
Index: sys/dev/pci/cy_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/cy_pci.c,v
retrieving revision 1.23
diff -u -p -r1.23 cy_pci.c
--- sys/dev/pci/cy_pci.c 26 Mar 2008 17:50:32 -0000 1.23
+++ sys/dev/pci/cy_pci.c 1 May 2009 16:43:44 -0000
@@ -83,7 +83,7 @@ cy_pci_match(device_t parent, cfdata_t m
return (cy_pci_lookup(pa) != NULL);
}
-static void
+static int
cy_pci_attach(device_t parent, device_t self, void *aux)
{
struct cy_pci_softc *psc = device_private(self);
@@ -109,18 +109,18 @@ cy_pci_attach(device_t parent, device_t
if (pci_mapreg_map(pa, 0x14, PCI_MAPREG_TYPE_IO, 0,
&psc->sc_iot, &psc->sc_ioh, NULL, NULL) != 0) {
aprint_error_dev(sc->sc_dev, "unable to map PLX registers\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, 0x18, cp->cp_memtype, 0,
&sc->sc_memt, &sc->sc_bsh, NULL, NULL) != 0) {
aprint_error_dev(sc->sc_dev,"unable to map device registers\n");
- return;
+ return ENXIO;
}
if (cy_find(sc) == 0) {
aprint_error_dev(sc->sc_dev, "unable to find CD1400s\n");
- return;
+ return ENXIO;
}
/*
@@ -132,7 +132,7 @@ cy_pci_attach(device_t parent, device_t
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih) != 0) {
aprint_error_dev(sc->sc_dev, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_TTY, cy_intr, sc);
@@ -141,7 +141,7 @@ cy_pci_attach(device_t parent, device_t
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(sc->sc_dev, "interrupting at %s\n", intrstr);
@@ -164,6 +164,7 @@ cy_pci_attach(device_t parent, device_t
bus_space_read_2(psc->sc_iot, psc->sc_ioh,
CY_PCI_INTENA) | 0x900);
}
+ return 0;
}
CFATTACH_DECL_NEW(cy_pci, sizeof(struct cy_pci_softc),
Index: sys/dev/pci/cypide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/cypide.c,v
retrieving revision 1.21
diff -u -p -r1.21 cypide.c
--- sys/dev/pci/cypide.c 18 Mar 2008 20:46:36 -0000 1.21
+++ sys/dev/pci/cypide.c 1 May 2009 16:43:44 -0000
@@ -48,7 +48,7 @@ static void cy693_chip_map(struct pciide
static void cy693_setup_channel(struct ata_channel*);
static int cypide_match(device_t, cfdata_t, void *);
-static void cypide_attach(device_t, device_t, void *);
+static int cypide_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(cypide, sizeof(struct pciide_softc),
cypide_match, cypide_attach, NULL, NULL);
@@ -80,7 +80,7 @@ cypide_match(device_t parent, cfdata_t m
return (0);
}
-static void
+static int
cypide_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -90,7 +90,7 @@ cypide_attach(device_t parent, device_t
pciide_common_attach(sc, pa,
pciide_lookup_product(pa->pa_id, pciide_cypress_products));
-
+ return 0;
}
static void
Index: sys/dev/pci/cz.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/cz.c,v
retrieving revision 1.49
diff -u -p -r1.49 cz.c
--- sys/dev/pci/cz.c 8 Jun 2008 12:43:52 -0000 1.49
+++ sys/dev/pci/cz.c 1 May 2009 16:43:44 -0000
@@ -282,7 +282,7 @@ cz_match(struct device *parent,
*
* A Cyclades-Z board was found; attach it.
*/
-static void
+static int
cz_attach(struct device *parent,
struct device *self,
void *aux)
@@ -306,13 +306,13 @@ cz_attach(struct device *parent,
PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0,
&cz->cz_plx.plx_st, &cz->cz_plx.plx_sh, NULL, NULL) != 0) {
aprint_error_dev(&cz->cz_dev, "unable to map PLX registers\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, PLX_PCI_LOCAL_ADDR0,
PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0,
&cz->cz_win_st, &cz->cz_win_sh, NULL, NULL) != 0) {
aprint_error_dev(&cz->cz_dev, "unable to map device window\n");
- return;
+ return ENXIO;
}
cz->cz_mailbox0 = CZ_PLX_READ(cz, PLX_MAILBOX0);
@@ -328,7 +328,7 @@ cz_attach(struct device *parent,
* Load the board's firmware.
*/
if (cz_load_firmware(cz) != 0)
- return;
+ return ENXIO;
/*
* Now that we're ready to roll, map and establish the interrupt
@@ -383,7 +383,7 @@ cz_attach(struct device *parent,
if (cz->cz_nchannels == 0) {
/* No channels? No more work to do! */
- return;
+ return ENXIO;
}
cz->cz_ports = malloc(sizeof(struct cztty_softc) * cz->cz_nchannels,
@@ -437,6 +437,7 @@ cz_attach(struct device *parent,
CZTTY_CHAN_WRITE(sc, CHNCTL_HW_FLOW, C_RS_CTS | C_RS_RTS);
CZTTY_CHAN_WRITE(sc, CHNCTL_RS_CONTROL, 0);
}
+ return 0;
}
CFATTACH_DECL(cz, sizeof(struct cz_softc),
Index: sys/dev/pci/dpt_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/dpt_pci.c,v
retrieving revision 1.21
diff -u -p -r1.21 dpt_pci.c
--- sys/dev/pci/dpt_pci.c 10 Apr 2008 19:13:36 -0000 1.21
+++ sys/dev/pci/dpt_pci.c 1 May 2009 16:43:44 -0000
@@ -57,7 +57,7 @@ __KERNEL_RCSID(0, "$NetBSD: dpt_pci.c,v
#define PCI_CBIO 0x10 /* Configuration base I/O address */
static int dpt_pci_match(struct device *, struct cfdata *, void *);
-static void dpt_pci_attach(struct device *, struct device *, void *);
+static int dpt_pci_attach(struct device *, struct device *, void *);
CFATTACH_DECL(dpt_pci, sizeof(struct dpt_softc),
dpt_pci_match, dpt_pci_attach, NULL, NULL);
@@ -77,7 +77,7 @@ dpt_pci_match(struct device *parent, str
return (0);
}
-static void
+static int
dpt_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa;
@@ -98,13 +98,13 @@ dpt_pci_attach(struct device *parent, st
if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0, &sc->sc_iot,
&ioh, NULL, NULL)) {
aprint_error("can't map i/o space\n");
- return;
+ return ENXIO;
}
/* Need to map in by 16 registers. */
if (bus_space_subregion(sc->sc_iot, ioh, 16, 16, &sc->sc_ioh)) {
aprint_error("can't map i/o subregion\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -117,7 +117,7 @@ dpt_pci_attach(struct device *parent, st
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error("can't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_BIO, dpt_intr, sc);
@@ -126,17 +126,18 @@ dpt_pci_attach(struct device *parent, st
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
/* Read the EATA configuration. */
if (dpt_readcfg(sc)) {
aprint_error_dev(&sc->sc_dv, "readcfg failed - see dpt(4)\n");
- return;
+ return ENXIO;
}
sc->sc_bustype = SI_PCI_BUS;
/* Now attach to the bus-independent code. */
dpt_init(sc, intrstr);
+ return 0;
}
Index: sys/dev/pci/eap.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/eap.c,v
retrieving revision 1.92
diff -u -p -r1.92 eap.c
--- sys/dev/pci/eap.c 28 Apr 2008 20:23:54 -0000 1.92
+++ sys/dev/pci/eap.c 1 May 2009 16:43:45 -0000
@@ -94,7 +94,7 @@ int eapdebug = 0;
#endif
static int eap_match(device_t, cfdata_t, void *);
-static void eap_attach(device_t, device_t, void *);
+static int eap_attach(device_t, device_t, void *);
static int eap_detach(device_t, int);
static int eap_intr(void *);
@@ -589,7 +589,7 @@ eap1371_set_dac_rate(struct eap_instance
splx(s);
}
-static void
+static int
eap_attach(device_t parent, device_t self, void *aux)
{
struct eap_softc *sc;
@@ -655,7 +655,7 @@ eap_attach(device_t parent, device_t sel
if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
&sc->iot, &sc->ioh, NULL, &sc->iosz)) {
aprint_error_dev(sc->sc_dev, "can't map i/o space\n");
- return;
+ return ENXIO;
}
sc->sc_dmatag = pa->pa_dmat;
@@ -668,7 +668,7 @@ eap_attach(device_t parent, device_t sel
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_AUDIO, eap_intr, sc);
@@ -677,7 +677,7 @@ eap_attach(device_t parent, device_t sel
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -781,7 +781,7 @@ eap_attach(device_t parent, device_t sel
/* Interrupt enable */
EWRITE4(sc, EAP_SIC, EAP_P2_INTR_EN | EAP_R1_INTR_EN);
} else
- return;
+ return ENXIO;
eap_hw_if = &eap1371_hw_if;
}
@@ -806,6 +806,7 @@ eap_attach(device_t parent, device_t sel
sc->sc_gameport = eap_joy_attach(sc->sc_dev, &gpargs);
}
#endif
+ return 0;
}
static int
Index: sys/dev/pci/ehci_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ehci_pci.c,v
retrieving revision 1.44
diff -u -p -r1.44 ehci_pci.c
--- sys/dev/pci/ehci_pci.c 26 Apr 2009 09:47:31 -0000 1.44
+++ sys/dev/pci/ehci_pci.c 1 May 2009 16:43:45 -0000
@@ -89,7 +89,7 @@ ehci_pci_match(device_t parent, cfdata_t
return 0;
}
-static void
+static int
ehci_pci_attach(device_t parent, device_t self, void *aux)
{
struct ehci_pci_softc *sc = device_private(self);
@@ -119,7 +119,7 @@ ehci_pci_attach(device_t parent, device_
&sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
sc->sc.sc_size = 0;
aprint_error_dev(self, "can't map memory space\n");
- return;
+ return ENXIO;
}
/* Disable interrupts, so we don't get any spurious ones. */
@@ -152,7 +152,7 @@ ehci_pci_attach(device_t parent, device_
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -162,7 +162,7 @@ ehci_pci_attach(device_t parent, device_
case PCI_USBREV_1_1:
sc->sc.sc_bus.usbrev = USBREV_UNKNOWN;
aprint_verbose_dev(self, "pre-2.0 USB rev\n");
- return;
+ return ENXIO;
case PCI_USBREV_2_0:
sc->sc.sc_bus.usbrev = USBREV_2_0;
break;
@@ -221,7 +221,7 @@ ehci_pci_attach(device_t parent, device_
/* Attach usb device. */
sc->sc.sc_child = config_found(self, &sc->sc.sc_bus, usbctlprint);
- return;
+ return 0;
fail:
if (sc->sc_ih) {
@@ -233,7 +233,7 @@ fail:
bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size);
sc->sc.sc_size = 0;
}
- return;
+ return ENXIO;
}
static int
Index: sys/dev/pci/emuxki.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/emuxki.c,v
retrieving revision 1.54
diff -u -p -r1.54 emuxki.c
--- sys/dev/pci/emuxki.c 6 Sep 2008 03:00:32 -0000 1.54
+++ sys/dev/pci/emuxki.c 1 May 2009 16:43:45 -0000
@@ -73,7 +73,7 @@ __KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1
/* autoconf goo */
static int emuxki_match(struct device *, struct cfdata *, void *);
-static void emuxki_attach(struct device *, struct device *, void *);
+static int emuxki_attach(struct device *, struct device *, void *);
static int emuxki_detach(struct device *, int);
/* DMA mem mgmt */
@@ -399,7 +399,7 @@ emuxki_match(struct device *parent, stru
}
}
-static void
+static int
emuxki_attach(struct device *parent, struct device *self, void *aux)
{
struct emuxki_softc *sc;
@@ -416,7 +416,7 @@ emuxki_attach(struct device *parent, str
&(sc->sc_iot), &(sc->sc_ioh), &(sc->sc_iob),
&(sc->sc_ios))) {
aprint_error(": can't map iospace\n");
- return;
+ return ENXIO;
}
pci_devinfo(pa->pa_id, pa->pa_class, 1, devinfo, sizeof(devinfo));
aprint_normal(": %s\n", devinfo);
@@ -430,7 +430,7 @@ emuxki_attach(struct device *parent, str
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_ios);
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
@@ -442,7 +442,7 @@ emuxki_attach(struct device *parent, str
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_ios);
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
@@ -470,7 +470,7 @@ emuxki_attach(struct device *parent, str
if (emuxki_scinit(sc) || emuxki_ac97_init(sc) ||
(sc->sc_audev = audio_attach_mi(&emuxki_hw_if, sc, self)) == NULL) {
emuxki_pci_shutdown(sc);
- return;
+ return ENXIO;
}
#if 0
sc->rsourcectl.dev =
@@ -478,6 +478,7 @@ emuxki_attach(struct device *parent, str
AudioNsource, NULL);
sc->rsourcectl.cp = AUDIO_MIXER_ENUM;
#endif
+ return 0;
}
static int
Index: sys/dev/pci/esa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/esa.c,v
retrieving revision 1.50
diff -u -p -r1.50 esa.c
--- sys/dev/pci/esa.c 10 Jun 2008 21:19:01 -0000 1.50
+++ sys/dev/pci/esa.c 1 May 2009 16:43:46 -0000
@@ -100,7 +100,7 @@ static struct audio_device esa_device =
};
static int esa_match(device_t, struct cfdata *, void *);
-static void esa_attach(device_t, device_t, void *);
+static int esa_attach(device_t, device_t, void *);
static int esa_detach(device_t, int);
static void esa_childdet(device_t, device_t);
@@ -992,7 +992,7 @@ esa_match(device_t dev, struct cfdata *m
return 0;
}
-static void
+static int
esa_attach(device_t parent, device_t self, void *aux)
{
struct esa_softc *sc;
@@ -1036,7 +1036,7 @@ esa_attach(device_t parent, device_t sel
if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
&sc->sc_iot, &sc->sc_ioh, &sc->sc_iob, &sc->sc_ios)) {
aprint_error_dev(sc->sc_dev, "can't map i/o space\n");
- return;
+ return ENXIO;
}
/* Initialize softc */
@@ -1048,7 +1048,7 @@ esa_attach(device_t parent, device_t sel
/* Map and establish an interrupt */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(sc->sc_dev, "can't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_AUDIO, esa_intr, sc);
@@ -1057,7 +1057,7 @@ esa_attach(device_t parent, device_t sel
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(sc->sc_dev, "interrupting at %s\n", intrstr);
@@ -1065,14 +1065,14 @@ esa_attach(device_t parent, device_t sel
if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self,
pci_activate_null)) && error != EOPNOTSUPP) {
aprint_error_dev(sc->sc_dev, "cannot activate %d\n", error);
- return;
+ return ENXIO;
}
/* Init chip */
if (esa_init(sc) == -1) {
aprint_error_dev(sc->sc_dev,
"esa_attach: unable to initialize the card\n");
- return;
+ return ENXIO;
}
/* create suspend save area */
@@ -1082,7 +1082,7 @@ esa_attach(device_t parent, device_t sel
if (sc->savemem == NULL) {
aprint_error_dev(sc->sc_dev,
"unable to allocate suspend buffer\n");
- return;
+ return ENXIO;
}
/*
@@ -1112,7 +1112,7 @@ esa_attach(device_t parent, device_t sel
sc->host_if.flags = esa_flags_codec;
if (ac97_attach(&sc->host_if, self) != 0)
- return;
+ return ENXIO;
/* initialize list management structures */
sc->mixer_list.mem_addr = ESA_KDATA_MIXER_XFER0;
@@ -1141,7 +1141,7 @@ esa_attach(device_t parent, device_t sel
if (!pmf_device_register(self, esa_suspend, esa_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
- return;
+ return 0;
}
void
Index: sys/dev/pci/esiop_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/esiop_pci.c,v
retrieving revision 1.12
diff -u -p -r1.12 esiop_pci.c
--- sys/dev/pci/esiop_pci.c 16 Nov 2006 01:33:08 -0000 1.12
+++ sys/dev/pci/esiop_pci.c 1 May 2009 16:43:46 -0000
@@ -75,7 +75,7 @@ esiop_pci_match(struct device *parent, s
return 2;
}
-static void
+static int
esiop_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -83,9 +83,10 @@ esiop_pci_attach(struct device *parent,
if (siop_pci_attach_common(&sc->esiop_pci, &sc->esiop.sc_c,
pa, esiop_intr) == 0)
- return;
+ return ENXIO;
esiop_attach(&sc->esiop);
+ return 0;
}
Index: sys/dev/pci/esm.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/esm.c,v
retrieving revision 1.47
diff -u -p -r1.47 esm.c
--- sys/dev/pci/esm.c 10 Apr 2008 19:13:36 -0000 1.47
+++ sys/dev/pci/esm.c 1 May 2009 16:43:46 -0000
@@ -150,7 +150,7 @@ static bool esm_suspend(device_t PMF_FN
static bool esm_resume(device_t PMF_FN_PROTO);
static void esm_childdet(device_t, device_t);
static int esm_match(device_t, struct cfdata *, void *);
-static void esm_attach(device_t, device_t, void *);
+static int esm_attach(device_t, device_t, void *);
static int esm_detach(device_t, int);
static int esm_intr(void *);
@@ -1585,7 +1585,7 @@ esm_match(device_t dev, struct cfdata *m
return 0;
}
-static void
+static int
esm_attach(device_t parent, device_t self, void *aux)
{
char devinfo[256];
@@ -1620,7 +1620,7 @@ esm_attach(device_t parent, device_t sel
if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
&ess->st, &ess->sh, NULL, &ess->sz)) {
aprint_error_dev(&ess->sc_dev, "can't map i/o space\n");
- return;
+ return ENXIO;
}
/* Initialize softc */
@@ -1639,7 +1639,7 @@ esm_attach(device_t parent, device_t sel
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&ess->sc_dev, "can't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
ess->ih = pci_intr_establish(pc, ih, IPL_AUDIO, esm_intr, self);
@@ -1648,7 +1648,7 @@ esm_attach(device_t parent, device_t sel
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&ess->sc_dev, "interrupting at %s\n",
intrstr);
@@ -1662,7 +1662,7 @@ esm_attach(device_t parent, device_t sel
pci_activate_null)) && error != EOPNOTSUPP) {
aprint_error_dev(&ess->sc_dev, "cannot activate %d\n",
error);
- return;
+ return ENXIO;
}
delay(100000);
@@ -1685,7 +1685,7 @@ esm_attach(device_t parent, device_t sel
esm_read_codec(ess, 0, &codec_data);
if (codec_data == 0x80) {
aprint_error_dev(&ess->sc_dev, "PT101 codec detected!\n");
- return;
+ return ENXIO;
}
/*
@@ -1708,13 +1708,13 @@ esm_attach(device_t parent, device_t sel
ess->host_if.flags = esm_flags_codec;
if (ac97_attach(&ess->host_if, self) != 0)
- return;
+ return ENXIO;
/* allocate our DMA region */
if (esm_allocmem(ess, MAESTRO_DMA_SZ, MAESTRO_DMA_ALIGN,
&ess->sc_dma)) {
aprint_error_dev(&ess->sc_dev, "couldn't allocate memory!\n");
- return;
+ return ENXIO;
}
ess->rings_alloced = 0;
@@ -1727,6 +1727,7 @@ esm_attach(device_t parent, device_t sel
if (!pmf_device_register(self, esm_suspend, esm_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static void
Index: sys/dev/pci/eso.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/eso.c,v
retrieving revision 1.53
diff -u -p -r1.53 eso.c
--- sys/dev/pci/eso.c 10 Apr 2008 19:13:36 -0000 1.53
+++ sys/dev/pci/eso.c 1 May 2009 16:43:46 -0000
@@ -95,7 +95,7 @@ struct eso_dma {
/* Autoconfiguration interface */
static int eso_match(struct device *, struct cfdata *, void *);
-static void eso_attach(struct device *, struct device *, void *);
+static int eso_attach(struct device *, struct device *, void *);
static void eso_defer(struct device *);
static int eso_print(void *, const char *);
@@ -223,7 +223,7 @@ eso_match(struct device *parent, struct
return 0;
}
-static void
+static int
eso_attach(struct device *parent, struct device *self, void *aux)
{
struct eso_softc *sc;
@@ -252,12 +252,12 @@ eso_attach(struct device *parent, struct
if (pci_mapreg_map(pa, ESO_PCI_BAR_IO, PCI_MAPREG_TYPE_IO, 0,
&sc->sc_iot, &sc->sc_ioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "can't map I/O space\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, ESO_PCI_BAR_SB, PCI_MAPREG_TYPE_IO, 0,
&sc->sc_sb_iot, &sc->sc_sb_ioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "can't map SB I/O space\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, ESO_PCI_BAR_VC, PCI_MAPREG_TYPE_IO, 0,
&sc->sc_dmac_iot, &sc->sc_dmac_ioh, &vcbase, &sc->sc_vcsize)) {
@@ -269,12 +269,12 @@ eso_attach(struct device *parent, struct
if (pci_mapreg_map(pa, ESO_PCI_BAR_MPU, PCI_MAPREG_TYPE_IO, 0,
&sc->sc_mpu_iot, &sc->sc_mpu_ioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "can't map MPU I/O space\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, ESO_PCI_BAR_GAME, PCI_MAPREG_TYPE_IO, 0,
&sc->sc_game_iot, &sc->sc_game_ioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "can't map Game I/O space\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -289,7 +289,7 @@ eso_attach(struct device *parent, struct
/* Reset the device; bail out upon failure. */
if (eso_reset(sc) != 0) {
aprint_error_dev(&sc->sc_dev, "can't reset\n");
- return;
+ return ENXIO;
}
/* Select the DMA/IRQ policy: DDMA, ISA IRQ emulation disabled. */
@@ -351,7 +351,7 @@ eso_attach(struct device *parent, struct
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstring = pci_intr_string(pa->pa_pc, ih);
sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_AUDIO, eso_intr, sc);
@@ -360,7 +360,7 @@ eso_attach(struct device *parent, struct
if (intrstring != NULL)
aprint_normal(" at %s", intrstring);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n",
intrstring);
@@ -418,6 +418,7 @@ eso_attach(struct device *parent, struct
aa.hwif = NULL;
aa.hdl = NULL;
(void)config_found(&sc->sc_dev, &aa, eso_print);
+ return 0;
}
static void
Index: sys/dev/pci/fms.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/fms.c,v
retrieving revision 1.33
diff -u -p -r1.33 fms.c
--- sys/dev/pci/fms.c 28 Apr 2008 20:23:54 -0000 1.33
+++ sys/dev/pci/fms.c 1 May 2009 16:43:46 -0000
@@ -74,7 +74,7 @@ struct fms_dma {
static int fms_match(struct device *, struct cfdata *, void *);
-static void fms_attach(struct device *, struct device *, void *);
+static int fms_attach(struct device *, struct device *, void *);
static int fms_intr(void *);
static int fms_query_encoding(void *, struct audio_encoding *);
@@ -223,7 +223,7 @@ fms_match(struct device *parent, struct
return 1;
}
-static void
+static int
fms_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa;
@@ -245,7 +245,7 @@ fms_attach(struct device *parent, struct
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
@@ -255,7 +255,7 @@ fms_attach(struct device *parent, struct
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -265,7 +265,7 @@ fms_attach(struct device *parent, struct
if (pci_mapreg_map(pa, 0x10, PCI_MAPREG_TYPE_IO, 0, &sc->sc_iot,
&sc->sc_ioh, &sc->sc_ioaddr, &sc->sc_iosize)) {
aprint_error_dev(&sc->sc_dev, "can't map i/o space\n");
- return;
+ return ENXIO;
}
if (bus_space_subregion(sc->sc_iot, sc->sc_ioh, 0x30, 2,
@@ -308,7 +308,7 @@ fms_attach(struct device *parent, struct
sc->host_if.reset = fms_reset_codec;
if (ac97_attach(&sc->host_if, self) != 0)
- return;
+ return ENXIO;
audio_attach_mi(&fms_hw_if, sc, &sc->sc_dev);
@@ -321,6 +321,7 @@ fms_attach(struct device *parent, struct
aa.hwif = NULL;
aa.hdl = NULL;
sc->sc_mpu_dev = config_found(&sc->sc_dev, &aa, audioprint);
+ return 0;
}
/*
Index: sys/dev/pci/fwohci_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/fwohci_pci.c,v
retrieving revision 1.32
diff -u -p -r1.32 fwohci_pci.c
--- sys/dev/pci/fwohci_pci.c 28 Apr 2008 20:23:54 -0000 1.32
+++ sys/dev/pci/fwohci_pci.c 1 May 2009 16:43:46 -0000
@@ -60,7 +60,7 @@ struct fwohci_pci_softc {
};
static int fwohci_pci_match(device_t, struct cfdata *, void *);
-static void fwohci_pci_attach(device_t, device_t, void *);
+static int fwohci_pci_attach(device_t, device_t, void *);
static bool fwohci_pci_suspend(device_t PMF_FN_PROTO);
static bool fwohci_pci_resume(device_t PMF_FN_PROTO);
@@ -82,7 +82,7 @@ fwohci_pci_match(device_t parent, struct
return 0;
}
-static void
+static int
fwohci_pci_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = (struct pci_attach_args *) aux;
@@ -145,14 +145,14 @@ fwohci_pci_attach(device_t parent, devic
psc->psc_sc.bssize);
}
- return;
+ return 0;
fail:
/* In the event that we fail to attach, register a null pnp handler */
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
- return;
+ return ENXIO;
}
static bool
Index: sys/dev/pci/genfb_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/genfb_pci.c,v
retrieving revision 1.16
diff -u -p -r1.16 genfb_pci.c
--- sys/dev/pci/genfb_pci.c 23 Feb 2009 23:45:56 -0000 1.16
+++ sys/dev/pci/genfb_pci.c 1 May 2009 16:43:46 -0000
@@ -77,7 +77,7 @@ struct pci_genfb_softc {
};
static int pci_genfb_match(struct device *, struct cfdata *, void *);
-static void pci_genfb_attach(struct device *, struct device *, void *);
+static int pci_genfb_attach(struct device *, struct device *, void *);
static int pci_genfb_ioctl(void *, void *, u_long, void *, int,
struct lwp *);
static paddr_t pci_genfb_mmap(void *, void *, off_t, int);
@@ -109,7 +109,7 @@ pci_genfb_match(struct device *parent, s
return 0;
}
-static void
+static int
pci_genfb_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_genfb_softc *sc = (struct pci_genfb_softc *)self;
@@ -132,14 +132,14 @@ pci_genfb_attach(struct device *parent,
if ((sc->sc_gen.sc_width == 0) || (sc->sc_gen.sc_fbsize == 0)) {
aprint_debug_dev(self, "not configured by firmware\n");
- return;
+ return ENXIO;
}
if (bus_space_map(sc->sc_memt, sc->sc_gen.sc_fboffset,
sc->sc_gen.sc_fbsize, BUS_SPACE_MAP_LINEAR, &sc->sc_memh) != 0) {
aprint_error_dev(self, "unable to map the framebuffer\n");
- return;
+ return ENXIO;
}
sc->sc_gen.sc_fbaddr = bus_space_vaddr(sc->sc_memt, sc->sc_memh);
@@ -173,6 +173,7 @@ pci_genfb_attach(struct device *parent,
/* now try to attach a DRM */
config_found_ia(self, "drm", aux, pci_genfb_drm_print);
}
+ return 0;
}
static int
Index: sys/dev/pci/hifn7751.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/hifn7751.c,v
retrieving revision 1.42
diff -u -p -r1.42 hifn7751.c
--- sys/dev/pci/hifn7751.c 28 Apr 2009 22:43:50 -0000 1.42
+++ sys/dev/pci/hifn7751.c 1 May 2009 16:43:47 -0000
@@ -107,7 +107,7 @@ static int hifn_probe((struct device *,
#else
static int hifn_probe(device_t, cfdata_t, void *);
#endif
-static void hifn_attach(device_t, device_t, void *);
+static int hifn_attach(device_t, device_t, void *);
CFATTACH_DECL(hifn, sizeof(struct hifn_softc),
hifn_probe, hifn_attach, NULL, NULL);
@@ -237,7 +237,7 @@ hifn_probe(device_t parent, cfdata_t mat
return 0;
}
-static void
+static int
hifn_attach(device_t parent, device_t self, void *aux)
{
struct hifn_softc *sc = device_private(self);
@@ -278,7 +278,7 @@ hifn_attach(device_t parent, device_t se
if (pci_mapreg_map(pa, HIFN_BAR0, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc_st0, &sc->sc_sh0, NULL, &iosize0)) {
aprint_error_dev(&sc->sc_dv, "can't map mem space %d\n", 0);
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, HIFN_BAR1, PCI_MAPREG_TYPE_MEM, 0,
@@ -437,7 +437,7 @@ hifn_attach(device_t parent, device_t se
callout_init(&sc->sc_tickto, 0);
callout_reset(&sc->sc_tickto, hz, hifn_tick, sc);
#endif
- return;
+ return 0;
fail_intr:
pci_intr_disestablish(pc, sc->sc_ih);
@@ -455,6 +455,7 @@ fail_io1:
bus_space_unmap(sc->sc_st1, sc->sc_sh1, iosize1);
fail_io0:
bus_space_unmap(sc->sc_st0, sc->sc_sh0, iosize0);
+ return ENXIO;
}
static int
Index: sys/dev/pci/hptide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/hptide.c,v
retrieving revision 1.25
diff -u -p -r1.25 hptide.c
--- sys/dev/pci/hptide.c 18 Mar 2008 20:46:36 -0000 1.25
+++ sys/dev/pci/hptide.c 1 May 2009 16:43:47 -0000
@@ -46,7 +46,7 @@ static void hpt_setup_channel(struct ata
static int hpt_pci_intr(void *);
static int hptide_match(device_t, cfdata_t, void *);
-static void hptide_attach(device_t, device_t, void *);
+static int hptide_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(hptide, sizeof(struct pciide_softc),
hptide_match, hptide_attach, NULL, NULL);
@@ -96,7 +96,7 @@ hptide_match(device_t parent, cfdata_t m
return (0);
}
-static void
+static int
hptide_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -106,7 +106,7 @@ hptide_attach(device_t parent, device_t
pciide_common_attach(sc, pa,
pciide_lookup_product(pa->pa_id, pciide_triones_products));
-
+ return 0;
}
static void
Index: sys/dev/pci/ichsmb.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ichsmb.c,v
retrieving revision 1.20
diff -u -p -r1.20 ichsmb.c
--- sys/dev/pci/ichsmb.c 18 Mar 2009 16:00:19 -0000 1.20
+++ sys/dev/pci/ichsmb.c 1 May 2009 16:43:47 -0000
@@ -70,7 +70,7 @@ struct ichsmb_softc {
};
static int ichsmb_match(device_t, struct cfdata *, void *);
-static void ichsmb_attach(device_t, device_t, void *);
+static int ichsmb_attach(device_t, device_t, void *);
static int ichsmb_i2c_acquire_bus(void *, int);
static void ichsmb_i2c_release_bus(void *, int);
@@ -112,7 +112,7 @@ ichsmb_match(device_t parent, struct cfd
return 0;
}
-static void
+static int
ichsmb_attach(device_t parent, device_t self, void *aux)
{
struct ichsmb_softc *sc = device_private(self);
@@ -137,14 +137,14 @@ ichsmb_attach(device_t parent, device_t
if ((conf & LPCIB_SMB_HOSTC_HSTEN) == 0) {
aprint_error_dev(self, "SMBus disabled\n");
- return;
+ return ENXIO;
}
/* Map I/O space */
if (pci_mapreg_map(pa, LPCIB_SMB_BASE, PCI_MAPREG_TYPE_IO, 0,
&sc->sc_iot, &sc->sc_ioh, NULL, &iosize)) {
aprint_error_dev(self, "can't map I/O space\n");
- return;
+ return ENXIO;
}
sc->sc_poll = 1;
@@ -181,6 +181,7 @@ ichsmb_attach(device_t parent, device_t
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static int
Index: sys/dev/pci/icp_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/icp_pci.c,v
retrieving revision 1.15
diff -u -p -r1.15 icp_pci.c
--- sys/dev/pci/icp_pci.c 28 Apr 2008 20:23:54 -0000 1.15
+++ sys/dev/pci/icp_pci.c 1 May 2009 16:43:47 -0000
@@ -158,7 +158,7 @@ __KERNEL_RCSID(0, "$NetBSD: icp_pci.c,v
#define ICP_MPR_SZ 0x4000
int icp_pci_match(struct device *, struct cfdata *, void *);
-void icp_pci_attach(struct device *, struct device *, void *);
+int icp_pci_attach(struct device *, struct device *, void *);
void icp_pci_enable_intr(struct icp_softc *);
int icp_pci_find_class(struct pci_attach_args *);
@@ -235,7 +235,7 @@ icp_pci_match(struct device *parent, str
return (icp_pci_find_class(pa) != -1);
}
-void
+int
icp_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa;
@@ -575,7 +575,7 @@ icp_pci_attach(struct device *parent, st
goto bail_out;
icp_pci_enable_intr(icp);
- return;
+ return ENXIO;
bail_out:
if ((status & DPMEM_MAPPED) != 0)
@@ -586,6 +586,7 @@ icp_pci_attach(struct device *parent, st
bus_space_unmap(iot, ioh, iosize);
if ((status & INTR_ESTABLISHED) != 0)
pci_intr_disestablish(pa->pa_pc, icp->icp_ih);
+ return 0;
}
/*
Index: sys/dev/pci/if_age.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_age.c,v
retrieving revision 1.28
diff -u -p -r1.28 if_age.c
--- sys/dev/pci/if_age.c 28 Apr 2009 11:47:56 -0000 1.28
+++ sys/dev/pci/if_age.c 1 May 2009 16:43:47 -0000
@@ -80,7 +80,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1
#include <dev/pci/if_agereg.h>
static int age_match(device_t, cfdata_t, void *);
-static void age_attach(device_t, device_t, void *);
+static int age_attach(device_t, device_t, void *);
static int age_detach(device_t, int);
static bool age_resume(device_t PMF_FN_PROTO);
@@ -141,7 +141,7 @@ age_match(device_t dev, cfdata_t match,
PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ATTANSIC_ETHERNET_GIGA);
}
-static void
+static int
age_attach(device_t parent, device_t self, void *aux)
{
struct age_softc *sc = device_private(self);
@@ -177,7 +177,7 @@ age_attach(device_t parent, device_t sel
if (pci_mapreg_map(pa, AGE_PCIR_BAR, memtype, 0, &sc->sc_mem_bt,
&sc->sc_mem_bh, NULL, &sc->sc_mem_size) != 0) {
aprint_error_dev(self, "could not map mem space\n");
- return;
+ return ENXIO;
}
if (pci_intr_map(pa, &ih) != 0) {
@@ -293,7 +293,7 @@ age_attach(device_t parent, device_t sel
else
pmf_class_network_register(self, ifp);
- return;
+ return 0;
fail:
age_dma_free(sc);
@@ -305,6 +305,7 @@ fail:
bus_space_unmap(sc->sc_mem_bt, sc->sc_mem_bh, sc->sc_mem_size);
sc->sc_mem_size = 0;
}
+ return ENXIO;
}
static int
Index: sys/dev/pci/if_ale.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ale.c,v
retrieving revision 1.3
diff -u -p -r1.3 if_ale.c
--- sys/dev/pci/if_ale.c 28 Apr 2009 11:49:15 -0000 1.3
+++ sys/dev/pci/if_ale.c 1 May 2009 16:43:48 -0000
@@ -84,7 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1
#include <dev/pci/if_alereg.h>
static int ale_match(device_t, cfdata_t, void *);
-static void ale_attach(device_t, device_t, void *);
+static int ale_attach(device_t, device_t, void *);
static int ale_detach(device_t, int);
static int ale_miibus_readreg(device_t, int, int);
@@ -360,7 +360,7 @@ ale_phy_reset(struct ale_softc *sc)
DELAY(1000);
}
-void
+int
ale_attach(device_t parent, device_t self, void *aux)
{
struct ale_softc *sc = device_private(self);
@@ -398,7 +398,7 @@ ale_attach(device_t parent, device_t sel
if (pci_mapreg_map(pa, ALE_PCIR_BAR, memtype, 0, &sc->sc_mem_bt,
&sc->sc_mem_bh, NULL, &sc->sc_mem_size)) {
aprint_error_dev(self, "could not map mem space\n");
- return;
+ return ENXIO;
}
if (pci_intr_map(pa, &ih) != 0) {
@@ -557,7 +557,7 @@ ale_attach(device_t parent, device_t sel
else
pmf_class_network_register(self, ifp);
- return;
+ return 0;
fail:
ale_dma_free(sc);
if (sc->sc_irq_handle != NULL) {
@@ -568,6 +568,7 @@ fail:
bus_space_unmap(sc->sc_mem_bt, sc->sc_mem_bh, sc->sc_mem_size);
sc->sc_mem_size = 0;
}
+ return ENXIO;
}
static int
Index: sys/dev/pci/if_an_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_an_pci.c,v
retrieving revision 1.27
diff -u -p -r1.27 if_an_pci.c
--- sys/dev/pci/if_an_pci.c 3 Jul 2008 18:10:08 -0000 1.27
+++ sys/dev/pci/if_an_pci.c 1 May 2009 16:43:48 -0000
@@ -82,7 +82,7 @@ struct an_pci_softc {
};
static int an_pci_match(struct device *, struct cfdata *, void *);
-static void an_pci_attach(struct device *, struct device *, void *);
+static int an_pci_attach(struct device *, struct device *, void *);
CFATTACH_DECL_NEW(an_pci, sizeof(struct an_pci_softc),
an_pci_match, an_pci_attach, NULL, NULL);
@@ -113,7 +113,7 @@ an_pci_match(struct device *parent, stru
return 0;
}
-static void
+static int
an_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa = (struct pci_attach_args *)aux;
@@ -138,7 +138,7 @@ an_pci_attach(struct device *parent, str
if (pci_mapreg_map(pa, AN_PCI_IOBA, PCI_MAPREG_TYPE_IO, 0,
&sc->sc_iot, &sc->sc_ioh, NULL, &iosize) != 0) {
aprint_error_dev(self, "unable to map registers\n");
- return;
+ return ENXIO;
}
/* Enable the device. */
@@ -149,7 +149,7 @@ an_pci_attach(struct device *parent, str
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
psc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_NET, an_intr, sc);
@@ -158,7 +158,7 @@ an_pci_attach(struct device *parent, str
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
sc->sc_enabled = 1;
@@ -173,4 +173,5 @@ an_pci_attach(struct device *parent, str
aprint_error_dev(self, "couldn't establish power handler\n");
else
pmf_class_network_register(self, &sc->sc_if);
+ return 0;
}
Index: sys/dev/pci/if_ath_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ath_pci.c,v
retrieving revision 1.32
diff -u -p -r1.32 if_ath_pci.c
--- sys/dev/pci/if_ath_pci.c 11 Dec 2008 05:45:30 -0000 1.32
+++ sys/dev/pci/if_ath_pci.c 1 May 2009 16:43:48 -0000
@@ -94,7 +94,7 @@ struct ath_pci_softc {
#define BS_BAR 0x10
-static void ath_pci_attach(device_t, device_t, void *);
+static int ath_pci_attach(device_t, device_t, void *);
static int ath_pci_detach(device_t, int);
static int ath_pci_match(device_t, cfdata_t, void *);
static int ath_pci_detach(device_t, int);
@@ -199,7 +199,7 @@ ath_pci_setup(struct ath_pci_softc *sc)
return 1;
}
-static void
+static int
ath_pci_attach(device_t parent, device_t self, void *aux)
{
struct ath_pci_softc *psc = device_private(self);
@@ -266,7 +266,7 @@ ath_pci_attach(device_t parent, device_t
pmf_class_network_register(self, &sc->sc_if);
pmf_device_suspend_self(self);
}
- return;
+ return 0;
bad3:
ATH_LOCK_DESTROY(sc);
@@ -275,7 +275,7 @@ bad2: /* XXX */
bad1:
bus_space_unmap(psc->sc_iot, psc->sc_ioh, psc->sc_mapsz);
bad: /* XXX */
- return;
+ return ENXIO;
}
static int
Index: sys/dev/pci/if_atw_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_atw_pci.c,v
retrieving revision 1.20
diff -u -p -r1.20 if_atw_pci.c
--- sys/dev/pci/if_atw_pci.c 9 Jul 2008 20:07:19 -0000 1.20
+++ sys/dev/pci/if_atw_pci.c 1 May 2009 16:43:48 -0000
@@ -89,7 +89,7 @@ struct atw_pci_softc {
};
static int atw_pci_match(device_t, struct cfdata *, void *);
-static void atw_pci_attach(device_t, device_t, void *);
+static int atw_pci_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(atw_pci, sizeof(struct atw_pci_softc),
atw_pci_match, atw_pci_attach, NULL, NULL);
@@ -158,7 +158,7 @@ atw_pci_disable(struct atw_softc *sc)
psc->psc_intrcookie = NULL;
}
-static void
+static int
atw_pci_attach(device_t parent, device_t self, void *aux)
{
struct atw_pci_softc *psc = device_private(self);
@@ -200,7 +200,7 @@ atw_pci_attach(device_t parent, device_t
if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self,
NULL)) && error != EOPNOTSUPP) {
aprint_error_dev(self, "cannot activate %d\n", error);
- return;
+ return ENXIO;
}
/*
@@ -221,7 +221,7 @@ atw_pci_attach(device_t parent, device_t
sc->sc_sh = ioh;
} else {
printf(": unable to map device registers\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -254,7 +254,7 @@ atw_pci_attach(device_t parent, device_t
*/
if (pci_intr_map(pa, &psc->psc_ih)) {
aprint_error_dev(self, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, psc->psc_ih);
psc->psc_intrcookie = pci_intr_establish(pc, psc->psc_ih, IPL_NET,
@@ -264,7 +264,7 @@ atw_pci_attach(device_t parent, device_t
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -276,4 +276,5 @@ atw_pci_attach(device_t parent, device_t
* Finish off the attach.
*/
atw_attach(sc);
+ return 0;
}
Index: sys/dev/pci/if_bce.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_bce.c,v
retrieving revision 1.24
diff -u -p -r1.24 if_bce.c
--- sys/dev/pci/if_bce.c 18 Jan 2009 10:00:51 -0000 1.24
+++ sys/dev/pci/if_bce.c 1 May 2009 16:43:49 -0000
@@ -169,7 +169,7 @@ do {
\
} while (/* CONSTCOND */ 0)
static int bce_probe(device_t, struct cfdata *, void *);
-static void bce_attach(device_t, device_t, void *);
+static int bce_attach(device_t, device_t, void *);
static int bce_ioctl(struct ifnet *, u_long, void *);
static void bce_start(struct ifnet *);
static void bce_watchdog(struct ifnet *);
@@ -243,7 +243,7 @@ bce_probe(device_t parent, struct cfdata
return (0);
}
-static void
+static int
bce_attach(device_t parent, device_t self, void *aux)
{
struct bce_softc *sc = device_private(self);
@@ -288,7 +288,7 @@ bce_attach(device_t parent, device_t sel
if (!(command & PCI_COMMAND_MEM_ENABLE)) {
aprint_error_dev(self, "failed to enable memory mapping!\n");
- return;
+ return ENXIO;
}
memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, BCE_PCI_BAR0);
switch (memtype) {
@@ -299,7 +299,7 @@ bce_attach(device_t parent, device_t sel
break;
default:
aprint_error_dev(self, "unable to find mem space\n");
- return;
+ return ENXIO;
}
/* Get it out of power save mode if needed. */
@@ -312,7 +312,7 @@ bce_attach(device_t parent, device_t sel
*/
aprint_error_dev(self,
"unable to wake up from power state D3\n");
- return;
+ return ENXIO;
}
if (pmode != 0) {
aprint_normal_dev(self,
@@ -322,7 +322,7 @@ bce_attach(device_t parent, device_t sel
}
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
@@ -333,7 +333,7 @@ bce_attach(device_t parent, device_t sel
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -355,7 +355,7 @@ bce_attach(device_t parent, device_t sel
aprint_error_dev(self,
"unable to alloc space for ring descriptors, error = %d\n",
error);
- return;
+ return ENXIO;
}
/* map ring space to kernel */
if ((error = bus_dmamem_map(sc->bce_dmatag, &seg, rseg,
@@ -363,7 +363,7 @@ bce_attach(device_t parent, device_t sel
aprint_error_dev(self,
"unable to map DMA buffers, error = %d\n", error);
bus_dmamem_free(sc->bce_dmatag, &seg, rseg);
- return;
+ return ENXIO;
}
/* create a dma map for the ring */
if ((error = bus_dmamap_create(sc->bce_dmatag,
@@ -373,7 +373,7 @@ bce_attach(device_t parent, device_t sel
"unable to create ring DMA map, error = %d\n", error);
bus_dmamem_unmap(sc->bce_dmatag, kva, 2 * PAGE_SIZE);
bus_dmamem_free(sc->bce_dmatag, &seg, rseg);
- return;
+ return ENXIO;
}
/* connect the ring space to the dma map */
if (bus_dmamap_load(sc->bce_dmatag, sc->bce_ring_map, kva,
@@ -381,7 +381,7 @@ bce_attach(device_t parent, device_t sel
bus_dmamap_destroy(sc->bce_dmatag, sc->bce_ring_map);
bus_dmamem_unmap(sc->bce_dmatag, kva, 2 * PAGE_SIZE);
bus_dmamem_free(sc->bce_dmatag, &seg, rseg);
- return;
+ return ENXIO;
}
/* save the ring space in softc */
sc->bce_rx_ring = (struct bce_dma_slot *) kva;
@@ -476,6 +476,7 @@ bce_attach(device_t parent, device_t sel
aprint_error_dev(self, "couldn't establish power handler\n");
} else
pmf_class_network_register(self, ifp);
+ return 0;
}
/* handle media, and ethernet requests */
Index: sys/dev/pci/if_bge.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_bge.c,v
retrieving revision 1.164
diff -u -p -r1.164 if_bge.c
--- sys/dev/pci/if_bge.c 23 Apr 2009 10:47:44 -0000 1.164
+++ sys/dev/pci/if_bge.c 1 May 2009 16:43:50 -0000
@@ -191,7 +191,7 @@ static int bge_rxthresh_nodenum;
typedef int (*bge_eaddr_fcn_t)(struct bge_softc *, u_int8_t[]);
static int bge_probe(device_t, cfdata_t, void *);
-static void bge_attach(device_t, device_t, void *);
+static int bge_attach(device_t, device_t, void *);
static void bge_release_resources(struct bge_softc *);
static void bge_txeof(struct bge_softc *);
static void bge_rxeof(struct bge_softc *);
@@ -2276,7 +2276,7 @@ bge_probe(device_t parent, cfdata_t matc
return (0);
}
-static void
+static int
bge_attach(device_t parent, device_t self, void *aux)
{
struct bge_softc *sc = device_private(self);
@@ -2323,7 +2323,7 @@ bge_attach(device_t parent, device_t sel
if (!(command & PCI_COMMAND_MEM_ENABLE)) {
aprint_error_dev(sc->bge_dev,
"failed to enable memory mapping!\n");
- return;
+ return ENXIO;
}
DPRINTFN(5, ("pci_mem_find\n"));
@@ -2337,13 +2337,13 @@ bge_attach(device_t parent, device_t sel
break;
default:
aprint_error_dev(sc->bge_dev, "can't find mem space\n");
- return;
+ return ENXIO;
}
DPRINTFN(5, ("pci_intr_map\n"));
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(sc->bge_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
DPRINTFN(5, ("pci_intr_string\n"));
@@ -2356,7 +2356,7 @@ bge_attach(device_t parent, device_t sel
aprint_error_dev(sc->bge_dev,
"couldn't establish interrupt%s%s\n",
intrstr ? " at " : "", intrstr ? intrstr : "");
- return;
+ return ENXIO;
}
aprint_normal_dev(sc->bge_dev, "interrupting at %s\n", intrstr);
@@ -2423,7 +2423,7 @@ bge_attach(device_t parent, device_t sel
if (bge_chipinit(sc)) {
aprint_error_dev(sc->bge_dev, "chip initialization failed\n");
bge_release_resources(sc);
- return;
+ return ENXIO;
}
/*
@@ -2433,7 +2433,7 @@ bge_attach(device_t parent, device_t sel
aprint_error_dev(sc->bge_dev,
"failed to reade station address\n");
bge_release_resources(sc);
- return;
+ return ENXIO;
}
br = bge_lookup_rev(sc->bge_chipid);
@@ -2456,7 +2456,7 @@ bge_attach(device_t parent, device_t sel
if (bus_dmamem_alloc(sc->bge_dmatag, sizeof(struct bge_ring_data),
PAGE_SIZE, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT)) {
aprint_error_dev(sc->bge_dev, "can't alloc rx buffers\n");
- return;
+ return ENXIO;
}
DPRINTFN(5, ("bus_dmamem_map\n"));
if (bus_dmamem_map(sc->bge_dmatag, &seg, rseg,
@@ -2466,7 +2466,7 @@ bge_attach(device_t parent, device_t sel
"can't map DMA buffers (%zu bytes)\n",
sizeof(struct bge_ring_data));
bus_dmamem_free(sc->bge_dmatag, &seg, rseg);
- return;
+ return ENXIO;
}
DPRINTFN(5, ("bus_dmamem_create\n"));
if (bus_dmamap_create(sc->bge_dmatag, sizeof(struct bge_ring_data), 1,
@@ -2476,7 +2476,7 @@ bge_attach(device_t parent, device_t sel
bus_dmamem_unmap(sc->bge_dmatag, kva,
sizeof(struct bge_ring_data));
bus_dmamem_free(sc->bge_dmatag, &seg, rseg);
- return;
+ return ENXIO;
}
DPRINTFN(5, ("bus_dmamem_load\n"));
if (bus_dmamap_load(sc->bge_dmatag, sc->bge_ring_map, kva,
@@ -2486,7 +2486,7 @@ bge_attach(device_t parent, device_t sel
bus_dmamem_unmap(sc->bge_dmatag, kva,
sizeof(struct bge_ring_data));
bus_dmamem_free(sc->bge_dmatag, &seg, rseg);
- return;
+ return ENXIO;
}
DPRINTFN(5, ("bzero\n"));
@@ -2670,6 +2670,7 @@ bge_attach(device_t parent, device_t sel
dict = device_properties(self);
prop_dictionary_set_uint32(dict, "phyflags", sc->bge_flags);
+ return 0;
}
static void
Index: sys/dev/pci/if_bnx.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_bnx.c,v
retrieving revision 1.26
diff -u -p -r1.26 if_bnx.c
--- sys/dev/pci/if_bnx.c 17 Apr 2009 23:23:23 -0000 1.26
+++ sys/dev/pci/if_bnx.c 1 May 2009 16:43:51 -0000
@@ -242,7 +242,7 @@ static struct flash_spec flash_table[] =
/* OpenBSD device entry points. */
/****************************************************************************/
static int bnx_probe(device_t, cfdata_t, void *);
-void bnx_attach(device_t, device_t, void *);
+int bnx_attach(device_t, device_t, void *);
int bnx_detach(device_t, int);
/****************************************************************************/
@@ -401,7 +401,7 @@ bnx_probe(device_t parent, cfdata_t matc
/* Returns: */
/* 0 on success, positive value on failure. */
/****************************************************************************/
-void
+int
bnx_attach(device_t parent, device_t self, void *aux)
{
const struct bnx_product *bp;
@@ -438,7 +438,7 @@ bnx_attach(device_t parent, device_t sel
if (!(command & PCI_COMMAND_MEM_ENABLE)) {
aprint_error_dev(sc->bnx_dev,
"failed to enable memory mapping!\n");
- return;
+ return ENXIO;
}
memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, BNX_PCI_BAR0);
@@ -451,7 +451,7 @@ bnx_attach(device_t parent, device_t sel
break;
default:
aprint_error_dev(sc->bnx_dev, "can't find mem space\n");
- return;
+ return ENXIO;
}
if (pci_intr_map(pa, &ih)) {
@@ -702,13 +702,12 @@ bnx_attach(device_t parent, device_t sel
/* Print some important debugging info. */
DBRUN(BNX_INFO, bnx_dump_driver_state(sc));
- goto bnx_attach_exit;
+ return 0;
bnx_attach_fail:
bnx_release_resources(sc);
-
-bnx_attach_exit:
DBPRINT(sc, BNX_VERBOSE_RESET, "Exiting %s()\n", __func__);
+ return ENXIO;
}
/****************************************************************************/
Index: sys/dev/pci/if_bwi_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_bwi_pci.c,v
retrieving revision 1.8
diff -u -p -r1.8 if_bwi_pci.c
--- sys/dev/pci/if_bwi_pci.c 26 Apr 2009 10:45:19 -0000 1.8
+++ sys/dev/pci/if_bwi_pci.c 1 May 2009 16:43:51 -0000
@@ -58,7 +58,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_bwi_pci.c
#define BWI_PCI_BAR0 0x10
static int bwi_pci_match(device_t, cfdata_t, void *);
-static void bwi_pci_attach(device_t, device_t, void *);
+static int bwi_pci_attach(device_t, device_t, void *);
static int bwi_pci_detach(device_t, int);
static void bwi_pci_conf_write(void *, uint32_t, uint32_t);
static uint32_t bwi_pci_conf_read(void *, uint32_t);
@@ -102,7 +102,7 @@ bwi_pci_match(device_t parent, cfdata_t
return (0);
}
-static void
+static int
bwi_pci_attach(device_t parent, device_t self, void *aux)
{
struct bwi_pci_softc *psc = device_private(self);
@@ -129,7 +129,7 @@ bwi_pci_attach(device_t parent, device_t
break;
default:
aprint_error_dev(self, "invalid base address register\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, BWI_PCI_BAR0,
@@ -137,7 +137,7 @@ bwi_pci_attach(device_t parent, device_t
NULL, &psc->psc_mapsize) != 0)
{
aprint_error_dev(self, "could not map mem space\n");
- return;
+ return ENXIO;
}
/* map interrupt */
@@ -175,7 +175,7 @@ bwi_pci_attach(device_t parent, device_t
error = bwi_attach(sc);
if (error)
goto fail;
- return;
+ return 0;
fail:
if (sc->sc_ih) {
@@ -186,7 +186,7 @@ fail:
bus_space_unmap(sc->sc_mem_bt, sc->sc_mem_bh, psc->psc_mapsize);
psc->psc_mapsize = 0;
}
- return;
+ return ENXIO;
}
int
Index: sys/dev/pci/if_dge.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_dge.c,v
retrieving revision 1.23
diff -u -p -r1.23 if_dge.c
--- sys/dev/pci/if_dge.c 13 Feb 2009 01:38:32 -0000 1.23
+++ sys/dev/pci/if_dge.c 1 May 2009 16:43:51 -0000
@@ -632,7 +632,7 @@ static void dge_rxintr(struct dge_softc
static void dge_linkintr(struct dge_softc *, uint32_t);
static int dge_match(struct device *, struct cfdata *, void *);
-static void dge_attach(struct device *, struct device *, void *);
+static int dge_attach(struct device *, struct device *, void *);
static int dge_read_eeprom(struct dge_softc *sc);
static int dge_eeprom_clockin(struct dge_softc *sc);
@@ -666,7 +666,7 @@ dge_match(struct device *parent, struct
return (0);
}
-static void
+static int
dge_attach(struct device *parent, struct device *self, void *aux)
{
struct dge_softc *sc = (void *) self;
@@ -693,7 +693,7 @@ dge_attach(struct device *parent, struct
if (pci_mapreg_map(pa, DGE_PCI_BAR, memtype, 0,
&sc->sc_st, &sc->sc_sh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "unable to map device
registers\n");
- return;
+ return ENXIO;
}
/* Enable bus mastering */
@@ -706,7 +706,7 @@ dge_attach(struct device *parent, struct
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, dge_intr, sc);
@@ -715,7 +715,7 @@ dge_attach(struct device *parent, struct
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
@@ -796,7 +796,7 @@ dge_attach(struct device *parent, struct
#ifdef DGE_OFFBYONE_RXBUG
if (dge_alloc_rcvmem(sc) != 0)
- return; /* Already complained */
+ return ENXIO; /* Already complained */
#endif
/*
* Create the transmit buffer DMA maps.
@@ -852,7 +852,7 @@ dge_attach(struct device *parent, struct
*/
if (dge_read_eeprom(sc)) {
aprint_error_dev(&sc->sc_dev, "couldn't read EEPROM\n");
- return;
+ return ENXIO;
}
/*
@@ -966,7 +966,7 @@ dge_attach(struct device *parent, struct
sc->sc_sdhook = shutdownhook_establish(dge_shutdown, sc);
if (sc->sc_sdhook == NULL)
aprint_error_dev(&sc->sc_dev, "WARNING: unable to establish
shutdown hook\n");
- return;
+ return 0;
/*
* Free any resources we've allocated during the failed attach
@@ -993,7 +993,7 @@ dge_attach(struct device *parent, struct
fail_1:
bus_dmamem_free(sc->sc_dmat, &seg, rseg);
fail_0:
- return;
+ return ENXIO;
}
/*
Index: sys/dev/pci/if_en_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_en_pci.c,v
retrieving revision 1.29
diff -u -p -r1.29 if_en_pci.c
--- sys/dev/pci/if_en_pci.c 15 Mar 2009 15:48:14 -0000 1.29
+++ sys/dev/pci/if_en_pci.c 1 May 2009 16:43:51 -0000
@@ -120,7 +120,7 @@ static void adp_get_macaddr(struct en_p
*/
static int en_pci_match(struct device *, struct cfdata *, void *);
-static void en_pci_attach(struct device *, struct device *, void *);
+static int en_pci_attach(struct device *, struct device *, void *);
/*
* PCI autoconfig attachments
@@ -185,7 +185,7 @@ en_pci_match(struct device *parent, stru
}
-static void
+static int
en_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct en_softc *sc = (void *)self;
@@ -214,7 +214,7 @@ en_pci_attach(struct device *parent, str
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(scp->en_pc, ih);
scp->sc_ih = pci_intr_establish(scp->en_pc, ih, IPL_NET, en_intr, sc);
@@ -223,7 +223,7 @@ en_pci_attach(struct device *parent, str
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
sc->ipl = 1; /* XXX */
@@ -237,7 +237,7 @@ en_pci_attach(struct device *parent, str
&sc->en_memt, &sc->en_base, NULL, &sc->en_obmemsz);
if (retval) {
aprint_error_dev(&sc->sc_dev, "couldn't map memory\n");
- return;
+ return ENXIO;
}
/*
@@ -266,7 +266,7 @@ en_pci_attach(struct device *parent, str
*/
en_attach(sc);
-
+ return 0;
}
#if 0
Index: sys/dev/pci/if_ep_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ep_pci.c,v
retrieving revision 1.49
diff -u -p -r1.49 if_ep_pci.c
--- sys/dev/pci/if_ep_pci.c 27 Aug 2008 05:33:47 -0000 1.49
+++ sys/dev/pci/if_ep_pci.c 1 May 2009 16:43:51 -0000
@@ -98,7 +98,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ep_pci.c,
#define PCI_CBIO 0x10 /* Configuration Base IO Address */
static int ep_pci_match(device_t , cfdata_t , void *);
-static void ep_pci_attach(device_t , device_t , void *);
+static int ep_pci_attach(device_t , device_t , void *);
CFATTACH_DECL_NEW(ep_pci, sizeof(struct ep_softc),
ep_pci_match, ep_pci_attach, NULL, NULL);
@@ -172,7 +172,7 @@ ep_pci_match(device_t parent, cfdata_t m
return (0);
}
-static void
+static int
ep_pci_attach(device_t parent, device_t self, void *aux)
{
struct ep_softc *sc = device_private(self);
@@ -187,7 +187,7 @@ ep_pci_attach(device_t parent, device_t
if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
&sc->sc_iot, &sc->sc_ioh, NULL, NULL)) {
aprint_error(": can't map i/o space\n");
- return;
+ return ENXIO;
}
epp = ep_pci_lookup(pa);
@@ -214,7 +214,7 @@ ep_pci_attach(device_t parent, device_t
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, epintr, sc);
@@ -223,9 +223,10 @@ ep_pci_attach(device_t parent, device_t
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(sc->sc_dev, "interrupting at %s\n", intrstr);
epconfig(sc, epp->epp_chipset, NULL);
+ return 0;
}
Index: sys/dev/pci/if_epic_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_epic_pci.c,v
retrieving revision 1.37
diff -u -p -r1.37 if_epic_pci.c
--- sys/dev/pci/if_epic_pci.c 6 Jul 2008 14:32:56 -0000 1.37
+++ sys/dev/pci/if_epic_pci.c 1 May 2009 16:43:51 -0000
@@ -79,7 +79,7 @@ struct epic_pci_softc {
};
static int epic_pci_match(device_t, cfdata_t, void *);
-static void epic_pci_attach(device_t, device_t, void *);
+static int epic_pci_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(epic_pci, sizeof(struct epic_pci_softc),
epic_pci_match, epic_pci_attach, NULL, NULL);
@@ -149,7 +149,7 @@ epic_pci_match(device_t parent, cfdata_t
return 0;
}
-static void
+static int
epic_pci_attach(device_t parent, device_t self, void *aux)
{
struct epic_pci_softc *psc = device_private(self);
@@ -182,7 +182,7 @@ epic_pci_attach(device_t parent, device_
if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self,
NULL)) && error != EOPNOTSUPP) {
aprint_error_dev(self, "cannot activate %d\n", error);
- return;
+ return ENXIO;
}
/*
@@ -203,7 +203,7 @@ epic_pci_attach(device_t parent, device_
sc->sc_sh = ioh;
} else {
aprint_error_dev(self, "unable to map device registers\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -218,7 +218,7 @@ epic_pci_attach(device_t parent, device_
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, epic_intr, sc);
@@ -227,7 +227,7 @@ epic_pci_attach(device_t parent, device_
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -239,4 +239,5 @@ epic_pci_attach(device_t parent, device_
* Finish off the attach.
*/
epic_attach(sc);
+ return 0;
}
Index: sys/dev/pci/if_esh_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_esh_pci.c,v
retrieving revision 1.24
diff -u -p -r1.24 if_esh_pci.c
--- sys/dev/pci/if_esh_pci.c 28 Apr 2008 20:23:55 -0000 1.24
+++ sys/dev/pci/if_esh_pci.c 1 May 2009 16:43:52 -0000
@@ -74,7 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_esh_pci.c
#define MEM_MAP_REG 0x10
static int esh_pci_match(struct device *, struct cfdata *, void *);
-static void esh_pci_attach(struct device *, struct device *, void *);
+static int esh_pci_attach(struct device *, struct device *, void *);
static u_int8_t esh_pci_bist_read(struct esh_softc *);
static void esh_pci_bist_write(struct esh_softc *, u_int8_t);
@@ -101,7 +101,7 @@ esh_pci_match(struct device *parent, str
return 1;
}
-static void
+static int
esh_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct esh_softc *sc = (void *)self;
@@ -117,7 +117,7 @@ esh_pci_attach(struct device *parent, st
PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
&sc->sc_iot, &sc->sc_ioh, NULL, NULL) != 0) {
aprint_error(": unable to map memory device registers\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -149,7 +149,7 @@ esh_pci_attach(struct device *parent, st
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, eshintr, sc);
@@ -158,9 +158,10 @@ esh_pci_attach(struct device *parent, st
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
+ return 0;
}
static u_int8_t
Index: sys/dev/pci/if_ex_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ex_pci.c,v
retrieving revision 1.49
diff -u -p -r1.49 if_ex_pci.c
--- sys/dev/pci/if_ex_pci.c 28 Apr 2008 20:23:55 -0000 1.49
+++ sys/dev/pci/if_ex_pci.c 1 May 2009 16:43:52 -0000
@@ -92,7 +92,7 @@ struct ex_pci_softc {
#define PCI_INTRACK 0x00008000
static int ex_pci_match(device_t, cfdata_t, void *);
-static void ex_pci_attach(device_t, device_t, void *);
+static int ex_pci_attach(device_t, device_t, void *);
static void ex_pci_intr_ack(struct ex_softc *);
static int ex_pci_enable(struct ex_softc *);
@@ -203,7 +203,7 @@ ex_pci_match(device_t parent, cfdata_t m
return (0);
}
-static void
+static int
ex_pci_attach(device_t parent, device_t self, void *aux)
{
struct ex_pci_softc *psc = device_private(self);
@@ -223,7 +223,7 @@ ex_pci_attach(device_t parent, device_t
if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
&sc->sc_iot, &sc->sc_ioh, NULL, NULL)) {
aprint_error(": can't map i/o space\n");
- return;
+ return ENXIO;
}
epp = ex_pci_lookup(pa);
@@ -260,7 +260,7 @@ ex_pci_attach(device_t parent, device_t
&psc->sc_funct, &psc->sc_funch, NULL, NULL)) {
aprint_error_dev(self,
"unable to map function status window\n");
- return;
+ return ENXIO;
}
sc->intr_ack = ex_pci_intr_ack;
@@ -281,14 +281,14 @@ ex_pci_attach(device_t parent, device_t
break;
default:
aprint_error_dev(self, "cannot activate %d\n", error);
- return;
+ return ENXIO;
}
sc->enabled = 1;
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
@@ -298,7 +298,7 @@ ex_pci_attach(device_t parent, device_t
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -310,6 +310,7 @@ ex_pci_attach(device_t parent, device_t
if (sc->disable != NULL)
ex_disable(sc);
+ return 0;
}
static void
Index: sys/dev/pci/if_fpa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_fpa.c,v
retrieving revision 1.52
diff -u -p -r1.52 if_fpa.c
--- sys/dev/pci/if_fpa.c 18 Apr 2009 14:58:03 -0000 1.52
+++ sys/dev/pci/if_fpa.c 1 May 2009 16:43:52 -0000
@@ -406,7 +406,7 @@ pdq_pci_match(
return 1;
}
-static void
+static int
pdq_pci_attach(
struct device * const parent,
struct device * const self,
@@ -459,7 +459,7 @@ pdq_pci_attach(
#endif /* DEFPA_IOMAPPED */
else {
aprint_error(": unable to map device registers\n");
- return;
+ return ENXIO;
}
sc->sc_dmatag = pa->pa_dmat;
@@ -475,14 +475,14 @@ pdq_pci_attach(
(void *) sc, PDQ_DEFPA);
if (sc->sc_pdq == NULL) {
aprint_error_dev(&sc->sc_dev, "initialization failed\n");
- return;
+ return ENXIO;
}
pdq_ifattach(sc, pdq_pci_ifwatchdog);
if (pci_intr_map(pa, &intrhandle)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, intrhandle);
sc->sc_ih = pci_intr_establish(pa->pa_pc, intrhandle, IPL_NET,
pdq_pci_ifintr, sc);
@@ -491,7 +491,7 @@ pdq_pci_attach(
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
sc->sc_ats = shutdownhook_establish((void (*)(void *)) pdq_hwreset,
sc->sc_pdq);
@@ -499,6 +499,7 @@ pdq_pci_attach(
aprint_error_dev(self, "warning: couldn't establish shutdown hook\n");
if (intrstr != NULL)
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
+ return 0;
}
CFATTACH_DECL(fpa, sizeof(pdq_softc_t),
Index: sys/dev/pci/if_fxp_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_fxp_pci.c,v
retrieving revision 1.69
diff -u -p -r1.69 if_fxp_pci.c
--- sys/dev/pci/if_fxp_pci.c 17 Apr 2009 15:37:43 -0000 1.69
+++ sys/dev/pci/if_fxp_pci.c 1 May 2009 16:43:52 -0000
@@ -86,7 +86,7 @@ struct fxp_pci_softc {
};
static int fxp_pci_match(device_t, cfdata_t, void *);
-static void fxp_pci_attach(device_t, device_t, void *);
+static int fxp_pci_attach(device_t, device_t, void *);
static int fxp_pci_enable(struct fxp_softc *);
static void fxp_pci_disable(struct fxp_softc *);
@@ -243,7 +243,7 @@ fxp_pci_resume(device_t dv PMF_FN_ARGS)
return true;
}
-static void
+static int
fxp_pci_attach(device_t parent, device_t self, void *aux)
{
struct fxp_pci_softc *psc = device_private(self);
@@ -314,7 +314,7 @@ fxp_pci_attach(device_t parent, device_t
sc->sc_sh = ioh;
} else {
aprint_error(": unable to map device registers\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -450,7 +450,7 @@ fxp_pci_attach(device_t parent, device_t
break;
default:
aprint_error_dev(self, "cannot activate %d\n", error);
- return;
+ return ENXIO;
}
/* Restore PCI configuration registers. */
@@ -463,7 +463,7 @@ fxp_pci_attach(device_t parent, device_t
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, fxp_intr, sc);
@@ -472,7 +472,7 @@ fxp_pci_attach(device_t parent, device_t
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -486,6 +486,7 @@ fxp_pci_attach(device_t parent, device_t
aprint_error_dev(self, "couldn't establish power handler\n");
else
pmf_class_network_register(self, &sc->sc_ethercom.ec_if);
+ return 0;
}
static int
Index: sys/dev/pci/if_hme_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_hme_pci.c,v
retrieving revision 1.25
diff -u -p -r1.25 if_hme_pci.c
--- sys/dev/pci/if_hme_pci.c 29 May 2008 14:51:27 -0000 1.25
+++ sys/dev/pci/if_hme_pci.c 1 May 2009 16:43:52 -0000
@@ -75,7 +75,7 @@ struct hme_pci_softc {
};
int hmematch_pci(struct device *, struct cfdata *, void *);
-void hmeattach_pci(struct device *, struct device *, void *);
+int hmeattach_pci(struct device *, struct device *, void *);
CFATTACH_DECL(hme_pci, sizeof(struct hme_pci_softc),
hmematch_pci, hmeattach_pci, NULL, NULL);
@@ -121,7 +121,7 @@ hmevpdoff(bus_space_tag_t romt, bus_spac
}
#endif
-void
+int
hmeattach_pci(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -196,28 +196,28 @@ hmeattach_pci(struct device *parent, str
&hsc->hsc_memt, &hsc->hsc_memh, NULL, NULL) != 0)
{
aprint_error_dev(&sc->sc_dev, "unable to map device
registers\n");
- return;
+ return ENXIO;
}
sc->sc_seb = hsc->hsc_memh;
if (bus_space_subregion(hsc->hsc_memt, hsc->hsc_memh, 0x2000,
0x1000, &sc->sc_etx)) {
aprint_error_dev(&sc->sc_dev, "unable to subregion ETX
registers\n");
- return;
+ return ENXIO;
}
if (bus_space_subregion(hsc->hsc_memt, hsc->hsc_memh, 0x4000,
0x1000, &sc->sc_erx)) {
aprint_error_dev(&sc->sc_dev, "unable to subregion ERX
registers\n");
- return;
+ return ENXIO;
}
if (bus_space_subregion(hsc->hsc_memt, hsc->hsc_memh, 0x6000,
0x1000, &sc->sc_mac)) {
aprint_error_dev(&sc->sc_dev, "unable to subregion MAC
registers\n");
- return;
+ return ENXIO;
}
if (bus_space_subregion(hsc->hsc_memt, hsc->hsc_memh, 0x7000,
0x1000, &sc->sc_mif)) {
aprint_error_dev(&sc->sc_dev, "unable to subregion MIF
registers\n");
- return;
+ return ENXIO;
}
#if HME_USE_LOCAL_MAC_ADDRESS
@@ -306,7 +306,7 @@ hmeattach_pci(struct device *parent, str
*/
if (pci_intr_map(pa, &ih) != 0) {
aprint_error_dev(&sc->sc_dev, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
hsc->hsc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_NET, hme_intr, sc);
@@ -315,7 +315,7 @@ hmeattach_pci(struct device *parent, str
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
printf("%s: interrupting at %s\n", device_xname(&sc->sc_dev), intrstr);
@@ -323,4 +323,5 @@ hmeattach_pci(struct device *parent, str
/* Finish off the attach. */
hme_config(sc);
+ return 0;
}
Index: sys/dev/pci/if_ipw.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ipw.c,v
retrieving revision 1.45
diff -u -p -r1.45 if_ipw.c
--- sys/dev/pci/if_ipw.c 9 Jan 2009 21:14:36 -0000 1.45
+++ sys/dev/pci/if_ipw.c 1 May 2009 16:43:52 -0000
@@ -94,7 +94,7 @@ static int ipw_accept_eula;
static int ipw_dma_alloc(struct ipw_softc *);
static void ipw_release(struct ipw_softc *);
static int ipw_match(struct device *, struct cfdata *, void *);
-static void ipw_attach(struct device *, struct device *, void *);
+static int ipw_attach(struct device *, struct device *, void *);
static int ipw_detach(struct device *, int);
static int ipw_media_change(struct ifnet *);
@@ -173,7 +173,7 @@ ipw_match(struct device *parent, struct
/* Base Address Register */
#define IPW_PCI_BAR0 0x10
-static void
+static int
ipw_attach(struct device *parent, struct device *self, void *aux)
{
struct ipw_softc *sc = (struct ipw_softc *)self;
@@ -207,7 +207,7 @@ ipw_attach(struct device *parent, struct
PCI_MAPREG_MEM_TYPE_32BIT, 0, &memt, &memh, &base, &sc->sc_sz);
if (error != 0) {
aprint_error_dev(&sc->sc_dev, "could not map memory space\n");
- return;
+ return ENXIO;
}
sc->sc_st = memt;
@@ -220,7 +220,7 @@ ipw_attach(struct device *parent, struct
if (pci_intr_map(pa, &ih) != 0) {
aprint_error_dev(&sc->sc_dev, "could not map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(sc->sc_pct, ih);
@@ -230,7 +230,7 @@ ipw_attach(struct device *parent, struct
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
@@ -335,9 +335,10 @@ ipw_attach(struct device *parent, struct
ieee80211_announce(ic);
- return;
+ return 0;
fail: ipw_detach(self, 0);
+ return ENXIO;
}
static int
Index: sys/dev/pci/if_iwi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_iwi.c,v
retrieving revision 1.80
diff -u -p -r1.80 if_iwi.c
--- sys/dev/pci/if_iwi.c 13 Mar 2009 21:57:07 -0000 1.80
+++ sys/dev/pci/if_iwi.c 1 May 2009 16:43:53 -0000
@@ -94,7 +94,7 @@ int iwi_debug = 4;
static int iwi_accept_eula;
static int iwi_match(device_t, struct cfdata *, void *);
-static void iwi_attach(device_t, device_t, void *);
+static int iwi_attach(device_t, device_t, void *);
static int iwi_detach(device_t, int);
static int iwi_alloc_cmd_ring(struct iwi_softc *, struct iwi_cmd_ring *,
@@ -207,7 +207,7 @@ iwi_match(device_t parent, struct cfdata
/* Base Address Register */
#define IWI_PCI_BAR0 0x10
-static void
+static int
iwi_attach(device_t parent, device_t self, void *aux)
{
struct iwi_softc *sc = device_private(self);
@@ -238,7 +238,7 @@ iwi_attach(device_t parent, device_t sel
if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self,
NULL)) && error != EOPNOTSUPP) {
aprint_error_dev(self, "cannot activate %d\n", error);
- return;
+ return 0;
}
/* enable bus-mastering */
@@ -251,7 +251,7 @@ iwi_attach(device_t parent, device_t sel
PCI_MAPREG_MEM_TYPE_32BIT, 0, &memt, &memh, NULL, &sc->sc_sz);
if (error != 0) {
aprint_error_dev(self, "could not map memory space\n");
- return;
+ return 0;
}
sc->sc_st = memt;
@@ -263,7 +263,7 @@ iwi_attach(device_t parent, device_t sel
if (pci_intr_map(pa, &ih) != 0) {
aprint_error_dev(self, "could not map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(sc->sc_pct, ih);
@@ -273,14 +273,14 @@ iwi_attach(device_t parent, device_t sel
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
if (iwi_reset(sc) != 0) {
pci_intr_disestablish(sc->sc_pct, sc->sc_ih);
aprint_error_dev(self, "could not reset adapter\n");
- return;
+ return ENXIO;
}
ic->ic_ifp = ifp;
@@ -436,9 +436,10 @@ iwi_attach(device_t parent, device_t sel
ieee80211_announce(ic);
- return;
+ return 0;
fail: iwi_detach(self, 0);
+ return ENXIO;
}
static int
Index: sys/dev/pci/if_iwn.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_iwn.c,v
retrieving revision 1.28
diff -u -p -r1.28 if_iwn.c
--- sys/dev/pci/if_iwn.c 22 Dec 2008 11:32:04 -0000 1.28
+++ sys/dev/pci/if_iwn.c 1 May 2009 16:43:54 -0000
@@ -94,7 +94,7 @@ static const struct ieee80211_rateset iw
#define EDCA_NUM_AC 4
static int iwn_match(device_t , struct cfdata *, void *);
-static void iwn_attach(device_t , device_t, void *);
+static int iwn_attach(device_t , device_t, void *);
static int iwn_detach(device_t, int);
static void iwn_radiotap_attach(struct iwn_softc *);
@@ -223,7 +223,7 @@ iwn_match(device_t parent, struct cfdata
/* Base Address Register */
#define IWN_PCI_BAR0 0x10
-static void
+static int
iwn_attach(device_t parent __unused, device_t self, void *aux)
{
struct iwn_softc *sc = device_private(self);
@@ -268,7 +268,7 @@ iwn_attach(device_t parent __unused, dev
&sc->sc_sh, NULL, &sc->sc_sz);
if (error != 0) {
aprint_error_dev(self, "could not map memory space\n");
- return;
+ return ENXIO;
}
#if 0
@@ -285,7 +285,7 @@ iwn_attach(device_t parent __unused, dev
if (pci_intr_map(pa, &ih) != 0) {
aprint_error_dev(self, "could not map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(sc->sc_pct, ih);
@@ -296,13 +296,13 @@ iwn_attach(device_t parent __unused, dev
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
if (iwn_reset(sc) != 0) {
aprint_error_dev(self, "could not reset adapter\n");
- return;
+ return ENXIO;
}
/*
@@ -310,7 +310,7 @@ iwn_attach(device_t parent __unused, dev
*/
if ((error = iwn_alloc_fwmem(sc)) != 0) {
aprint_error_dev(self, "could not allocate firmware memory\n");
- return;
+ return ENXIO;
}
/*
@@ -417,7 +417,7 @@ iwn_attach(device_t parent __unused, dev
ieee80211_announce(ic);
- return;
+ return 0;
/* free allocated memory if something failed during attachment */
fail4: while (--i >= 0)
@@ -426,6 +426,7 @@ fail4: while (--i >= 0)
fail3: iwn_free_shared(sc);
fail2: iwn_free_kw(sc);
fail1: iwn_free_fwmem(sc);
+ return ENXIO;
}
static int
Index: sys/dev/pci/if_jme.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_jme.c,v
retrieving revision 1.9
diff -u -p -r1.9 if_jme.c
--- sys/dev/pci/if_jme.c 18 Apr 2009 14:58:03 -0000 1.9
+++ sys/dev/pci/if_jme.c 1 May 2009 16:43:54 -0000
@@ -197,7 +197,7 @@ typedef struct jme_softc jme_softc_t;
typedef u_long ioctl_cmd_t;
static int jme_pci_match(device_t, cfdata_t, void *);
-static void jme_pci_attach(device_t, device_t, void *);
+static int jme_pci_attach(device_t, device_t, void *);
static void jme_intr_rx(jme_softc_t *);
static int jme_intr(void *);
@@ -274,7 +274,7 @@ jme_pci_match(device_t parent, cfdata_t
return 0;
}
-static void
+static int
jme_pci_attach(device_t parent, device_t self, void *aux)
{
jme_softc_t *sc = device_private(self);
@@ -315,20 +315,20 @@ jme_pci_attach(device_t parent, device_t
JME_PHY_EEPROM_SIZE, &sc->jme_bh_phy) != 0) {
aprint_error_dev(self, "can't subregion PHY space\n");
bus_space_unmap(memt, memh, size);
- return;
+ return ENXIO;
}
sc->jme_bt_misc = memt;
if (bus_space_subregion(memt, memh, JME_MISC_BASE_MEMOFF,
JME_MISC_SIZE, &sc->jme_bh_misc) != 0) {
aprint_error_dev(self, "can't subregion misc space\n");
bus_space_unmap(memt, memh, size);
- return;
+ return ENXIO;
}
} else {
if (pci_mapreg_map(pa, JME_PCI_BAR1, PCI_MAPREG_TYPE_IO,
0, &iot1, &ioh1, NULL, &size) != 0) {
aprint_error_dev(self, "can't map I/O space 1\n");
- return;
+ return ENXIO;
}
sc->jme_bt_mac = iot1;
sc->jme_bh_mac = ioh1;
@@ -336,7 +336,7 @@ jme_pci_attach(device_t parent, device_t
0, &iot2, &ioh2, NULL, &size2) != 0) {
aprint_error_dev(self, "can't map I/O space 2\n");
bus_space_unmap(iot1, ioh1, size);
- return;
+ return ENXIO;
}
sc->jme_bt_phy = iot2;
sc->jme_bh_phy = ioh2;
@@ -346,7 +346,7 @@ jme_pci_attach(device_t parent, device_t
aprint_error_dev(self, "can't subregion misc space\n");
bus_space_unmap(iot1, ioh1, size);
bus_space_unmap(iot2, ioh2, size2);
- return;
+ return ENXIO;
}
}
@@ -402,7 +402,7 @@ jme_pci_attach(device_t parent, device_t
/* Map and establish interrupts */
if (pci_intr_map(pa, &intrhandle)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, intrhandle);
sc->jme_if.if_softc = sc;
@@ -413,7 +413,7 @@ jme_pci_attach(device_t parent, device_t
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -428,7 +428,7 @@ jme_pci_attach(device_t parent, device_t
bus_dmamap_load(sc->jme_dmatag, sc->jme_txmap, sc->jme_txring,
PAGE_SIZE, NULL, BUS_DMA_NOWAIT) != 0) {
aprint_error_dev(self, "can't allocate DMA memory TX ring\n");
- return;
+ return ENXIO;
}
/* allocate and map DMA-safe memory for receive ring */
if (bus_dmamem_alloc(sc->jme_dmatag, PAGE_SIZE, 0, PAGE_SIZE,
@@ -441,7 +441,7 @@ jme_pci_attach(device_t parent, device_t
bus_dmamap_load(sc->jme_dmatag, sc->jme_rxmap, sc->jme_rxring,
PAGE_SIZE, NULL, BUS_DMA_NOWAIT) != 0) {
aprint_error_dev(self, "can't allocate DMA memory RX ring\n");
- return;
+ return ENXIO;
}
for (i = 0; i < JME_NBUFS; i++) {
sc->jme_txmbuf[i] = sc->jme_rxmbuf[i] = NULL;
@@ -449,13 +449,13 @@ jme_pci_attach(device_t parent, device_t
JME_NBUFS, JME_MAX_TX_LEN, 0, BUS_DMA_NOWAIT,
&sc->jme_txmbufm[i]) != 0) {
aprint_error_dev(self, "can't allocate DMA TX map\n");
- return;
+ return ENXIO;
}
if (bus_dmamap_create(sc->jme_dmatag, JME_MAX_RX_LEN,
1, JME_MAX_RX_LEN, 0, BUS_DMA_NOWAIT,
&sc->jme_rxmbufm[i]) != 0) {
aprint_error_dev(self, "can't allocate DMA RX map\n");
- return;
+ return ENXIO;
}
}
/*
@@ -530,7 +530,7 @@ jme_pci_attach(device_t parent, device_t
NULL, 0, NULL, 0, CTL_HW, jme_root_num, CTL_CREATE,
CTL_EOL) != 0) {
aprint_normal_dev(sc->jme_dev, "couldn't create sysctl node\n");
- return;
+ return ENXIO;
}
jme_nodenum = node->sysctl_num;
@@ -575,6 +575,7 @@ jme_pci_attach(device_t parent, device_t
aprint_normal_dev(sc->jme_dev,
"couldn't create int_txct sysctl node\n");
}
+ return 0;
}
static void
Index: sys/dev/pci/if_le_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_le_pci.c,v
retrieving revision 1.49
diff -u -p -r1.49 if_le_pci.c
--- sys/dev/pci/if_le_pci.c 28 Apr 2008 20:23:55 -0000 1.49
+++ sys/dev/pci/if_le_pci.c 1 May 2009 16:43:54 -0000
@@ -96,7 +96,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_le_pci.c,
#include <dev/pci/if_levar.h>
static int le_pci_match(device_t, cfdata_t, void *);
-static void le_pci_attach(device_t, device_t, void *);
+static int le_pci_attach(device_t, device_t, void *);
static int le_pci_mediachange(struct lance_softc *);
CFATTACH_DECL_NEW(le_pci, sizeof(struct le_softc),
@@ -221,7 +221,7 @@ le_pci_match(device_t parent, cfdata_t c
return (0);
}
-static void
+static int
le_pci_attach(device_t parent, device_t self, void *aux)
{
struct le_softc *lesc = device_private(self);
@@ -255,7 +255,7 @@ le_pci_attach(device_t parent, device_t
if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
&iot, &ioh, NULL, NULL)) {
aprint_error_dev(self, "can't map I/O space\n");
- return;
+ return ENXIO;
}
/*
@@ -274,13 +274,13 @@ le_pci_attach(device_t parent, device_t
if (bus_dmamem_alloc(dmat, LE_PCI_MEMSIZE, PAGE_SIZE, 0, &seg, 1,
&rseg, BUS_DMA_NOWAIT)) {
aprint_error_dev(self, "couldn't allocate memory for card\n");
- return;
+ return ENXIO;
}
if (bus_dmamem_map(dmat, &seg, rseg, LE_PCI_MEMSIZE,
(void **)&sc->sc_mem,
BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) {
aprint_error_dev(self, "couldn't map memory for card\n");
- return;
+ return ENXIO;
}
/*
@@ -290,13 +290,13 @@ le_pci_attach(device_t parent, device_t
LE_PCI_MEMSIZE, 0, BUS_DMA_NOWAIT, &lesc->sc_dmam)) {
aprint_error_dev(self, "couldn't create DMA map\n");
bus_dmamem_free(dmat, &seg, rseg);
- return;
+ return ENXIO;
}
if (bus_dmamap_load(dmat, lesc->sc_dmam,
sc->sc_mem, LE_PCI_MEMSIZE, NULL, BUS_DMA_NOWAIT)) {
aprint_error_dev(self, "coundn't load DMA map\n");
bus_dmamem_free(dmat, &seg, rseg);
- return;
+ return ENXIO;
}
sc->sc_conf3 = 0;
@@ -335,7 +335,7 @@ le_pci_attach(device_t parent, device_t
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
lesc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, am79900_intr, sc);
@@ -344,7 +344,8 @@ le_pci_attach(device_t parent, device_t
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
+ return 0;
}
Index: sys/dev/pci/if_lii.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_lii.c,v
retrieving revision 1.6
diff -u -p -r1.6 if_lii.c
--- sys/dev/pci/if_lii.c 26 Apr 2009 06:56:46 -0000 1.6
+++ sys/dev/pci/if_lii.c 1 May 2009 16:43:54 -0000
@@ -112,7 +112,7 @@ struct lii_softc {
};
static int lii_match(device_t, cfdata_t, void *);
-static void lii_attach(device_t, device_t, void *);
+static int lii_attach(device_t, device_t, void *);
static int lii_reset(struct lii_softc *);
static bool lii_eeprom_present(struct lii_softc *);
@@ -233,7 +233,7 @@ lii_match(device_t parent, cfdata_t cfma
PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ATTANSIC_ETHERNET_100);
}
-static void
+static int
lii_attach(device_t parent, device_t self, void *aux)
{
struct lii_softc *sc = device_private(self);
@@ -270,11 +270,11 @@ lii_attach(device_t parent, device_t sel
if (pci_mapreg_map(pa, PCI_MAPREG_START, cmd, 0,
&sc->sc_mmiot, &sc->sc_mmioh, NULL, &memsize) != 0) {
aprint_error_dev(self, "failed to map registers\n");
- return;
+ return ENXIO;
}
if (lii_reset(sc))
- return;
+ return ENXIO;
lii_spi_configure(sc);
@@ -284,7 +284,7 @@ lii_attach(device_t parent, device_t sel
sc->sc_memread = lii_spi_read;
if (lii_read_macaddr(sc, eaddr))
- return;
+ return ENXIO;
memcpy(sc->sc_eaddr, eaddr, ETHER_ADDR_LEN);
aprint_normal_dev(self, "Ethernet address %s\n",
@@ -345,7 +345,7 @@ lii_attach(device_t parent, device_t sel
else
pmf_class_network_register(self, ifp);
- return;
+ return 0;
fail:
if (sc->sc_ih != NULL) {
@@ -354,6 +354,7 @@ fail:
}
if (memsize)
bus_space_unmap(sc->sc_mmiot, sc->sc_mmioh, memsize);
+ return ENXIO;
}
static int
Index: sys/dev/pci/if_lmc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_lmc.c,v
retrieving revision 1.46
diff -u -p -r1.46 if_lmc.c
--- sys/dev/pci/if_lmc.c 2 Feb 2009 15:57:51 -0000 1.46
+++ sys/dev/pci/if_lmc.c 1 May 2009 16:43:56 -0000
@@ -7088,7 +7088,7 @@ nbsd_match(struct device *parent, struct
/* NetBSD bottom-half initialization. */
/* context: kernel (boot) or process (syscall) */
-static void
+static int
nbsd_attach(struct device *parent, struct device *self, void *aux)
{
softc_t *sc = (softc_t *)self; /* device is first in softc */
@@ -7123,7 +7123,7 @@ nbsd_attach(struct device *parent, struc
sc->card = &t1_card;
break;
default:
- return;
+ return ENXIO;
}
/* Allocate PCI resources to access the Tulip chip CSRs. */
@@ -7138,7 +7138,7 @@ nbsd_attach(struct device *parent, struc
TLP_CSR_SIZE, 0, &sc->csr_handle)))
{
aprint_error("%s: bus_space_map(): error %d\n", NAME_UNIT, error);
- return;
+ return ENXIO;
}
/* Allocate PCI interrupt resources. */
@@ -7146,14 +7146,14 @@ nbsd_attach(struct device *parent, struc
{
aprint_error("%s: pci_intr_map() failed\n", NAME_UNIT);
nbsd_detach(self, 0);
- return;
+ return ENXIO;
}
if ((sc->irq_cookie = pci_intr_establish(pa->pa_pc, sc->intr_handle,
IPL_NET, bsd_interrupt, sc)) == NULL)
{
aprint_error("%s: pci_intr_establish() failed\n", NAME_UNIT);
nbsd_detach(self, 0);
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, sc->intr_handle);
aprint_normal(" %s: %s\n", intrstr, sc->dev_desc);
@@ -7164,7 +7164,7 @@ nbsd_attach(struct device *parent, struc
{
aprint_error("%s: shutdown_hook_establish() failed\n", NAME_UNIT);
nbsd_detach(self, 0);
- return;
+ return ENXIO;
}
/* Initialize the top-half and bottom-half locks. */
@@ -7173,6 +7173,7 @@ nbsd_attach(struct device *parent, struc
/* Initialize the driver. */
if ((error = lmc_attach(sc))) nbsd_detach(self, 0);
+ return 0;
}
/* context: kernel (boot) or process (syscall) */
Index: sys/dev/pci/if_lmc.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_lmc.h,v
retrieving revision 1.15
diff -u -p -r1.15 if_lmc.h
--- sys/dev/pci/if_lmc.h 12 Nov 2008 12:36:12 -0000 1.15
+++ sys/dev/pci/if_lmc.h 1 May 2009 16:43:57 -0000
@@ -1678,7 +1678,7 @@ static void fbsd_dmamap_load(void *, bus
#if defined(__NetBSD__)
static int nbsd_match(struct device *, struct cfdata *, void *);
-static void nbsd_attach(struct device *, struct device *, void *);
+static int nbsd_attach(struct device *, struct device *, void *);
static int nbsd_detach(struct device *, int);
#endif /* __NetBSD__ */
Index: sys/dev/pci/if_msk.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_msk.c,v
retrieving revision 1.24
diff -u -p -r1.24 if_msk.c
--- sys/dev/pci/if_msk.c 18 Mar 2009 16:00:19 -0000 1.24
+++ sys/dev/pci/if_msk.c 1 May 2009 16:43:57 -0000
@@ -100,11 +100,11 @@ __KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1
#include <dev/pci/if_mskvar.h>
int mskc_probe(struct device *, struct cfdata *, void *);
-void mskc_attach(struct device *, struct device *self, void *aux);
+int mskc_attach(struct device *, struct device *self, void *aux);
static bool mskc_suspend(device_t PMF_FN_PROTO);
static bool mskc_resume(device_t PMF_FN_PROTO);
int msk_probe(struct device *, struct cfdata *, void *);
-void msk_attach(struct device *, struct device *self, void *aux);
+int msk_attach(struct device *, struct device *self, void *aux);
int mskcprint(void *, const char *);
int msk_intr(void *);
void msk_intr_yukon(struct sk_if_softc *);
@@ -977,7 +977,7 @@ msk_resume(device_t dv PMF_FN_ARGS)
* Each XMAC chip is attached as a separate logical IP interface.
* Single port cards will have only one logical interface of course.
*/
-void
+int
msk_attach(struct device *parent, struct device *self, void *aux)
{
struct sk_if_softc *sc_if = (struct sk_if_softc *) self;
@@ -1131,7 +1131,7 @@ msk_attach(struct device *parent, struct
#endif
DPRINTFN(2, ("msk_attach: end\n"));
- return;
+ return 0;
fail_3:
bus_dmamap_destroy(sc->sc_dmatag, sc_if->sk_ring_map);
@@ -1141,6 +1141,7 @@ fail_1:
bus_dmamem_free(sc->sc_dmatag, &seg, rseg);
fail:
sc->sk_if[sa->skc_port] = NULL;
+ return ENXIO;
}
int
@@ -1160,7 +1161,7 @@ mskcprint(void *aux, const char *pnp)
* Attach the interface. Allocate softc structures, do ifmedia
* setup and ethernet/BPF attach.
*/
-void
+int
mskc_attach(struct device *parent, struct device *self, void *aux)
{
struct sk_softc *sc = (struct sk_softc *)self;
@@ -1225,7 +1226,7 @@ mskc_attach(struct device *parent, struc
break;
default:
aprint_error(": can't map mem space\n");
- return;
+ return ENXIO;
}
sc->sc_dmatag = pa->pa_dmat;
@@ -1454,7 +1455,7 @@ mskc_attach(struct device *parent, struc
if (!pmf_device_register(self, mskc_suspend, mskc_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
- return;
+ return 0;
fail_6:
bus_dmamap_unload(sc->sc_dmatag, sc->sk_status_map);
@@ -1469,6 +1470,7 @@ fail_2:
pci_intr_disestablish(pc, sc->sk_intrhand);
fail_1:
bus_space_unmap(sc->sk_btag, sc->sk_bhandle, size);
+ return ENXIO;
}
int
Index: sys/dev/pci/if_mtd_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_mtd_pci.c,v
retrieving revision 1.13
diff -u -p -r1.13 if_mtd_pci.c
--- sys/dev/pci/if_mtd_pci.c 28 Apr 2008 20:23:55 -0000 1.13
+++ sys/dev/pci/if_mtd_pci.c 1 May 2009 16:43:57 -0000
@@ -68,7 +68,7 @@ static struct mtd_pci_device_id mtd_ids[
};
static int mtd_pci_match(device_t, struct cfdata *, void *);
-static void mtd_pci_attach(device_t, device_t, void *);
+static int mtd_pci_attach(device_t, device_t, void *);
CFATTACH_DECL(mtd_pci, sizeof(struct mtd_softc), mtd_pci_match, mtd_pci_attach,
NULL, NULL);
@@ -87,7 +87,7 @@ mtd_pci_match(device_t parent, struct cf
return (0);
}
-static void
+static int
mtd_pci_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args * const pa = aux;
@@ -116,7 +116,7 @@ mtd_pci_attach(device_t parent, device_t
sc->bus_handle = ioh;
} else {
aprint_error_dev(&sc->dev, "could not map memory or i/o
space\n");
- return;
+ return ENXIO;
}
sc->dma_tag = pa->pa_dmat;
@@ -125,7 +125,7 @@ mtd_pci_attach(device_t parent, device_t
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->dev, "could not map interrupt\n");
- return;
+ return ENXIO;
}
intrstring = pci_intr_string(pa->pa_pc, ih);
@@ -134,10 +134,11 @@ mtd_pci_attach(device_t parent, device_t
if (intrstring != NULL)
printf(" at %s", intrstring);
printf("\n");
- return;
+ return ENXIO;
} else {
printf("%s: using %s for interrupt\n",
device_xname(&sc->dev),
intrstring ? intrstring : "unknown interrupt");
}
+ return 0;
}
Index: sys/dev/pci/if_ne_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ne_pci.c,v
retrieving revision 1.32
diff -u -p -r1.32 if_ne_pci.c
--- sys/dev/pci/if_ne_pci.c 28 Apr 2008 20:23:55 -0000 1.32
+++ sys/dev/pci/if_ne_pci.c 1 May 2009 16:43:57 -0000
@@ -74,7 +74,7 @@ struct ne_pci_softc {
};
static int ne_pci_match(struct device *, struct cfdata *, void *);
-static void ne_pci_attach(struct device *, struct device *, void *);
+static int ne_pci_attach(struct device *, struct device *, void *);
CFATTACH_DECL_NEW(ne_pci, sizeof(struct ne_pci_softc),
ne_pci_match, ne_pci_attach, NULL, NULL);
@@ -183,7 +183,7 @@ ne_pci_match(struct device *parent, stru
return (0);
}
-static void
+static int
ne_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct ne_pci_softc *psc = device_private(self);
@@ -220,14 +220,14 @@ ne_pci_attach(struct device *parent, str
if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
&nict, &nich, NULL, NULL)) {
aprint_error_dev(dsc->sc_dev, "can't map i/o space\n");
- return;
+ return ENXIO;
}
asict = nict;
if (bus_space_subregion(nict, nich, NE2000_ASIC_OFFSET,
NE2000_ASIC_NPORTS, &asich)) {
aprint_error_dev(dsc->sc_dev, "can't subregion i/o space\n");
- return;
+ return ENXIO;
}
dsc->sc_regt = nict;
@@ -259,7 +259,7 @@ ne_pci_attach(struct device *parent, str
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(dsc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, dp8390_intr, dsc);
@@ -268,9 +268,10 @@ ne_pci_attach(struct device *parent, str
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(dsc->sc_dev, "interrupting at %s\n", intrstr);
+ return 0;
}
#ifdef IPKDB_NE_PCI
Index: sys/dev/pci/if_nfe.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_nfe.c,v
retrieving revision 1.44
diff -u -p -r1.44 if_nfe.c
--- sys/dev/pci/if_nfe.c 18 Mar 2009 15:14:30 -0000 1.44
+++ sys/dev/pci/if_nfe.c 1 May 2009 16:43:58 -0000
@@ -77,7 +77,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1
static int nfe_ifflags_cb(struct ethercom *);
int nfe_match(device_t, cfdata_t, void *);
-void nfe_attach(device_t, device_t, void *);
+int nfe_attach(device_t, device_t, void *);
void nfe_power(int, void *);
void nfe_miibus_statchg(device_t);
int nfe_miibus_readreg(device_t, int, int);
@@ -212,7 +212,7 @@ nfe_match(device_t dev, cfdata_t match,
return 0;
}
-void
+int
nfe_attach(device_t parent, device_t self, void *aux)
{
struct nfe_softc *sc = device_private(self);
@@ -240,7 +240,7 @@ nfe_attach(device_t parent, device_t sel
/* FALLTHROUGH */
default:
aprint_error_dev(self, "could not map mem space\n");
- return;
+ return ENXIO;
}
if (pci_intr_map(pa, &ih) != 0) {
@@ -417,7 +417,7 @@ nfe_attach(device_t parent, device_t sel
else
pmf_class_network_register(self, ifp);
- return;
+ return 0;
fail:
if (sc->sc_ih != NULL) {
@@ -426,6 +426,7 @@ fail:
}
if (memsize)
bus_space_unmap(sc->sc_memt, sc->sc_memh, memsize);
+ return ENXIO;
}
void
Index: sys/dev/pci/if_ntwoc_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ntwoc_pci.c,v
retrieving revision 1.22
diff -u -p -r1.22 if_ntwoc_pci.c
--- sys/dev/pci/if_ntwoc_pci.c 14 Mar 2009 15:36:19 -0000 1.22
+++ sys/dev/pci/if_ntwoc_pci.c 1 May 2009 16:43:58 -0000
@@ -114,7 +114,7 @@ struct ntwoc_pci_softc {
};
static int ntwoc_pci_match(struct device *, struct cfdata *, void *);
-static void ntwoc_pci_attach(struct device *, struct device *, void *);
+static int ntwoc_pci_attach(struct device *, struct device *, void *);
static int ntwoc_pci_alloc_dma(struct sca_softc *);
static void ntwoc_pci_clock_callback(void *, int, int);
@@ -187,7 +187,7 @@ ntwoc_pci_match(struct device *parent, s
return 0;
}
-static void
+static int
ntwoc_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct ntwoc_pci_softc *sc = (void *)self;
@@ -211,7 +211,7 @@ ntwoc_pci_attach(struct device *parent,
if (pci_mapreg_map(pa, PCI_CBMA_ASIC, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc_asic_iot, &sc->sc_asic_ioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "Can't map register space
(ASIC)\n");
- return;
+ return ENXIO;
}
/*
* Map in the serial controller configuration space
@@ -219,7 +219,7 @@ ntwoc_pci_attach(struct device *parent,
if (pci_mapreg_map(pa, PCI_CBMA_SCA, PCI_MAPREG_TYPE_MEM, 0,
&sca->sc_iot, &sca->sc_ioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "Can't map register space
(SCA)\n");
- return;
+ return ENXIO;
}
/*
@@ -233,7 +233,7 @@ ntwoc_pci_attach(struct device *parent,
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_NET, ntwoc_pci_intr,
@@ -243,7 +243,7 @@ ntwoc_pci_attach(struct device *parent,
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
printf("%s: interrupting at %s\n", device_xname(&sc->sc_dev), intrstr);
@@ -301,7 +301,7 @@ ntwoc_pci_attach(struct device *parent,
*/
if (db0 == NTWOC_FE_ID_NONE) {
printf("%s: no ports available\n", device_xname(&sc->sc_dev));
- return;
+ return ENXIO;
}
/*
@@ -395,6 +395,7 @@ ntwoc_pci_attach(struct device *parent,
sca->sc_baseclock = SCA_BASECLOCK;
sca_print_clock_info(&sc->sc_sca);
#endif
+ return 0;
}
/*
Index: sys/dev/pci/if_pcn.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_pcn.c,v
retrieving revision 1.46
diff -u -p -r1.46 if_pcn.c
--- sys/dev/pci/if_pcn.c 4 Apr 2008 12:20:48 -0000 1.46
+++ sys/dev/pci/if_pcn.c 1 May 2009 16:43:58 -0000
@@ -464,7 +464,7 @@ static const struct pcn_variant {
int pcn_copy_small = 0;
static int pcn_match(device_t, cfdata_t, void *);
-static void pcn_attach(device_t, device_t, void *);
+static int pcn_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(pcn, sizeof(struct pcn_softc),
pcn_match, pcn_attach, NULL, NULL);
@@ -572,7 +572,7 @@ pcn_match(device_t parent, cfdata_t cf,
return (0);
}
-static void
+static int
pcn_attach(device_t parent, device_t self, void *aux)
{
struct pcn_softc *sc = device_private(self);
@@ -613,7 +613,7 @@ pcn_attach(device_t parent, device_t sel
sc->sc_sh = ioh;
} else {
aprint_error_dev(self, "unable to map device registers\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -627,7 +627,7 @@ pcn_attach(device_t parent, device_t sel
if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self,
NULL)) && error != EOPNOTSUPP) {
aprint_error_dev(self, "cannot activate %d\n", error);
- return;
+ return ENXIO;
}
/*
@@ -692,7 +692,7 @@ pcn_attach(device_t parent, device_t sel
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, pcn_intr, sc);
@@ -701,7 +701,7 @@ pcn_attach(device_t parent, device_t sel
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -867,7 +867,7 @@ pcn_attach(device_t parent, device_t sel
if (sc->sc_sdhook == NULL)
aprint_error_dev(self,
"WARNING: unable to establish shutdown hook\n");
- return;
+ return 0;
/*
* Free any resources we've allocated during the failed attach
@@ -894,7 +894,7 @@ pcn_attach(device_t parent, device_t sel
fail_1:
bus_dmamem_free(sc->sc_dmat, &seg, rseg);
fail_0:
- return;
+ return ENXIO;
}
/*
Index: sys/dev/pci/if_ral_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ral_pci.c,v
retrieving revision 1.9
diff -u -p -r1.9 if_ral_pci.c
--- sys/dev/pci/if_ral_pci.c 29 Apr 2008 22:21:45 -0000 1.9
+++ sys/dev/pci/if_ral_pci.c 1 May 2009 16:43:58 -0000
@@ -91,7 +91,7 @@ struct ral_pci_softc {
#define RAL_PCI_BAR0 0x10
int ral_pci_match(struct device *, struct cfdata *, void *);
-void ral_pci_attach(struct device *, struct device *, void *);
+int ral_pci_attach(struct device *, struct device *, void *);
int ral_pci_detach(struct device *, int);
CFATTACH_DECL(ral_pci, sizeof (struct ral_pci_softc),
@@ -118,7 +118,7 @@ ral_pci_match(struct device *parent, str
return 0;
}
-void
+int
ral_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct ral_pci_softc *psc = (struct ral_pci_softc *)self;
@@ -153,12 +153,12 @@ ral_pci_attach(struct device *parent, st
if (error != 0) {
aprint_error(": could not map memory space\n");
- return;
+ return ENXIO;
}
if (pci_intr_map(pa, &ih) != 0) {
aprint_error(": could not map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(psc->sc_pc, ih);
@@ -170,11 +170,12 @@ ral_pci_attach(struct device *parent, st
if (intrstr != NULL)
printf(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
(*psc->sc_opns->attach)(sc, PCI_PRODUCT(pa->pa_id));
+ return 0;
}
int
Index: sys/dev/pci/if_re_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_re_pci.c,v
retrieving revision 1.36
diff -u -p -r1.36 if_re_pci.c
--- sys/dev/pci/if_re_pci.c 25 Apr 2009 06:16:12 -0000 1.36
+++ sys/dev/pci/if_re_pci.c 1 May 2009 16:43:58 -0000
@@ -92,7 +92,7 @@ struct re_pci_softc {
};
static int re_pci_match(device_t, cfdata_t, void *);
-static void re_pci_attach(device_t, device_t, void *);
+static int re_pci_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(re_pci, sizeof(struct re_pci_softc),
re_pci_match, re_pci_attach, NULL, NULL);
@@ -172,7 +172,7 @@ re_pci_match(device_t parent, cfdata_t c
return 0;
}
-static void
+static int
re_pci_attach(device_t parent, device_t self, void *aux)
{
struct re_pci_softc *psc = device_private(self);
@@ -223,7 +223,7 @@ re_pci_attach(device_t parent, device_t
bsize = memsize;
} else {
aprint_error(": can't map registers\n");
- return;
+ return ENXIO;
}
t = re_devs;
@@ -259,7 +259,7 @@ re_pci_attach(device_t parent, device_t
/* Allocate interrupt */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, re_intr, sc);
@@ -268,7 +268,7 @@ re_pci_attach(device_t parent, device_t
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -303,4 +303,5 @@ re_pci_attach(device_t parent, device_t
aprint_error_dev(self, "couldn't establish power handler\n");
else
pmf_class_network_register(self, &sc->ethercom.ec_if);
+ return 0;
}
Index: sys/dev/pci/if_rtk_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_rtk_pci.c,v
retrieving revision 1.37
diff -u -p -r1.37 if_rtk_pci.c
--- sys/dev/pci/if_rtk_pci.c 23 Aug 2008 16:56:45 -0000 1.37
+++ sys/dev/pci/if_rtk_pci.c 1 May 2009 16:43:58 -0000
@@ -111,7 +111,7 @@ static const struct rtk_type rtk_pci_dev
};
static int rtk_pci_match(device_t, struct cfdata *, void *);
-static void rtk_pci_attach(device_t, device_t, void *);
+static int rtk_pci_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(rtk_pci, sizeof(struct rtk_pci_softc),
rtk_pci_match, rtk_pci_attach, NULL, NULL);
@@ -145,7 +145,7 @@ rtk_pci_match(device_t parent, cfdata_t
* Attach the interface. Allocate softc structures, do ifmedia
* setup and ethernet/BPF attach.
*/
-static void
+static int
rtk_pci_attach(device_t parent, device_t self, void *aux)
{
struct rtk_pci_softc *psc = device_private(self);
@@ -199,13 +199,13 @@ rtk_pci_attach(device_t parent, device_t
sc->rtk_bhandle = memh;
} else {
aprint_error_dev(self, "can't map registers\n");
- return;
+ return ENXIO;
}
/* Allocate interrupt */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, rtk_intr, sc);
@@ -214,7 +214,7 @@ rtk_pci_attach(device_t parent, device_t
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
if (t->rtk_basetype == RTK_8129)
@@ -231,4 +231,5 @@ rtk_pci_attach(device_t parent, device_t
pmf_class_network_register(self, &sc->ethercom.ec_if);
rtk_attach(sc);
+ return 0;
}
Index: sys/dev/pci/if_rtw_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_rtw_pci.c,v
retrieving revision 1.12
diff -u -p -r1.12 if_rtw_pci.c
--- sys/dev/pci/if_rtw_pci.c 28 Apr 2008 20:23:55 -0000 1.12
+++ sys/dev/pci/if_rtw_pci.c 1 May 2009 16:43:58 -0000
@@ -90,7 +90,7 @@ struct rtw_pci_softc {
};
static int rtw_pci_match(device_t, struct cfdata *, void *);
-static void rtw_pci_attach(device_t, device_t, void *);
+static int rtw_pci_attach(device_t, device_t, void *);
static int rtw_pci_detach(device_t, int);
CFATTACH_DECL_NEW(rtw_pci, sizeof(struct rtw_pci_softc),
@@ -166,7 +166,7 @@ rtw_pci_suspend(device_t self PMF_FN_ARG
return true;
}
-static void
+static int
rtw_pci_attach(device_t parent, device_t self, void *aux)
{
struct rtw_pci_softc *psc = device_private(self);
@@ -199,7 +199,7 @@ rtw_pci_attach(device_t parent, device_t
if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self, NULL)) != 0 &&
error != EOPNOTSUPP) {
aprint_error_dev(self, "cannot activate %d\n", error);
- return;
+ return ENXIO;
}
/*
@@ -214,7 +214,7 @@ rtw_pci_attach(device_t parent, device_t
;
else {
aprint_error_dev(self, "unable to map device registers\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -231,7 +231,7 @@ rtw_pci_attach(device_t parent, device_t
*/
if (pci_intr_map(pa, &psc->psc_ih)) {
aprint_error_dev(self, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, psc->psc_ih);
psc->psc_intrcookie = pci_intr_establish(pc, psc->psc_ih, IPL_NET,
@@ -241,7 +241,7 @@ rtw_pci_attach(device_t parent, device_t
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -262,6 +262,7 @@ rtw_pci_attach(device_t parent, device_t
*/
pmf_device_suspend_self(self);
}
+ return 0;
}
static int
Index: sys/dev/pci/if_sf_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_sf_pci.c,v
retrieving revision 1.16
diff -u -p -r1.16 if_sf_pci.c
--- sys/dev/pci/if_sf_pci.c 28 Apr 2008 20:23:55 -0000 1.16
+++ sys/dev/pci/if_sf_pci.c 1 May 2009 16:43:58 -0000
@@ -72,7 +72,7 @@ struct sf_pci_softc {
};
static int sf_pci_match(device_t, struct cfdata *, void *);
-static void sf_pci_attach(device_t, device_t, void *);
+static int sf_pci_attach(device_t, device_t, void *);
CFATTACH_DECL(sf_pci, sizeof(struct sf_pci_softc),
sf_pci_match, sf_pci_attach, NULL, NULL);
@@ -163,7 +163,7 @@ sf_pci_match(device_t parent, struct cfd
return (0);
}
-static void
+static int
sf_pci_attach(device_t parent, device_t self, void *aux)
{
struct sf_pci_softc *psc = device_private(self);
@@ -190,7 +190,7 @@ sf_pci_attach(device_t parent, device_t
error != EOPNOTSUPP) {
aprint_error_dev(&sc->sc_dev, "cannot activate %d\n",
error);
- return;
+ return ENXIO;
}
/*
@@ -223,7 +223,7 @@ sf_pci_attach(device_t parent, device_t
sc->sc_iomapped = 1;
} else {
aprint_error_dev(&sc->sc_dev, "unable to map device
registers\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -238,7 +238,7 @@ sf_pci_attach(device_t parent, device_t
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
psc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_NET, sf_intr, sc);
@@ -247,7 +247,7 @@ sf_pci_attach(device_t parent, device_t
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
printf("%s: interrupting at %s\n", device_xname(&sc->sc_dev), intrstr);
@@ -255,4 +255,5 @@ sf_pci_attach(device_t parent, device_t
* Finish off the attach.
*/
sf_attach(sc);
+ return 0;
}
Index: sys/dev/pci/if_sip.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_sip.c,v
retrieving revision 1.138
diff -u -p -r1.138 if_sip.c
--- sys/dev/pci/if_sip.c 2 Apr 2009 00:09:33 -0000 1.138
+++ sys/dev/pci/if_sip.c 1 May 2009 16:43:59 -0000
@@ -604,7 +604,7 @@ static void sipcom_dp83815_mii_statchg(d
static void sipcom_mediastatus(struct ifnet *, struct ifmediareq *);
static int sipcom_match(device_t, struct cfdata *, void *);
-static void sipcom_attach(device_t, device_t, void *);
+static int sipcom_attach(device_t, device_t, void *);
static void sipcom_do_detach(device_t, enum sip_attach_stage);
static int sipcom_detach(device_t, int);
static bool sipcom_resume(device_t PMF_FN_PROTO);
@@ -978,7 +978,7 @@ sipcom_suspend(device_t self PMF_FN_ARGS
return true;
}
-static void
+static int
sipcom_attach(device_t parent, device_t self, void *aux)
{
struct sip_softc *sc = device_private(self);
@@ -1075,7 +1075,7 @@ sipcom_attach(device_t parent, device_t
} else {
printf("%s: unable to map device registers\n",
device_xname(&sc->sc_dev));
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -1094,7 +1094,7 @@ sipcom_attach(device_t parent, device_t
error = pci_activate(pa->pa_pc, pa->pa_tag, self, pci_activate_null);
if (error != 0 && error != EOPNOTSUPP) {
aprint_error_dev(&sc->sc_dev, "cannot activate %d\n", error);
- return;
+ return ENXIO;
}
/*
@@ -1102,7 +1102,7 @@ sipcom_attach(device_t parent, device_t
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, sipcom_intr, sc);
@@ -1111,7 +1111,8 @@ sipcom_attach(device_t parent, device_t
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return sipcom_do_detach(self, SIP_ATTACH_MAP);
+ sipcom_do_detach(self, SIP_ATTACH_MAP);
+ return ENXIO;
}
printf("%s: interrupting at %s\n", device_xname(&sc->sc_dev), intrstr);
@@ -1127,7 +1128,8 @@ sipcom_attach(device_t parent, device_t
&rseg, 0)) != 0) {
aprint_error_dev(&sc->sc_dev, "unable to allocate control data,
error = %d\n",
error);
- return sipcom_do_detach(self, SIP_ATTACH_INTR);
+ sipcom_do_detach(self, SIP_ATTACH_INTR);
+ return ENXIO;
}
if ((error = bus_dmamem_map(sc->sc_dmat, &sc->sc_seg, rseg,
@@ -1372,6 +1374,7 @@ sipcom_attach(device_t parent, device_t
aprint_error_dev(self, "couldn't establish power handler\n");
else
pmf_class_network_register(self, ifp);
+ return 0;
}
static inline void
Index: sys/dev/pci/if_sk.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_sk.c,v
retrieving revision 1.60
diff -u -p -r1.60 if_sk.c
--- sys/dev/pci/if_sk.c 23 Apr 2009 09:18:25 -0000 1.60
+++ sys/dev/pci/if_sk.c 1 May 2009 16:44:00 -0000
@@ -161,9 +161,9 @@ __KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.
#include <dev/pci/if_skvar.h>
int skc_probe(device_t, cfdata_t, void *);
-void skc_attach(device_t, device_t, void *aux);
+int skc_attach(device_t, device_t, void *aux);
int sk_probe(device_t, cfdata_t, void *);
-void sk_attach(device_t, device_t, void *aux);
+int sk_attach(device_t, device_t, void *aux);
int skcprint(void *, const char *);
int sk_intr(void *);
void sk_intr_bcom(struct sk_if_softc *);
@@ -1202,7 +1202,7 @@ sk_probe(device_t parent, cfdata_t match
* Each XMAC chip is attached as a separate logical IP interface.
* Single port cards will have only one logical interface of course.
*/
-void
+int
sk_attach(device_t parent, device_t self, void *aux)
{
struct sk_if_softc *sc_if = device_private(self);
@@ -1300,7 +1300,7 @@ sk_attach(device_t parent, device_t self
default:
aprint_error_dev(sc->sk_dev, "unsupported PHY type: %d\n",
sc_if->sk_phytype);
- return;
+ return ENXIO;
}
/* Allocate the descriptor queues. */
@@ -1469,10 +1469,11 @@ sk_attach(device_t parent, device_t self
DPRINTFN(2, ("sk_attach: end\n"));
- return;
+ return 0;
fail:
sc->sk_if[sa->skc_port] = NULL;
+ return ENXIO;
}
int
@@ -1493,7 +1494,7 @@ skcprint(void *aux, const char *pnp)
* Attach the interface. Allocate softc structures, do ifmedia
* setup and ethernet/BPF attach.
*/
-void
+int
skc_attach(device_t parent, device_t self, void *aux)
{
struct sk_softc *sc = device_private(self);
@@ -1560,7 +1561,7 @@ skc_attach(device_t parent, device_t sel
#ifdef SK_USEIOSPACE
if (!(command & PCI_COMMAND_IO_ENABLE)) {
aprint_error(": failed to enable I/O ports!\n");
- return;
+ return ENXIO;
}
/*
* Map control/status registers.
@@ -1569,12 +1570,12 @@ skc_attach(device_t parent, device_t sel
&sc->sk_btag, &sc->sk_bhandle,
&iobase, &iosize)) {
aprint_error(": can't find i/o space\n");
- return;
+ return ENXIO;
}
#else
if (!(command & PCI_COMMAND_MEM_ENABLE)) {
aprint_error(": failed to enable memory mapping!\n");
- return;
+ return ENXIO;
}
memtype = pci_mapreg_type(pc, pa->pa_tag, SK_PCI_LOMEM);
switch (memtype) {
@@ -1586,7 +1587,7 @@ skc_attach(device_t parent, device_t sel
break;
default:
aprint_error_dev(sc->sk_dev, "can't find mem space\n");
- return;
+ return ENXIO;
}
DPRINTFN(2, ("skc_attach: iobase=%lx, iosize=%lx\n", iobase,
@@ -1827,12 +1828,13 @@ skc_attach(device_t parent, device_t sel
if (!pmf_device_register(self, skc_suspend, skc_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
- return;
+ return 0;
fail_1:
pci_intr_disestablish(pc, sc->sk_intrhand);
fail:
bus_space_unmap(sc->sk_btag, sc->sk_bhandle, iosize);
+ return ENXIO;
}
int
Index: sys/dev/pci/if_ste.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ste.c,v
retrieving revision 1.36
diff -u -p -r1.36 if_ste.c
--- sys/dev/pci/if_ste.c 28 Apr 2008 20:23:55 -0000 1.36
+++ sys/dev/pci/if_ste.c 1 May 2009 16:44:00 -0000
@@ -226,7 +226,7 @@ static void ste_mii_writereg(device_t, i
static void ste_mii_statchg(device_t);
static int ste_match(device_t, struct cfdata *, void *);
-static void ste_attach(device_t, device_t, void *);
+static int ste_attach(device_t, device_t, void *);
int ste_copy_small = 0;
@@ -293,7 +293,7 @@ ste_match(device_t parent, struct cfdata
return (0);
}
-static void
+static int
ste_attach(device_t parent, device_t self, void *aux)
{
struct ste_softc *sc = device_private(self);
@@ -339,7 +339,7 @@ ste_attach(device_t parent, device_t sel
sc->sc_sh = ioh;
} else {
aprint_error_dev(&sc->sc_dev, "unable to map device
registers\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -354,7 +354,7 @@ ste_attach(device_t parent, device_t sel
NULL)) && error != EOPNOTSUPP) {
aprint_error_dev(&sc->sc_dev, "cannot activate %d\n",
error);
- return;
+ return ENXIO;
}
/*
@@ -362,7 +362,7 @@ ste_attach(device_t parent, device_t sel
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, ste_intr, sc);
@@ -371,7 +371,7 @@ ste_attach(device_t parent, device_t sel
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
printf("%s: interrupting at %s\n", device_xname(&sc->sc_dev), intrstr);
@@ -514,7 +514,7 @@ ste_attach(device_t parent, device_t sel
if (sc->sc_sdhook == NULL)
printf("%s: WARNING: unable to establish shutdown hook\n",
device_xname(&sc->sc_dev));
- return;
+ return 0;
/*
* Free any resources we've allocated during the failed attach
@@ -541,7 +541,7 @@ ste_attach(device_t parent, device_t sel
fail_1:
bus_dmamem_free(sc->sc_dmat, &seg, rseg);
fail_0:
- return;
+ return ENXIO;
}
/*
Index: sys/dev/pci/if_stge.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_stge.c,v
retrieving revision 1.45
diff -u -p -r1.45 if_stge.c
--- sys/dev/pci/if_stge.c 28 Apr 2008 20:23:55 -0000 1.45
+++ sys/dev/pci/if_stge.c 1 May 2009 16:44:00 -0000
@@ -287,7 +287,7 @@ static void stge_mii_writereg(device_t,
static void stge_mii_statchg(device_t);
static int stge_match(device_t, struct cfdata *, void *);
-static void stge_attach(device_t, device_t, void *);
+static int stge_attach(device_t, device_t, void *);
int stge_copy_small = 0;
@@ -373,7 +373,7 @@ stge_match(device_t parent, struct cfdat
return (0);
}
-static void
+static int
stge_attach(device_t parent, device_t self, void *aux)
{
struct stge_softc *sc = device_private(self);
@@ -420,7 +420,7 @@ stge_attach(device_t parent, device_t se
sc->sc_sh = ioh;
} else {
aprint_error_dev(&sc->sc_dev, "unable to map device
registers\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -435,14 +435,14 @@ stge_attach(device_t parent, device_t se
error != EOPNOTSUPP) {
aprint_error_dev(&sc->sc_dev, "cannot activate %d\n",
error);
- return;
+ return ENXIO;
}
/*
* Map and establish our interrupt.
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, stge_intr, sc);
@@ -451,7 +451,7 @@ stge_attach(device_t parent, device_t se
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
printf("%s: interrupting at %s\n", device_xname(&sc->sc_dev), intrstr);
@@ -694,7 +694,7 @@ stge_attach(device_t parent, device_t se
if (sc->sc_sdhook == NULL)
printf("%s: WARNING: unable to establish shutdown hook\n",
device_xname(&sc->sc_dev));
- return;
+ return 0;
/*
* Free any resources we've allocated during the failed attach
@@ -721,7 +721,7 @@ stge_attach(device_t parent, device_t se
fail_1:
bus_dmamem_free(sc->sc_dmat, &seg, rseg);
fail_0:
- return;
+ return ENXIO;
}
/*
Index: sys/dev/pci/if_ti.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ti.c,v
retrieving revision 1.82
diff -u -p -r1.82 if_ti.c
--- sys/dev/pci/if_ti.c 7 Nov 2008 00:20:07 -0000 1.82
+++ sys/dev/pci/if_ti.c 1 May 2009 16:44:01 -0000
@@ -150,7 +150,7 @@ static const struct ti_type ti_devs[] =
static const struct ti_type *ti_type_match(struct pci_attach_args *);
static int ti_probe(struct device *, struct cfdata *, void *);
-static void ti_attach(struct device *, struct device *, void *);
+static int ti_attach(struct device *, struct device *, void *);
static void ti_shutdown(void *);
static void ti_txeof_tigon1(struct ti_softc *);
static void ti_txeof_tigon2(struct ti_softc *);
@@ -1613,7 +1613,7 @@ ti_probe(struct device *parent, struct c
return ((t == NULL) ? 0 : 1);
}
-static void
+static int
ti_attach(struct device *parent, struct device *self, void *aux)
{
u_int32_t command;
@@ -1631,7 +1631,7 @@ ti_attach(struct device *parent, struct
t = ti_type_match(pa);
if (t == NULL) {
printf("ti_attach: were did the card go ?\n");
- return;
+ return ENXIO;
}
printf(": %s (rev. 0x%02x)\n", t->ti_name, PCI_REVISION(pa->pa_class));
@@ -1651,7 +1651,7 @@ ti_attach(struct device *parent, struct
PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT,
0 , &sc->ti_btag, &sc->ti_bhandle, NULL, NULL)) {
printf(": can't map memory space\n");
- return;
+ return ENXIO;
}
}
if (nolinear == 0)
@@ -1666,7 +1666,7 @@ ti_attach(struct device *parent, struct
/* Allocate interrupt */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, ti_intr, sc);
@@ -1675,7 +1675,7 @@ ti_attach(struct device *parent, struct
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
printf("%s: interrupting at %s\n", device_xname(&sc->sc_dev), intrstr);
/*
@@ -1879,10 +1879,10 @@ ti_attach(struct device *parent, struct
if_attach(ifp);
ether_ifattach(ifp, eaddr);
- return;
+ return 0;
fail2:
pci_intr_disestablish(pc, sc->sc_ih);
- return;
+ return ENXIO;
}
/*
Index: sys/dev/pci/if_tl.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_tl.c,v
retrieving revision 1.91
diff -u -p -r1.91 if_tl.c
--- sys/dev/pci/if_tl.c 16 Nov 2008 02:11:29 -0000 1.91
+++ sys/dev/pci/if_tl.c 1 May 2009 16:44:01 -0000
@@ -119,7 +119,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_tl.c,v 1.
#endif
static int tl_pci_match(device_t, cfdata_t, void *);
-static void tl_pci_attach(device_t, device_t, void *);
+static int tl_pci_attach(device_t, device_t, void *);
static int tl_intr(void *);
static int tl_ifioctl(struct ifnet *, ioctl_cmd_t, void *);
@@ -292,7 +292,7 @@ tl_pci_match(device_t parent, cfdata_t c
return 0;
}
-static void
+static int
tl_pci_attach(device_t parent, device_t self, void *aux)
{
tl_softc_t *sc = device_private(self);
@@ -361,7 +361,7 @@ tl_pci_attach(device_t parent, device_t
sc->tl_bushandle = memh;
} else {
aprint_error_dev(self, "unable to map device registers\n");
- return;
+ return ENXIO;
}
sc->tl_dmatag = pa->pa_dmat;
@@ -393,7 +393,7 @@ tl_pci_attach(device_t parent, device_t
if (seeprom_bootstrap_read(&sc->sc_i2c, 0x50, 0x83, 256 /* 2kbit */,
sc->tl_enaddr, ETHER_ADDR_LEN)) {
aprint_error_dev(self, "error reading Ethernet address\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "Ethernet address %s\n",
ether_sprintf(sc->tl_enaddr));
@@ -401,7 +401,7 @@ tl_pci_attach(device_t parent, device_t
/* Map and establish interrupts */
if (pci_intr_map(pa, &intrhandle)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, intrhandle);
sc->tl_if.if_softc = sc;
@@ -412,7 +412,7 @@ tl_pci_attach(device_t parent, device_t
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -427,7 +427,7 @@ tl_pci_attach(device_t parent, device_t
sc->ctrl_nsegs, PAGE_SIZE, (void **)&sc->ctrl,
BUS_DMA_NOWAIT | BUS_DMA_COHERENT) != 0) {
aprint_error_dev(self, "can't allocate DMA memory for lists\n");
- return;
+ return ENXIO;
}
/*
* Add shutdown hook so that DMA is disabled prior to reboot. Not
@@ -481,6 +481,7 @@ tl_pci_attach(device_t parent, device_t
rnd_attach_source(&sc->rnd_source, device_xname(self),
RND_TYPE_NET, 0);
#endif
+ return 0;
}
static void
Index: sys/dev/pci/if_tlp_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_tlp_pci.c,v
retrieving revision 1.113
diff -u -p -r1.113 if_tlp_pci.c
--- sys/dev/pci/if_tlp_pci.c 17 Apr 2009 19:04:20 -0000 1.113
+++ sys/dev/pci/if_tlp_pci.c 1 May 2009 16:44:02 -0000
@@ -107,7 +107,7 @@ struct tulip_pci_softc {
#define TULIP_PCI_SLAVEROM 0x08 /* slave of shared ROM */
static int tlp_pci_match(device_t, struct cfdata *, void *);
-static void tlp_pci_attach(device_t, device_t, void *);
+static int tlp_pci_attach(device_t, device_t, void *);
static int tlp_pci_detach(device_t, int);
CFATTACH_DECL3_NEW(tlp_pci, sizeof(struct tulip_pci_softc),
@@ -342,7 +342,7 @@ tlp_pci_match(device_t parent, cfdata_t
return 0;
}
-static void
+static int
tlp_pci_attach(device_t parent, device_t self, void *aux)
{
struct tulip_pci_softc *psc = device_private(self);
@@ -472,7 +472,7 @@ tlp_pci_attach(device_t parent, device_t
if (sc->sc_rev < 0x20) {
aprint_normal_dev(self,
"21040 must be at least pass 2.0\n");
- return;
+ return ENXIO;
}
break;
@@ -480,7 +480,7 @@ tlp_pci_attach(device_t parent, device_t
if (sc->sc_rev < 0x11) {
aprint_normal_dev(self,
"21140 must be at least pass 1.1\n");
- return;
+ return ENXIO;
}
break;
@@ -527,7 +527,7 @@ tlp_pci_attach(device_t parent, device_t
NULL)) && error != EOPNOTSUPP) {
aprint_error_dev(self, "cannot activate %d\n",
error);
- return;
+ return ENXIO;
}
/*
@@ -1032,7 +1032,7 @@ tlp_pci_attach(device_t parent, device_t
error = tlp_attach(sc, enaddr);
if (error)
goto fail;
- return;
+ return 0;
fail:
if (psc->sc_ih != NULL) {
@@ -1045,7 +1045,7 @@ fail:
if (memh_valid)
bus_space_unmap(memt, memh, memsize);
psc->sc_mapsize = 0;
- return;
+ return ENXIO;
}
static int
Index: sys/dev/pci/if_txp.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_txp.c,v
retrieving revision 1.34
diff -u -p -r1.34 if_txp.c
--- sys/dev/pci/if_txp.c 18 Apr 2009 14:58:03 -0000 1.34
+++ sys/dev/pci/if_txp.c 1 May 2009 16:44:02 -0000
@@ -88,7 +88,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1
#undef TRY_TX_TCP_CSUM
int txp_probe(device_t, cfdata_t, void *);
-void txp_attach(device_t, device_t, void *);
+int txp_attach(device_t, device_t, void *);
int txp_intr(void *);
void txp_tick(void *);
void txp_shutdown(void *);
@@ -184,7 +184,7 @@ txp_probe(device_t parent, cfdata_t matc
return (0);
}
-void
+int
txp_attach(device_t parent, device_t self, void *aux)
{
struct txp_softc *sc = device_private(self);
@@ -227,17 +227,17 @@ txp_attach(device_t parent, device_t sel
if (!(command & PCI_COMMAND_MASTER_ENABLE)) {
printf(": failed to enable bus mastering\n");
- return;
+ return ENXIO;
}
if (!(command & PCI_COMMAND_MEM_ENABLE)) {
printf(": failed to enable memory mapping\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, TXP_PCI_LOMEM, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc_bt, &sc->sc_bh, NULL, NULL)) {
printf(": can't map mem space %d\n", 0);
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -247,7 +247,7 @@ txp_attach(device_t parent, device_t sel
*/
if (pci_intr_map(pa, &ih)) {
printf(": couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
@@ -257,7 +257,7 @@ txp_attach(device_t parent, device_t sel
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
printf(": interrupting at %s\n", intrstr);
@@ -348,12 +348,12 @@ txp_attach(device_t parent, device_t sel
shutdownhook_establish(txp_shutdown, sc);
- return;
+ return 0;
cleanupintr:
pci_intr_disestablish(pc,sc->sc_ih);
- return;
+ return ENXIO;
}
Index: sys/dev/pci/if_vge.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_vge.c,v
retrieving revision 1.44
diff -u -p -r1.44 if_vge.c
--- sys/dev/pci/if_vge.c 9 Feb 2009 12:11:16 -0000 1.44
+++ sys/dev/pci/if_vge.c 1 May 2009 16:44:02 -0000
@@ -296,7 +296,7 @@ static inline void vge_set_rxaddr(struct
static int vge_ifflags_cb(struct ethercom *);
static int vge_match(struct device *, struct cfdata *, void *);
-static void vge_attach(struct device *, struct device *, void *);
+static int vge_attach(struct device *, struct device *, void *);
static int vge_encap(struct vge_softc *, struct mbuf *, int);
@@ -920,7 +920,7 @@ vge_allocmem(struct vge_softc *sc)
* Attach the interface. Allocate softc structures, do ifmedia
* setup and ethernet/BPF attach.
*/
-static void
+static int
vge_attach(struct device *parent, struct device *self, void *aux)
{
uint8_t *eaddr;
@@ -946,7 +946,7 @@ vge_attach(struct device *parent, struct
if (pci_mapreg_map(pa, VGE_PCI_LOMEM, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc_bst, &sc->sc_bsh, NULL, NULL) != 0) {
aprint_error_dev(&sc->sc_dev, "couldn't map memory\n");
- return;
+ return ENXIO;
}
/*
@@ -954,7 +954,7 @@ vge_attach(struct device *parent, struct
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_intrhand = pci_intr_establish(pc, ih, IPL_NET, vge_intr, sc);
@@ -963,7 +963,7 @@ vge_attach(struct device *parent, struct
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
@@ -994,7 +994,7 @@ vge_attach(struct device *parent, struct
sc->sc_dmat = pa->pa_dmat;
if (vge_allocmem(sc) != 0)
- return;
+ return ENXIO;
ifp = &sc->sc_ethercom.ec_if;
ifp->if_softc = sc;
@@ -1067,6 +1067,7 @@ vge_attach(struct device *parent, struct
if (shutdownhook_establish(vge_shutdown, sc) == NULL) {
aprint_error_dev(&sc->sc_dev, "WARNING: unable to establish
shutdown hook\n");
}
+ return 0;
}
static int
Index: sys/dev/pci/if_vr.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_vr.c,v
retrieving revision 1.95
diff -u -p -r1.95 if_vr.c
--- sys/dev/pci/if_vr.c 9 Jul 2008 16:14:57 -0000 1.95
+++ sys/dev/pci/if_vr.c 1 May 2009 16:44:03 -0000
@@ -1397,7 +1397,7 @@ vr_stop(struct ifnet *ifp, int disable)
}
static int vr_probe(device_t, struct cfdata *, void *);
-static void vr_attach(device_t, device_t, void *);
+static int vr_attach(device_t, device_t, void *);
static void vr_shutdown(void *);
CFATTACH_DECL_NEW(vr, sizeof (struct vr_softc),
@@ -1443,7 +1443,7 @@ vr_shutdown(void *arg)
* Attach the interface. Allocate softc structures, do ifmedia
* setup and ethernet/BPF attach.
*/
-static void
+static int
vr_attach(device_t parent, device_t self, void *aux)
{
struct vr_softc *sc = device_private(self);
@@ -1484,7 +1484,7 @@ vr_attach(device_t parent, device_t self
vr_restore_state)) && error != EOPNOTSUPP) {
aprint_error_dev(self, "cannot activate %d\n",
error);
- return;
+ return ENXIO;
}
/* Make sure bus mastering is enabled. */
@@ -1531,13 +1531,13 @@ vr_attach(device_t parent, device_t self
#endif
else {
printf(": unable to map device registers\n");
- return;
+ return ENXIO;
}
/* Allocate interrupt */
if (pci_intr_map(pa, &intrhandle)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, intrhandle);
sc->vr_ih = pci_intr_establish(pa->pa_pc, intrhandle, IPL_NET,
@@ -1715,7 +1715,7 @@ vr_attach(device_t parent, device_t self
sc->vr_ats = shutdownhook_establish(vr_shutdown, sc);
if (sc->vr_ats == NULL)
aprint_error_dev(self, "warning: couldn't establish shutdown
hook\n");
- return;
+ return 0;
fail_5:
for (i = 0; i < VR_NRXDESC; i++) {
@@ -1738,7 +1738,7 @@ vr_attach(device_t parent, device_t self
fail_1:
bus_dmamem_free(sc->vr_dmat, &seg, rseg);
fail_0:
- return;
+ return ENXIO;
}
static int
Index: sys/dev/pci/if_wi_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_wi_pci.c,v
retrieving revision 1.45
diff -u -p -r1.45 if_wi_pci.c
--- sys/dev/pci/if_wi_pci.c 28 Apr 2008 20:23:55 -0000 1.45
+++ sys/dev/pci/if_wi_pci.c 1 May 2009 16:44:03 -0000
@@ -89,7 +89,7 @@ struct wi_pci_softc {
};
static int wi_pci_match(struct device *, struct cfdata *, void *);
-static void wi_pci_attach(struct device *, struct device *, void *);
+static int wi_pci_attach(struct device *, struct device *, void *);
static int wi_pci_enable(struct wi_softc *);
static void wi_pci_disable(struct wi_softc *);
static void wi_pci_reset(struct wi_softc *);
@@ -212,7 +212,7 @@ wi_pci_match(struct device *parent, stru
return (0);
}
-static void
+static int
wi_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct wi_pci_softc *psc = (struct wi_pci_softc *)self;
@@ -243,12 +243,12 @@ wi_pci_attach(struct device *parent, str
if (pci_mapreg_map(pa, WI_PCI_LOMEM, PCI_MAPREG_TYPE_MEM, 0,
&memt, &memh, NULL, NULL) != 0) {
printf(": can't map mem space\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, WI_PCI_LOIO, PCI_MAPREG_TYPE_IO, 0,
&iot, &ioh, NULL, NULL) != 0) {
printf(": can't map I/O space\n");
- return;
+ return ENXIO;
}
if (wpp->wpp_chip == CHIP_PLX_OTHER) {
@@ -258,7 +258,7 @@ wi_pci_attach(struct device *parent, str
PCI_MAPREG_TYPE_IO, 0, &plxt,
&plxh, NULL, NULL) != 0) {
printf(": can't map PLX\n");
- return;
+ return ENXIO;
}
}
break;
@@ -272,12 +272,12 @@ wi_pci_attach(struct device *parent, str
if (pci_mapreg_map(pa, WI_TMD_COR, PCI_MAPREG_TYPE_IO, 0,
&tmdt, &tmdh, NULL, NULL) != 0) {
printf(": can't map TMD\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, WI_TMD_IO, PCI_MAPREG_TYPE_IO, 0,
&iot, &ioh, NULL, NULL) != 0) {
printf(": can't map I/O space\n");
- return;
+ return ENXIO;
}
break;
default:
@@ -285,7 +285,7 @@ wi_pci_attach(struct device *parent, str
PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT,
0, &iot, &ioh, NULL, NULL) != 0) {
printf(": can't map mem space\n");
- return;
+ return ENXIO;
}
memt = iot;
@@ -325,7 +325,7 @@ wi_pci_attach(struct device *parent, str
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
@@ -336,7 +336,7 @@ wi_pci_attach(struct device *parent, str
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
printf("%s: interrupting at %s\n", device_xname(self), intrstr);
@@ -368,7 +368,7 @@ wi_pci_attach(struct device *parent, str
if (wi_attach(sc, 0) != 0) {
aprint_error_dev(self, "failed to attach controller\n");
pci_intr_disestablish(pa->pa_pc, sc->sc_ih);
- return;
+ return ENXIO;
}
if (!wpp->wpp_chip)
@@ -378,4 +378,5 @@ wi_pci_attach(struct device *parent, str
aprint_error_dev(self, "couldn't establish power handler\n");
else
pmf_class_network_register(self, &sc->sc_if);
+ return 0;
}
Index: sys/dev/pci/if_wm.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_wm.c,v
retrieving revision 1.174
diff -u -p -r1.174 if_wm.c
--- sys/dev/pci/if_wm.c 7 Apr 2009 18:42:30 -0000 1.174
+++ sys/dev/pci/if_wm.c 1 May 2009 16:44:04 -0000
@@ -570,7 +570,7 @@ static int wm_kmrn_i80003_readreg(struct
static void wm_kmrn_i80003_writereg(struct wm_softc *, int, int);
static int wm_match(device_t, cfdata_t, void *);
-static void wm_attach(device_t, device_t, void *);
+static int wm_attach(device_t, device_t, void *);
static int wm_is_onboard_nvm_eeprom(struct wm_softc *);
static void wm_get_auto_rd_done(struct wm_softc *);
static int wm_get_swsm_semaphore(struct wm_softc *);
@@ -947,7 +947,7 @@ wm_match(device_t parent, cfdata_t cf, v
return (0);
}
-static void
+static int
wm_attach(device_t parent, device_t self, void *aux)
{
struct wm_softc *sc = device_private(self);
@@ -997,7 +997,7 @@ wm_attach(device_t parent, device_t self
if (preg < 2) {
aprint_error_dev(sc->sc_dev,
"i82542 must be at least rev. 2\n");
- return;
+ return ENXIO;
}
if (preg < 3)
sc->sc_type = WM_T_82542_2_0;
@@ -1024,7 +1024,7 @@ wm_attach(device_t parent, device_t self
} else {
aprint_error_dev(sc->sc_dev,
"unable to map device registers\n");
- return;
+ return ENXIO;
}
/*
@@ -1076,7 +1076,7 @@ wm_attach(device_t parent, device_t self
if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self,
NULL)) && error != EOPNOTSUPP) {
aprint_error_dev(sc->sc_dev, "cannot activate %d\n", error);
- return;
+ return ENXIO;
}
/*
@@ -1084,7 +1084,7 @@ wm_attach(device_t parent, device_t self
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(sc->sc_dev, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, wm_intr, sc);
@@ -1093,7 +1093,7 @@ wm_attach(device_t parent, device_t self
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(sc->sc_dev, "interrupting at %s\n", intrstr);
@@ -1319,7 +1319,7 @@ wm_attach(device_t parent, device_t self
&sc->sc_flasht, &sc->sc_flashh, NULL, NULL)) {
aprint_error_dev(sc->sc_dev,
"can't map FLASH registers\n");
- return;
+ return ENXIO;
}
flash_size = ICH8_FLASH_READ32(sc, ICH_FLASH_GFPREG);
sc->sc_ich8_flash_base = (flash_size & ICH_GFPREG_BASE_MASK) *
@@ -1412,7 +1412,7 @@ wm_attach(device_t parent, device_t self
sizeof(myea) / sizeof(myea[0]), myea)) {
aprint_error_dev(sc->sc_dev,
"unable to read Ethernet address\n");
- return;
+ return ENXIO;
}
enaddr[0] = myea[0] & 0xff;
enaddr[1] = myea[0] >> 8;
@@ -1447,7 +1447,7 @@ wm_attach(device_t parent, device_t self
} else {
if (wm_read_eeprom(sc, EEPROM_OFF_CFG1, 1, &cfg1)) {
aprint_error_dev(sc->sc_dev, "unable to read CFG1\n");
- return;
+ return ENXIO;
}
}
@@ -1459,7 +1459,7 @@ wm_attach(device_t parent, device_t self
} else {
if (wm_read_eeprom(sc, EEPROM_OFF_CFG2, 1, &cfg2)) {
aprint_error_dev(sc->sc_dev, "unable to read CFG2\n");
- return;
+ return ENXIO;
}
}
@@ -1473,7 +1473,7 @@ wm_attach(device_t parent, device_t self
if (wm_read_eeprom(sc, EEPROM_OFF_SWDPIN, 1, &swdpin)) {
aprint_error_dev(sc->sc_dev,
"unable to read SWDPIN\n");
- return;
+ return ENXIO;
}
}
}
@@ -1684,7 +1684,7 @@ wm_attach(device_t parent, device_t self
else
pmf_class_network_register(self, ifp);
- return;
+ return 0;
/*
* Free any resources we've allocated during the failed attach
@@ -1711,7 +1711,7 @@ wm_attach(device_t parent, device_t self
fail_1:
bus_dmamem_free(sc->sc_dmat, &seg, rseg);
fail_0:
- return;
+ return ENXIO;
}
/*
Index: sys/dev/pci/if_wpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_wpi.c,v
retrieving revision 1.41
diff -u -p -r1.41 if_wpi.c
--- sys/dev/pci/if_wpi.c 12 Nov 2008 18:23:08 -0000 1.41
+++ sys/dev/pci/if_wpi.c 1 May 2009 16:44:05 -0000
@@ -100,7 +100,7 @@ static uint8_t *wpi_firmware_image;
static size_t wpi_firmware_size;
static int wpi_match(device_t, struct cfdata *, void *);
-static void wpi_attach(device_t, device_t, void *);
+static int wpi_attach(device_t, device_t, void *);
static int wpi_detach(device_t , int);
static int wpi_dma_contig_alloc(bus_dma_tag_t, struct wpi_dma_info *,
void **, bus_size_t, bus_size_t, int);
@@ -203,7 +203,7 @@ wpi_attach_once(void)
return 0;
}
-static void
+static int
wpi_attach(device_t parent __unused, device_t self, void *aux)
{
struct wpi_softc *sc = device_private(self);
@@ -242,7 +242,7 @@ wpi_attach(device_t parent __unused, dev
PCI_MAPREG_MEM_TYPE_32BIT, 0, &memt, &memh, NULL, &sc->sc_sz);
if (error != 0) {
aprint_error_dev(self, "could not map memory space\n");
- return;
+ return ENXIO;
}
sc->sc_st = memt;
@@ -251,7 +251,7 @@ wpi_attach(device_t parent __unused, dev
if (pci_intr_map(pa, &ih) != 0) {
aprint_error_dev(self, "could not map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(sc->sc_pct, ih);
@@ -261,20 +261,20 @@ wpi_attach(device_t parent __unused, dev
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
if (wpi_reset(sc) != 0) {
aprint_error_dev(self, "could not reset adapter\n");
- return;
+ return ENXIO;
}
/*
* Allocate DMA memory for firmware transfers.
*/
if ((error = wpi_alloc_fwmem(sc)) != 0)
- return;
+ return ENXIO;
/*
* Allocate shared page and Tx/Rx rings.
@@ -381,7 +381,7 @@ wpi_attach(device_t parent __unused, dev
ieee80211_announce(ic);
- return;
+ return 0;
fail4: wpi_free_tx_ring(sc, &sc->cmdq);
fail3: while (--ac >= 0)
@@ -389,6 +389,7 @@ fail3: while (--ac >= 0)
wpi_free_rpool(sc);
fail2: wpi_free_shared(sc);
fail1: wpi_free_fwmem(sc);
+ return ENXIO;
}
static int
Index: sys/dev/pci/if_xge.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_xge.c,v
retrieving revision 1.10
diff -u -p -r1.10 if_xge.c
--- sys/dev/pci/if_xge.c 16 Dec 2008 22:35:33 -0000 1.10
+++ sys/dev/pci/if_xge.c 1 May 2009 16:44:05 -0000
@@ -181,7 +181,7 @@ struct xge_softc {
};
static int xge_match(struct device *parent, struct cfdata *cf, void *aux);
-static void xge_attach(struct device *parent, struct device *self, void *aux);
+static int xge_attach(struct device *parent, struct device *self, void *aux);
static int xge_alloc_txmem(struct xge_softc *);
static int xge_alloc_rxmem(struct xge_softc *);
static void xge_start(struct ifnet *);
@@ -280,7 +280,7 @@ xge_match(struct device *parent, struct
return (0);
}
-void
+int
xge_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -303,14 +303,14 @@ xge_attach(struct device *parent, struct
if (pci_mapreg_map(pa, XGE_PIF_BAR, memtype, 0,
&sc->sc_st, &sc->sc_sh, 0, 0)) {
aprint_error("%s: unable to map PIF BAR registers\n", XNAME);
- return;
+ return ENXIO;
}
memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, XGE_TXP_BAR);
if (pci_mapreg_map(pa, XGE_TXP_BAR, memtype, 0,
&sc->sc_txt, &sc->sc_txh, 0, 0)) {
aprint_error("%s: unable to map TXP BAR registers\n", XNAME);
- return;
+ return ENXIO;
}
/* Save PCI config space */
@@ -328,9 +328,11 @@ xge_attach(struct device *parent, struct
#error bad endianness!
#endif
- if ((val = PIF_RCSR(PIF_RD_SWAPPER_Fb)) != SWAPPER_MAGIC)
- return printf("%s: failed configuring endian, %llx != %llx!\n",
+ if ((val = PIF_RCSR(PIF_RD_SWAPPER_Fb)) != SWAPPER_MAGIC) {
+ printf("%s: failed configuring endian, %llx != %llx!\n",
XNAME, (unsigned long long)val, SWAPPER_MAGIC);
+ return ENXIO;
+ }
/*
* The MAC addr may be all FF's, which is not good.
@@ -364,9 +366,11 @@ xge_attach(struct device *parent, struct
#error bad endianness!
#endif
- if ((val = PIF_RCSR(PIF_RD_SWAPPER_Fb)) != SWAPPER_MAGIC)
- return printf("%s: failed configuring endian2, %llx != %llx!\n",
+ if ((val = PIF_RCSR(PIF_RD_SWAPPER_Fb)) != SWAPPER_MAGIC) {
+ printf("%s: failed configuring endian2, %llx != %llx!\n",
XNAME, (unsigned long long)val, SWAPPER_MAGIC);
+ return ENXIO;
+ }
/*
* XGXS initialization.
@@ -391,8 +395,10 @@ xge_attach(struct device *parent, struct
/*
* Get memory for transmit descriptor lists.
*/
- if (xge_alloc_txmem(sc))
- return printf("%s: failed allocating txmem.\n", XNAME);
+ if (xge_alloc_txmem(sc)) {
+ printf("%s: failed allocating txmem.\n", XNAME);
+ return ENXIO;
+ }
/* 9 and 10 - set FIFO number/prio */
PIF_WCSR(TX_FIFO_P0, TX_FIFO_LEN0(NTXDESCS));
@@ -417,8 +423,10 @@ xge_attach(struct device *parent, struct
*/
for (i = 0; i < NTXDESCS; i++) {
if (bus_dmamap_create(sc->sc_dmat, XGE_IP_MAXPACKET,
- NTXFRAGS, MCLBYTES, 0, 0, &sc->sc_txm[i]))
- return printf("%s: cannot create TX DMA maps\n", XNAME);
+ NTXFRAGS, MCLBYTES, 0, 0, &sc->sc_txm[i])) {
+ printf("%s: cannot create TX DMA maps\n", XNAME);
+ return ENXIO;
+ }
}
sc->sc_lasttx = NTXDESCS-1;
@@ -427,14 +435,18 @@ xge_attach(struct device *parent, struct
* RxDMA initialization.
* Only use one out of 8 possible receive queues.
*/
- if (xge_alloc_rxmem(sc)) /* allocate rx descriptor memory */
- return printf("%s: failed allocating rxmem\n", XNAME);
+ if (xge_alloc_rxmem(sc)) { /* allocate rx descriptor memory */
+ printf("%s: failed allocating rxmem\n", XNAME);
+ return ENXIO;
+ }
/* Create receive buffer DMA maps */
for (i = 0; i < NRXREAL; i++) {
if (bus_dmamap_create(sc->sc_dmat, XGE_MAX_MTU,
- NRXFRAGS, MCLBYTES, 0, 0, &sc->sc_rxm[i]))
- return printf("%s: cannot create RX DMA maps\n", XNAME);
+ NRXFRAGS, MCLBYTES, 0, 0, &sc->sc_rxm[i])) {
+ printf("%s: cannot create RX DMA maps\n", XNAME);
+ return ENXIO;
+ }
}
/* allocate mbufs to receive descriptors */
@@ -553,13 +565,17 @@ xge_attach(struct device *parent, struct
/*
* Setup interrupt vector before initializing.
*/
- if (pci_intr_map(pa, &ih))
- return aprint_error_dev(&sc->sc_dev, "unable to map
interrupt\n");
+ if (pci_intr_map(pa, &ih)) {
+ aprint_error_dev(&sc->sc_dev, "unable to map interrupt\n");
+ return ENXIO;
+ }
intrstr = pci_intr_string(pc, ih);
if ((sc->sc_ih =
- pci_intr_establish(pc, ih, IPL_NET, xge_intr, sc)) == NULL)
- return aprint_error_dev(&sc->sc_dev, "unable to establish
interrupt at %s\n",
+ pci_intr_establish(pc, ih, IPL_NET, xge_intr, sc)) == NULL) {
+ aprint_error_dev(&sc->sc_dev, "unable to establish interrupt at
%s\n",
intrstr ? intrstr : "<unknown>");
+ return ENXIO;
+ }
aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
#ifdef XGE_EVENT_COUNTERS
@@ -572,6 +588,7 @@ xge_attach(struct device *parent, struct
evcnt_attach_dynamic(&sc->sc_txqe, EVCNT_TYPE_MISC,
NULL, XNAME, "txqe");
#endif
+ return 0;
}
void
Index: sys/dev/pci/iha_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/iha_pci.c,v
retrieving revision 1.16
diff -u -p -r1.16 iha_pci.c
--- sys/dev/pci/iha_pci.c 14 May 2008 13:29:29 -0000 1.16
+++ sys/dev/pci/iha_pci.c 1 May 2009 16:44:05 -0000
@@ -80,7 +80,7 @@ __KERNEL_RCSID(0, "$NetBSD: iha_pci.c,v
#include <dev/ic/ihavar.h>
static int iha_pci_match(device_t, cfdata_t, void *);
-static void iha_pci_attach(device_t, device_t, void *);
+static int iha_pci_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(iha_pci, sizeof(struct iha_softc),
iha_pci_match, iha_pci_attach, NULL, NULL);
@@ -102,7 +102,7 @@ iha_pci_match(device_t parent, cfdata_t
return 0;
}
-static void
+static int
iha_pci_attach(device_t parent, device_t self, void *aux)
{
struct iha_softc *sc = device_private(self);
@@ -135,7 +135,7 @@ iha_pci_attach(device_t parent, device_t
if (ioh_valid != 0) {
aprint_error_dev(self, "unable to map registers\n");
- return;
+ return ENXIO;
}
sc->sc_iot = iot;
@@ -144,7 +144,7 @@ iha_pci_attach(device_t parent, device_t
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
@@ -155,9 +155,10 @@ iha_pci_attach(device_t parent, device_t
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
iha_attach(sc);
+ return 0;
}
Index: sys/dev/pci/iop_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/iop_pci.c,v
retrieving revision 1.23
diff -u -p -r1.23 iop_pci.c
--- sys/dev/pci/iop_pci.c 28 Apr 2008 20:23:55 -0000 1.23
+++ sys/dev/pci/iop_pci.c 1 May 2009 16:44:05 -0000
@@ -57,7 +57,7 @@ __KERNEL_RCSID(0, "$NetBSD: iop_pci.c,v
#define PCI_INTERFACE_I2O_POLLED 0x00
#define PCI_INTERFACE_I2O_INTRDRIVEN 0x01
-static void iop_pci_attach(struct device *, struct device *, void *);
+static int iop_pci_attach(struct device *, struct device *, void *);
static int iop_pci_match(struct device *, struct cfdata *, void *);
CFATTACH_DECL(iop_pci, sizeof(struct iop_softc),
@@ -105,7 +105,7 @@ iop_pci_match(struct device *parent, str
return (0);
}
-static void
+static int
iop_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa;
@@ -134,14 +134,14 @@ iop_pci_attach(struct device *parent, st
}
if (i == PCI_MAPREG_END) {
printf("can't find mapping\n");
- return;
+ return ENXIO;
}
/* Map the register window. */
if (pci_mapreg_map(pa, i, PCI_MAPREG_TYPE_MEM, 0, &sc->sc_iot,
&sc->sc_ioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dv, "can't map register window\n");
- return;
+ return ENXIO;
}
/* Map the 2nd register window. */
@@ -150,7 +150,7 @@ iop_pci_attach(struct device *parent, st
i += 4; /* next BAR */
if (i == PCI_MAPREG_END) {
printf("can't find mapping\n");
- return;
+ return ENXIO;
}
#if 0
@@ -161,7 +161,7 @@ iop_pci_attach(struct device *parent, st
if (pci_mapreg_map(pa, i, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc_msg_iot, &sc->sc_msg_ioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dv, "can't map 2nd register
window\n");
- return;
+ return ENXIO;
}
} else {
/* iop devices other than 2005S */
@@ -183,7 +183,7 @@ iop_pci_attach(struct device *parent, st
/* Map and establish the interrupt.. */
if (pci_intr_map(pa, &ih)) {
printf("can't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_BIO, iop_intr, sc);
@@ -192,9 +192,10 @@ iop_pci_attach(struct device *parent, st
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
/* Attach to the bus-independent code. */
iop_init(sc, intrstr);
+ return 0;
}
Index: sys/dev/pci/isp_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/isp_pci.c,v
retrieving revision 1.105
diff -u -p -r1.105 isp_pci.c
--- sys/dev/pci/isp_pci.c 7 Apr 2008 19:26:44 -0000 1.105
+++ sys/dev/pci/isp_pci.c 1 May 2009 16:44:05 -0000
@@ -390,7 +390,7 @@ static struct ispmdvec mdvec_2400 = {
#define PCI_DFLT_LNSZ 0x10
static int isp_pci_probe(struct device *, struct cfdata *, void *);
-static void isp_pci_attach(struct device *, struct device *, void *);
+static int isp_pci_attach(struct device *, struct device *, void *);
struct isp_pcisoftc {
struct ispsoftc pci_isp;
@@ -454,7 +454,7 @@ isp_pci_probe(struct device *parent, str
}
}
-static void
+static int
isp_pci_attach(struct device *parent, struct device *self, void *aux)
{
static const char nomem[] = "\n%s: no mem for sdparam table\n";
@@ -493,7 +493,7 @@ isp_pci_attach(struct device *parent, st
sh = ioh;
} else {
printf(": unable to map device registers\n");
- return;
+ return ENXIO;
}
dstring = "\n";
@@ -648,13 +648,13 @@ isp_pci_attach(struct device *parent, st
}
#endif
if (mamt == 0) {
- return;
+ return ENXIO;
}
isp->isp_param = malloc(mamt, M_DEVBUF, M_NOWAIT);
if (isp->isp_param == NULL) {
printf(nomem, device_xname(&isp->isp_osinfo.dev));
- return;
+ return ENXIO;
}
memset(isp->isp_param, 0, mamt);
mamt = sizeof (struct scsipi_channel) * isp->isp_nchan;
@@ -662,7 +662,7 @@ isp_pci_attach(struct device *parent, st
if (isp->isp_osinfo.chan == NULL) {
free(isp->isp_param, M_DEVBUF);
printf(nomem, device_xname(&isp->isp_osinfo.dev));
- return;
+ return ENXIO;
}
memset(isp->isp_osinfo.chan, 0, mamt);
isp->isp_osinfo.adapter.adapt_nchannels = isp->isp_nchan;
@@ -724,7 +724,7 @@ isp_pci_attach(struct device *parent, st
aprint_error_dev(&isp->isp_osinfo.dev, "couldn't map
interrupt\n");
free(isp->isp_param, M_DEVBUF);
free(isp->isp_osinfo.chan, M_DEVBUF);
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
if (intrstr == NULL)
@@ -736,7 +736,7 @@ isp_pci_attach(struct device *parent, st
intrstr);
free(isp->isp_param, M_DEVBUF);
free(isp->isp_osinfo.chan, M_DEVBUF);
- return;
+ return ENXIO;
}
printf("%s: interrupting at %s\n", device_xname(&isp->isp_osinfo.dev),
intrstr);
@@ -748,7 +748,7 @@ isp_pci_attach(struct device *parent, st
ISP_UNLOCK(isp);
free(isp->isp_param, M_DEVBUF);
free(isp->isp_osinfo.chan, M_DEVBUF);
- return;
+ return ENXIO;
}
isp_init(isp);
if (isp->isp_state != ISP_INITSTATE) {
@@ -756,13 +756,14 @@ isp_pci_attach(struct device *parent, st
ISP_UNLOCK(isp);
free(isp->isp_param, M_DEVBUF);
free(isp->isp_osinfo.chan, M_DEVBUF);
- return;
+ return ENXIO;
}
/*
* Do platform attach.
*/
ISP_UNLOCK(isp);
isp_attach(isp);
+ return 0;
}
#define IspVirt2Off(a, x) \
Index: sys/dev/pci/iteide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/iteide.c,v
retrieving revision 1.10
diff -u -p -r1.10 iteide.c
--- sys/dev/pci/iteide.c 10 Apr 2008 19:13:37 -0000 1.10
+++ sys/dev/pci/iteide.c 1 May 2009 16:44:05 -0000
@@ -46,7 +46,7 @@ static void ite_chip_map(struct pciide_s
static void ite_setup_channel(struct ata_channel*);
static int iteide_match(device_t, cfdata_t, void *);
-static void iteide_attach(device_t, device_t, void *);
+static int iteide_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(iteide, sizeof(struct pciide_softc),
iteide_match, iteide_attach, NULL, NULL);
@@ -81,7 +81,7 @@ iteide_match(device_t parent, cfdata_t m
return (0);
}
-static void
+static int
iteide_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -91,6 +91,7 @@ iteide_attach(device_t parent, device_t
pciide_common_attach(sc, pa,
pciide_lookup_product(pa->pa_id, pciide_ite_products));
+ return 0;
}
static void
Index: sys/dev/pci/ixpide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ixpide.c,v
retrieving revision 1.14
diff -u -p -r1.14 ixpide.c
--- sys/dev/pci/ixpide.c 4 Nov 2008 16:05:29 -0000 1.14
+++ sys/dev/pci/ixpide.c 1 May 2009 16:44:06 -0000
@@ -41,7 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: ixpide.c,v 1
static bool ixpide_resume(device_t PMF_FN_PROTO);
static bool ixpide_suspend(device_t PMF_FN_PROTO);
static int ixpide_match(device_t, cfdata_t, void *);
-static void ixpide_attach(device_t, device_t, void *);
+static int ixpide_attach(device_t, device_t, void *);
static void ixp_chip_map(struct pciide_softc *, struct pci_attach_args *);
static void ixp_setup_channel(struct ata_channel *);
@@ -78,7 +78,7 @@ ixpide_match(device_t parent, cfdata_t c
return (0);
}
-static void
+static int
ixpide_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -91,6 +91,7 @@ ixpide_attach(device_t parent, device_t
if (!pmf_device_register(self, ixpide_suspend, ixpide_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static void
Index: sys/dev/pci/jmide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/jmide.c,v
retrieving revision 1.6
diff -u -p -r1.6 jmide.c
--- sys/dev/pci/jmide.c 5 Jun 2008 18:22:02 -0000 1.6
+++ sys/dev/pci/jmide.c 1 May 2009 16:44:06 -0000
@@ -50,7 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: jmide.c,v 1.
static const struct jmide_product *jmide_lookup(pcireg_t);
static int jmide_match(device_t, cfdata_t, void *);
-static void jmide_attach(device_t, device_t, void *);
+static int jmide_attach(device_t, device_t, void *);
static int jmide_intr(void *);
static void jmpata_chip_map(struct pciide_softc*, struct pci_attach_args*);
@@ -145,7 +145,7 @@ jmide_match(device_t parent, cfdata_t ma
return (0);
}
-static void
+static int
jmide_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -166,7 +166,7 @@ jmide_attach(device_t parent, device_t s
jp = jmide_lookup(pa->pa_id);
if (jp == NULL) {
printf("jmide_attach: WTF?\n");
- return;
+ return ENXIO;
}
sc->sc_npata = jp->jm_npata;
sc->sc_nsata = jp->jm_nsata;
@@ -186,14 +186,14 @@ jmide_attach(device_t parent, device_t s
if (pci_intr_map(pa, &intrhandle) != 0) {
aprint_error("%s: couldn't map interrupt\n", JM_NAME(sc));
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, intrhandle);
sc->sc_pciide.sc_pci_ih = pci_intr_establish(pa->pa_pc, intrhandle,
IPL_BIO, jmide_intr, sc);
if (sc->sc_pciide.sc_pci_ih == NULL) {
aprint_error("%s: couldn't establish interrupt", JM_NAME(sc));
- return;
+ return ENXIO;
}
aprint_normal("%s: interrupting at %s\n", JM_NAME(sc),
intrstr ? intrstr : "unknown interrupt");
@@ -273,15 +273,15 @@ jmide_attach(device_t parent, device_t s
if (sc->sc_chan_type[0] == TYPE_NONE &&
sc->sc_chan_type[1] == TYPE_NONE)
- return;
+ return ENXIO;
if (pa->pa_function == 0 && (pcictrl0 & JM_CONTROL0_PCIIDE_F1))
- return;
+ return ENXIO;
if (pa->pa_function == 1 && (pcictrl0 & JM_CONTROL0_PCIIDE_F1) == 0)
- return;
+ return ENXIO;
pp = malloc(sizeof(struct pciide_product_desc), M_DEVBUF, M_NOWAIT);
if (pp == NULL) {
aprint_error("%s: can't malloc sc_pp\n", JM_NAME(sc));
- return;
+ return ENXIO;
}
aprint_normal("%s: PCI IDE interface used", JM_NAME(sc));
pp->ide_product = 0;
@@ -289,7 +289,7 @@ jmide_attach(device_t parent, device_t s
pp->ide_name = NULL;
pp->chip_map = jmpata_chip_map;
pciide_common_attach(&sc->sc_pciide, pa, pp);
-
+ return 0;
}
static int
@@ -435,7 +435,7 @@ jmahci_print(void *aux, const char *pnp)
#ifdef NJMAHCI
static int jmahci_match(device_t, cfdata_t, void *);
-static void jmahci_attach(device_t, device_t, void *);
+static int jmahci_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(jmahci, sizeof(struct ahci_softc),
jmahci_match, jmahci_attach, NULL, NULL);
@@ -446,7 +446,7 @@ jmahci_match(device_t parent, cfdata_t m
return 1;
}
-static void
+static int
jmahci_attach(device_t parent, device_t self, void *aux)
{
struct jmahci_attach_args *jma = aux;
@@ -465,5 +465,6 @@ jmahci_attach(device_t parent, device_t
sc->sc_atac_capflags = ATAC_CAP_RAID;
ahci_attach(sc);
+ return 0;
}
#endif
Index: sys/dev/pci/ld_amr.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ld_amr.c,v
retrieving revision 1.17
diff -u -p -r1.17 ld_amr.c
--- sys/dev/pci/ld_amr.c 9 Sep 2008 12:45:40 -0000 1.17
+++ sys/dev/pci/ld_amr.c 1 May 2009 16:44:06 -0000
@@ -80,7 +80,7 @@ ld_amr_match(device_t parent, cfdata_t m
return (1);
}
-static void
+static int
ld_amr_attach(device_t parent, device_t self, void *aux)
{
struct amr_attach_args *amra = aux;
@@ -116,6 +116,7 @@ ld_amr_attach(device_t parent, device_t
statestr);
ldattach(ld);
+ return 0;
}
CFATTACH_DECL_NEW(ld_amr, sizeof(struct ld_amr_softc),
Index: sys/dev/pci/ld_twa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ld_twa.c,v
retrieving revision 1.13
diff -u -p -r1.13 ld_twa.c
--- sys/dev/pci/ld_twa.c 9 Sep 2008 12:45:40 -0000 1.13
+++ sys/dev/pci/ld_twa.c 1 May 2009 16:44:06 -0000
@@ -76,7 +76,7 @@ struct ld_twa_softc {
int sc_hwunit;
};
-static void ld_twa_attach(device_t, device_t, void *);
+static int ld_twa_attach(device_t, device_t, void *);
static int ld_twa_detach(device_t, int);
static int ld_twa_dobio(struct ld_twa_softc *, void *, size_t, daddr_t,
struct buf *);
@@ -105,7 +105,7 @@ ld_twa_match(device_t parent, cfdata_t m
return (1);
}
-static void
+static int
ld_twa_attach(device_t parent, device_t self, void *aux)
{
struct twa_attach_args *twa_args = aux;
@@ -127,6 +127,7 @@ ld_twa_attach(device_t parent, device_t
ld->sc_dump = ld_twa_dump;
ld->sc_flush = ld_twa_flush;
ldattach(ld);
+ return 0;
}
static int
Index: sys/dev/pci/ld_twe.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ld_twe.c,v
retrieving revision 1.32
diff -u -p -r1.32 ld_twe.c
--- sys/dev/pci/ld_twe.c 9 Sep 2008 12:45:40 -0000 1.32
+++ sys/dev/pci/ld_twe.c 1 May 2009 16:44:06 -0000
@@ -66,7 +66,7 @@ struct ld_twe_softc {
int sc_hwunit;
};
-static void ld_twe_attach(device_t, device_t, void *);
+static int ld_twe_attach(device_t, device_t, void *);
static int ld_twe_detach(device_t, int);
static int ld_twe_dobio(struct ld_twe_softc *, void *, int, int, int,
struct buf *);
@@ -92,7 +92,7 @@ ld_twe_match(device_t parent, cfdata_t m
return (1);
}
-static void
+static int
ld_twe_attach(device_t parent, device_t self, void *aux)
{
struct twe_attach_args *twea = aux;
@@ -156,6 +156,7 @@ ld_twe_attach(device_t parent, device_t
aprint_normal(": %s%s, status: %s\n", stripebuf, typestr, statstr);
ldattach(ld);
+ return 0;
}
static int
Index: sys/dev/pci/lpt_puc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/lpt_puc.c,v
retrieving revision 1.14
diff -u -p -r1.14 lpt_puc.c
--- sys/dev/pci/lpt_puc.c 7 Mar 2008 17:15:52 -0000 1.14
+++ sys/dev/pci/lpt_puc.c 1 May 2009 16:44:06 -0000
@@ -64,7 +64,7 @@ lpt_puc_probe(device_t parent, cfdata_t
return (1);
}
-static void
+static int
lpt_puc_attach(device_t parent, device_t self, void *aux)
{
struct lpt_softc *sc = device_private(self);
@@ -83,11 +83,12 @@ lpt_puc_attach(device_t parent, device_t
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
aprint_normal(": interrupting at %s\n", intrstr);
lpt_attach_subr(sc);
+ return 0;
}
CFATTACH_DECL_NEW(lpt_puc, sizeof(struct lpt_softc),
Index: sys/dev/pci/mfi_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/mfi_pci.c,v
retrieving revision 1.5
diff -u -p -r1.5 mfi_pci.c
--- sys/dev/pci/mfi_pci.c 26 Feb 2008 18:16:51 -0000 1.5
+++ sys/dev/pci/mfi_pci.c 1 May 2009 16:44:06 -0000
@@ -42,7 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: mfi_pci.c,v
const struct mfi_pci_device *mfi_pci_find_device(struct pci_attach_args *);
int mfi_pci_match(struct device *, struct cfdata *, void *);
-void mfi_pci_attach(struct device *, struct device *, void *);
+int mfi_pci_attach(struct device *, struct device *, void *);
CFATTACH_DECL(mfi_pci, sizeof(struct mfi_softc),
mfi_pci_match, mfi_pci_attach, NULL, NULL);
@@ -117,7 +117,7 @@ mfi_pci_match(struct device *parent, str
return (mfi_pci_find_device(aux) != NULL) ? 1 : 0;
}
-void
+int
mfi_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct mfi_softc *sc = (struct mfi_softc *)self;
@@ -136,7 +136,7 @@ mfi_pci_attach(struct device *parent, st
if (pci_mapreg_map(pa, MFI_BAR, csr, 0,
&sc->sc_iot, &sc->sc_ioh, NULL, &size)) {
aprint_error(": can't map controller pci space\n");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
@@ -144,7 +144,7 @@ mfi_pci_attach(struct device *parent, st
if (pci_intr_map(pa, &ih)) {
aprint_error(": can't map interrupt\n");
bus_space_unmap(sc->sc_iot, sc->sc_ioh, size);
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_BIO, mfi_intr, sc);
@@ -154,7 +154,7 @@ mfi_pci_attach(struct device *parent, st
aprint_error(" at %s", intrstr);
aprint_error("\n");
bus_space_unmap(sc->sc_iot, sc->sc_ioh, size);
- return;
+ return ENXIO;
}
mpd = mfi_pci_find_device(pa);
@@ -181,5 +181,7 @@ mfi_pci_attach(struct device *parent, st
pci_intr_disestablish(pa->pa_pc, sc->sc_ih);
sc->sc_ih = NULL;
bus_space_unmap(sc->sc_iot, sc->sc_ioh, size);
+ return ENXIO;
}
+ return 0;
}
Index: sys/dev/pci/mlx_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/mlx_pci.c,v
retrieving revision 1.19
diff -u -p -r1.19 mlx_pci.c
--- sys/dev/pci/mlx_pci.c 28 Apr 2008 20:23:55 -0000 1.19
+++ sys/dev/pci/mlx_pci.c 1 May 2009 16:44:06 -0000
@@ -82,7 +82,7 @@ __KERNEL_RCSID(0, "$NetBSD: mlx_pci.c,v
#include <dev/pci/pcivar.h>
#include <dev/pci/pcidevs.h>
-static void mlx_pci_attach(struct device *, struct device *, void *);
+static int mlx_pci_attach(struct device *, struct device *, void *);
static int mlx_pci_match(struct device *, struct cfdata *, void *);
static const struct mlx_pci_ident *mlx_pci_findmpi(struct pci_attach_args *);
@@ -188,7 +188,7 @@ mlx_pci_match(struct device *parent, str
/*
* Attach a supported board.
*/
-static void
+static int
mlx_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa;
@@ -247,7 +247,7 @@ mlx_pci_attach(struct device *parent, st
mlx->mlx_ioh = ioh;
} else {
aprint_error_dev(self, "can't map i/o or memory space\n");
- return;
+ return ENXIO;
}
/* Enable the device. */
@@ -258,7 +258,7 @@ mlx_pci_attach(struct device *parent, st
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "can't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
mlx->mlx_ih = pci_intr_establish(pc, ih, IPL_BIO, mlx_intr, mlx);
@@ -267,7 +267,7 @@ mlx_pci_attach(struct device *parent, st
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
/* Select linkage based on controller interface type. */
@@ -299,6 +299,7 @@ mlx_pci_attach(struct device *parent, st
}
mlx_init(mlx, intrstr);
+ return 0;
}
/*
Index: sys/dev/pci/mly.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/mly.c,v
retrieving revision 1.39
diff -u -p -r1.39 mly.c
--- sys/dev/pci/mly.c 8 Jun 2008 12:43:52 -0000 1.39
+++ sys/dev/pci/mly.c 1 May 2009 16:44:06 -0000
@@ -103,7 +103,7 @@ __KERNEL_RCSID(0, "$NetBSD: mly.c,v 1.39
#include <dev/pci/mlyvar.h>
#include <dev/pci/mly_tables.h>
-static void mly_attach(struct device *, struct device *, void *);
+static int mly_attach(struct device *, struct device *, void *);
static int mly_match(struct device *, struct cfdata *, void *);
static const struct mly_ident *mly_find_ident(struct pci_attach_args *);
static int mly_fwhandshake(struct mly_softc *);
@@ -267,7 +267,7 @@ mly_match(struct device *parent, struct
/*
* Attach a supported board.
*/
-static void
+static int
mly_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa;
@@ -330,7 +330,7 @@ mly_attach(struct device *parent, struct
mly->mly_ioh = ioh;
} else {
aprint_error_dev(self, "can't map i/o or memory space\n");
- return;
+ return ENXIO;
}
/*
@@ -345,7 +345,7 @@ mly_attach(struct device *parent, struct
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "can't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
mly->mly_ih = pci_intr_establish(pc, ih, IPL_BIO, mly_intr, mly);
@@ -354,7 +354,7 @@ mly_attach(struct device *parent, struct
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
if (intrstr != NULL)
@@ -541,7 +541,7 @@ mly_attach(struct device *parent, struct
if (rv != 0)
aprint_error_dev(&mly->mly_dv, "unable to create thread (%d)\n",
rv);
- return;
+ return ENXIO;
bad:
if (state > 2)
@@ -554,6 +554,7 @@ mly_attach(struct device *parent, struct
mly_dmamem_free(mly, MLY_SGL_SIZE * MLY_MAX_CCBS,
mly->mly_sg_dmamap, (void *)mly->mly_sg,
&mly->mly_sg_seg);
+ return 0;
}
/*
Index: sys/dev/pci/mpt_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/mpt_pci.c,v
retrieving revision 1.16
diff -u -p -r1.16 mpt_pci.c
--- sys/dev/pci/mpt_pci.c 10 Apr 2008 19:13:37 -0000 1.16
+++ sys/dev/pci/mpt_pci.c 1 May 2009 16:44:08 -0000
@@ -122,7 +122,7 @@ mpt_pci_match(struct device *parent, str
return (0);
}
-static void
+static int
mpt_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct mpt_pci_softc *psc = (void *) self;
@@ -166,7 +166,7 @@ mpt_pci_attach(struct device *parent, st
mpt->sc_sh = memh;
} else {
aprint_error_dev(&mpt->sc_dev, "unable to map device
registers\n");
- return;
+ return ENXIO;
}
/*
@@ -203,7 +203,7 @@ mpt_pci_attach(struct device *parent, st
*/
if (pci_intr_map(pa, &ih) != 0) {
aprint_error_dev(&mpt->sc_dev, "unable to map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
psc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_BIO, mpt_intr, mpt);
@@ -212,7 +212,7 @@ mpt_pci_attach(struct device *parent, st
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&mpt->sc_dev, "interrupting at %s\n",
intrstr);
@@ -223,17 +223,18 @@ mpt_pci_attach(struct device *parent, st
/* Allocate DMA memory. */
if (mpt_dma_mem_alloc(mpt) != 0) {
aprint_error_dev(&mpt->sc_dev, "unable to allocate DMA
memory\n");
- return;
+ return ENXIO;
}
/* Initialize the hardware. */
if (mpt_init(mpt, MPT_DB_INIT_HOST) != 0) {
/* Error message already printed. */
- return;
+ return ENXIO;
}
/* Attach to scsipi. */
mpt_scsipi_attach(mpt);
+ return 0;
}
CFATTACH_DECL(mpt_pci, sizeof(struct mpt_pci_softc),
Index: sys/dev/pci/mpu_cmpci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/mpu_cmpci.c,v
retrieving revision 1.15
diff -u -p -r1.15 mpu_cmpci.c
--- sys/dev/pci/mpu_cmpci.c 28 Apr 2008 20:23:55 -0000 1.15
+++ sys/dev/pci/mpu_cmpci.c 1 May 2009 16:44:08 -0000
@@ -67,7 +67,7 @@ mpu_cmpci_match(device_t parent, cfdata_
return mpu_find(&sc);
}
-static void
+static int
mpu_cmpci_attach(device_t parent, device_t self, void *aux)
{
struct cmpci_softc *ysc = device_private(parent);
@@ -81,6 +81,7 @@ mpu_cmpci_attach(device_t parent, device
sc->sc_dev = self;
mpu_attach(sc);
+ return 0;
}
CFATTACH_DECL_NEW(mpu_cmpci, sizeof (struct mpu_softc),
Index: sys/dev/pci/mpu_eso.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/mpu_eso.c,v
retrieving revision 1.16
diff -u -p -r1.16 mpu_eso.c
--- sys/dev/pci/mpu_eso.c 28 Apr 2008 20:23:55 -0000 1.16
+++ sys/dev/pci/mpu_eso.c 1 May 2009 16:44:08 -0000
@@ -68,7 +68,7 @@ mpu_eso_match(device_t parent, cfdata_t
return mpu_find(&sc);
}
-static void
+static int
mpu_eso_attach(device_t parent, device_t self, void *aux)
{
struct eso_softc *esc = device_private(parent);
@@ -82,6 +82,7 @@ mpu_eso_attach(device_t parent, device_t
sc->sc_dev = self;
mpu_attach(sc);
+ return 0;
}
CFATTACH_DECL_NEW(mpu_eso, sizeof (struct mpu_softc),
Index: sys/dev/pci/mpu_yds.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/mpu_yds.c,v
retrieving revision 1.15
diff -u -p -r1.15 mpu_yds.c
--- sys/dev/pci/mpu_yds.c 28 Apr 2008 20:23:55 -0000 1.15
+++ sys/dev/pci/mpu_yds.c 1 May 2009 16:44:08 -0000
@@ -70,7 +70,7 @@ mpu_yds_match(device_t parent, cfdata_t
return mpu_find(&sc);
}
-static void
+static int
mpu_yds_attach(device_t parent, device_t self, void *aux)
{
struct yds_softc *ysc = device_private(parent);
@@ -87,6 +87,7 @@ mpu_yds_attach(device_t parent, device_t
sc->sc_dev = self;
mpu_attach(sc);
+ return 0;
}
CFATTACH_DECL_NEW(mpu_yds, sizeof (struct mpu_softc),
Index: sys/dev/pci/neo.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/neo.c,v
retrieving revision 1.39
diff -u -p -r1.39 neo.c
--- sys/dev/pci/neo.c 10 Apr 2008 19:13:37 -0000 1.39
+++ sys/dev/pci/neo.c 1 May 2009 16:44:08 -0000
@@ -175,7 +175,7 @@ static int nm_loadcoeff(struct neo_softc
static int nm_init(struct neo_softc *);
static int neo_match(struct device *, struct cfdata *, void *);
-static void neo_attach(struct device *, struct device *, void *);
+static int neo_attach(struct device *, struct device *, void *);
static int neo_intr(void *);
static int neo_query_encoding(void *, struct audio_encoding *);
@@ -560,7 +560,7 @@ neo_resume(device_t dv PMF_FN_ARGS)
return true;
}
-static void
+static int
neo_attach(struct device *parent, struct device *self, void *aux)
{
struct neo_softc *sc;
@@ -583,19 +583,19 @@ neo_attach(struct device *parent, struct
if (pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_MEM, 0,
&sc->bufiot, &sc->bufioh, &sc->buf_pciaddr, NULL)) {
aprint_error_dev(&sc->dev, "can't map buffer\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, PCI_MAPREG_START + 4, PCI_MAPREG_TYPE_MEM,
BUS_SPACE_MAP_LINEAR, &sc->regiot, &sc->regioh, NULL, NULL)) {
aprint_error_dev(&sc->dev, "can't map registers\n");
- return;
+ return ENXIO;
}
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
@@ -606,12 +606,12 @@ neo_attach(struct device *parent, struct
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
printf("%s: interrupting at %s\n", device_xname(&sc->dev), intrstr);
if (nm_init(sc) != 0)
- return;
+ return ENXIO;
/* Enable the device. */
csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
@@ -627,12 +627,13 @@ neo_attach(struct device *parent, struct
sc->host_if.flags = neo_flags_codec;
if (ac97_attach(&sc->host_if, self) != 0)
- return;
+ return ENXIO;
if (!pmf_device_register(self, NULL, neo_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
audio_attach_mi(&neo_hw_if, sc, &sc->dev);
+ return 0;
}
static int
Index: sys/dev/pci/nfsmb.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/nfsmb.c,v
retrieving revision 1.16
diff -u -p -r1.16 nfsmb.c
--- sys/dev/pci/nfsmb.c 3 Feb 2009 16:27:13 -0000 1.16
+++ sys/dev/pci/nfsmb.c 1 May 2009 16:44:08 -0000
@@ -78,11 +78,11 @@ struct nfsmb_softc {
static int nfsmbc_match(device_t, struct cfdata *, void *);
-static void nfsmbc_attach(device_t, device_t, void *);
+static int nfsmbc_attach(device_t, device_t, void *);
static int nfsmbc_print(void *, const char *);
static int nfsmb_match(device_t, struct cfdata *, void *);
-static void nfsmb_attach(device_t, device_t, void *);
+static int nfsmb_attach(device_t, device_t, void *);
static int nfsmb_acquire_bus(void *, int);
static void nfsmb_release_bus(void *, int);
static int nfsmb_exec(
@@ -131,7 +131,7 @@ nfsmbc_match(device_t parent, struct cfd
return 0;
}
-static void
+static int
nfsmbc_attach(device_t parent, device_t self, void *aux)
{
struct nfsmbc_softc *sc = device_private(self);
@@ -184,6 +184,7 @@ nfsmbc_attach(device_t parent, device_t
* are sufficent. */
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static int
@@ -213,7 +214,7 @@ nfsmb_match(device_t parent, struct cfda
return 0;
}
-static void
+static int
nfsmb_attach(device_t parent, device_t self, void *aux)
{
struct nfsmb_softc *sc = device_private(self);
@@ -244,7 +245,7 @@ nfsmb_attach(device_t parent, device_t s
if (bus_space_map(sc->sc_iot, nfsmbcap->nfsmb_addr, NFORCE_SMBSIZE, 0,
&sc->sc_ioh) != 0) {
aprint_error_dev(self, "failed to map SMBus space\n");
- return;
+ return ENXIO;
}
iba.iba_type = I2C_TYPE_SMBUS;
@@ -256,6 +257,7 @@ nfsmb_attach(device_t parent, device_t s
* are sufficent. */
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static int
Index: sys/dev/pci/ohci_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ohci_pci.c,v
retrieving revision 1.43
diff -u -p -r1.43 ohci_pci.c
--- sys/dev/pci/ohci_pci.c 26 Apr 2009 08:54:13 -0000 1.43
+++ sys/dev/pci/ohci_pci.c 1 May 2009 16:44:08 -0000
@@ -78,7 +78,7 @@ ohci_pci_match(device_t parent, cfdata_t
return 0;
}
-static void
+static int
ohci_pci_attach(device_t parent, device_t self, void *aux)
{
struct ohci_pci_softc *sc = device_private(self);
@@ -104,7 +104,7 @@ ohci_pci_attach(device_t parent, device_
&sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
sc->sc.sc_size = 0;
aprint_error_dev(self, "can't map mem space\n");
- return;
+ return ENXIO;
}
/* Disable interrupts, so we don't get any spurious ones. */
@@ -165,7 +165,7 @@ ohci_pci_attach(device_t parent, device_
/* Attach usb device. */
sc->sc.sc_child = config_found(self, &sc->sc.sc_bus, usbctlprint);
- return;
+ return 0;
fail:
if (sc->sc_ih) {
@@ -176,7 +176,7 @@ fail:
bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size);
sc->sc.sc_size = 0;
}
- return;
+ return ENXIO;
}
static int
Index: sys/dev/pci/opl_cmpci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/opl_cmpci.c,v
retrieving revision 1.15
diff -u -p -r1.15 opl_cmpci.c
--- sys/dev/pci/opl_cmpci.c 28 Apr 2008 20:23:55 -0000 1.15
+++ sys/dev/pci/opl_cmpci.c 1 May 2009 16:44:08 -0000
@@ -67,7 +67,7 @@ opl_cmpci_match(device_t parent, cfdata_
return opl_match(ssc->sc_iot, ssc->sc_ioh, CMPCI_REG_FM_BASE);
}
-static void
+static int
opl_cmpci_attach(device_t parent, device_t self, void *aux)
{
struct cmpci_softc *ssc = device_private(parent);
@@ -80,6 +80,7 @@ opl_cmpci_attach(device_t parent, device
strcpy(sc->syn.name, "CMPCI ");
opl_attach(sc);
+ return 0;
}
CFATTACH_DECL_NEW(opl_cmpci, sizeof (struct opl_softc),
Index: sys/dev/pci/opl_eso.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/opl_eso.c,v
retrieving revision 1.16
diff -u -p -r1.16 opl_eso.c
--- sys/dev/pci/opl_eso.c 28 Apr 2008 20:23:55 -0000 1.16
+++ sys/dev/pci/opl_eso.c 1 May 2009 16:44:08 -0000
@@ -66,7 +66,7 @@ opl_eso_match(device_t parent, cfdata_t
return (1);
}
-static void
+static int
opl_eso_attach(device_t parent, device_t self, void *aux)
{
struct eso_softc *esc = device_private(parent);
@@ -81,6 +81,7 @@ opl_eso_attach(device_t parent, device_t
sc->spkrarg = 0;*/
opl_attach(sc);
+ return 0;
}
CFATTACH_DECL_NEW(opl_eso, sizeof (struct opl_softc),
Index: sys/dev/pci/opl_fms.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/opl_fms.c,v
retrieving revision 1.15
diff -u -p -r1.15 opl_fms.c
--- sys/dev/pci/opl_fms.c 28 Apr 2008 20:23:55 -0000 1.15
+++ sys/dev/pci/opl_fms.c 1 May 2009 16:44:08 -0000
@@ -67,7 +67,7 @@ opl_fms_match(device_t parent, cfdata_t
return (1);
}
-static void
+static int
opl_fms_attach(device_t parent, device_t self, void *aux)
{
struct fms_softc *ssc = device_private(parent);
@@ -82,6 +82,7 @@ opl_fms_attach(device_t parent, device_t
sc->spkrarg = 0;*/
opl_attach(sc);
+ return 0;
}
CFATTACH_DECL_NEW(opl_fms, sizeof (struct opl_softc),
Index: sys/dev/pci/opl_sv.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/opl_sv.c,v
retrieving revision 1.14
diff -u -p -r1.14 opl_sv.c
--- sys/dev/pci/opl_sv.c 28 Apr 2008 20:23:55 -0000 1.14
+++ sys/dev/pci/opl_sv.c 1 May 2009 16:44:08 -0000
@@ -66,7 +66,7 @@ opl_sv_match(device_t parent, cfdata_t m
return (1);
}
-static void
+static int
opl_sv_attach(device_t parent, device_t self, void *aux)
{
struct sv_softc *ssc = device_private(parent);
@@ -81,6 +81,7 @@ opl_sv_attach(device_t parent, device_t
sc->spkrarg = 0;*/
opl_attach(sc);
+ return 0;
}
CFATTACH_DECL_NEW(opl_sv, sizeof (struct opl_softc),
Index: sys/dev/pci/optiide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/optiide.c,v
retrieving revision 1.17
diff -u -p -r1.17 optiide.c
--- sys/dev/pci/optiide.c 28 Apr 2008 20:23:55 -0000 1.17
+++ sys/dev/pci/optiide.c 1 May 2009 16:44:08 -0000
@@ -45,7 +45,7 @@ static void opti_chip_map(struct pciide_
static void opti_setup_channel(struct ata_channel*);
static int optiide_match(device_t, cfdata_t, void *);
-static void optiide_attach(device_t, device_t, void *);
+static int optiide_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(optiide, sizeof(struct pciide_softc),
optiide_match, optiide_attach, NULL, NULL);
@@ -87,7 +87,7 @@ optiide_match(device_t parent, cfdata_t
return (0);
}
-static void
+static int
optiide_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -97,7 +97,7 @@ optiide_attach(device_t parent, device_t
pciide_common_attach(sc, pa,
pciide_lookup_product(pa->pa_id, pciide_opti_products));
-
+ return 0;
}
static void
Index: sys/dev/pci/pccbb.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pccbb.c,v
retrieving revision 1.185
diff -u -p -r1.185 pccbb.c
--- sys/dev/pci/pccbb.c 2 Apr 2009 00:09:33 -0000 1.185
+++ sys/dev/pci/pccbb.c 1 May 2009 16:44:10 -0000
@@ -98,7 +98,7 @@ delay_ms(int millis, void *param)
}
int pcicbbmatch(device_t, struct cfdata *, void *);
-void pccbbattach(device_t, device_t, void *);
+int pccbbattach(device_t, device_t, void *);
int pccbbdetach(device_t, int);
int pccbbintr(void *);
static void pci113x_insert(void *);
@@ -390,7 +390,7 @@ cb_chipset(u_int32_t pci_id, int *flagp)
return (yc->yc_chiptype);
}
-void
+int
pccbbattach(device_t parent, device_t self, void *aux)
{
struct pccbb_softc *sc = device_private(self);
@@ -527,6 +527,7 @@ pccbbattach(device_t parent, device_t se
aprint_error_dev(self, "couldn't establish power handler\n");
config_defer(self, pccbb_pci_callback);
+ return 0;
}
int
Index: sys/dev/pci/pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pci.c,v
retrieving revision 1.122
diff -u -p -r1.122 pci.c
--- sys/dev/pci/pci.c 2 Apr 2009 00:09:33 -0000 1.122
+++ sys/dev/pci/pci.c 1 May 2009 16:44:10 -0000
@@ -131,13 +131,14 @@ pcimatch(device_t parent, cfdata_t cf, v
return (1);
}
-void
+int
pciattach(device_t parent, device_t self, void *aux)
{
struct pcibus_attach_args *pba = aux;
struct pci_softc *sc = device_private(self);
int io_enabled, mem_enabled, mrl_enabled, mrm_enabled, mwi_enabled;
const char *sep = "";
+ int error = 0;
static const int wildcard[PCICF_NLOCS] = {
PCICF_DEV_DEFAULT, PCICF_FUNCTION_DEFAULT
};
@@ -157,6 +158,7 @@ pciattach(device_t parent, device_t self
if (io_enabled == 0 && mem_enabled == 0) {
aprint_error_dev(self, "no spaces enabled!\n");
+ error = ENXIO;
goto fail;
}
@@ -207,6 +209,7 @@ do {
\
fail:
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return error;
}
int
Index: sys/dev/pci/pciide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pciide.c,v
retrieving revision 1.216
diff -u -p -r1.216 pciide.c
--- sys/dev/pci/pciide.c 18 Mar 2008 20:46:37 -0000 1.216
+++ sys/dev/pci/pciide.c 1 May 2009 16:44:10 -0000
@@ -84,7 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: pciide.c,v 1
#include <dev/pci/pciidevar.h>
int pciide_match(device_t, cfdata_t, void *);
-void pciide_attach(device_t, device_t, void *);
+int pciide_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(pciide, sizeof(struct pciide_softc),
pciide_match, pciide_attach, NULL, NULL);
@@ -107,7 +107,7 @@ pciide_match(device_t parent, cfdata_t m
return (0);
}
-void
+int
pciide_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -116,4 +116,5 @@ pciide_attach(device_t parent, device_t
sc->sc_wdcdev.sc_atac.atac_dev = self;
pciide_common_attach(sc, pa, NULL);
+ return 0;
}
Index: sys/dev/pci/pcivar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pcivar.h,v
retrieving revision 1.83
diff -u -p -r1.83 pcivar.h
--- sys/dev/pci/pcivar.h 22 Jul 2008 04:52:19 -0000 1.83
+++ sys/dev/pci/pcivar.h 1 May 2009 16:44:10 -0000
@@ -262,7 +262,7 @@ void pci_disable_retry(pci_chipset_tag_t
* Device abstraction for inheritance by elanpci(4), for example.
*/
int pcimatch(device_t, cfdata_t, void *);
-void pciattach(device_t, device_t, void *);
+int pciattach(device_t, device_t, void *);
int pcidetach(device_t, int);
void pcidevdetached(device_t, device_t);
int pcirescan(device_t, const char *, const int *);
Index: sys/dev/pci/pcscp.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pcscp.c,v
retrieving revision 1.44
diff -u -p -r1.44 pcscp.c
--- sys/dev/pci/pcscp.c 28 Aug 2008 16:47:10 -0000 1.44
+++ sys/dev/pci/pcscp.c 1 May 2009 16:44:10 -0000
@@ -99,7 +99,7 @@ struct pcscp_softc {
static int pcscp_match(device_t, cfdata_t, void *);
-static void pcscp_attach(device_t, device_t, void *);
+static int pcscp_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(pcscp, sizeof(struct pcscp_softc),
pcscp_match, pcscp_attach, NULL, NULL);
@@ -150,7 +150,7 @@ pcscp_match(device_t parent, cfdata_t cf
/*
* Attach this instance, and then all the sub-devices
*/
-static void
+static int
pcscp_attach(device_t parent, device_t self, void *aux)
{
struct pcscp_softc *esc = device_private(self);
@@ -173,7 +173,7 @@ pcscp_attach(device_t parent, device_t s
if (pci_mapreg_map(pa, IO_MAP_REG, PCI_MAPREG_TYPE_IO, 0,
&iot, &ioh, NULL, NULL)) {
aprint_error(": unable to map registers\n");
- return;
+ return ENXIO;
}
sc->sc_glue = &pcscp_glue;
@@ -244,7 +244,7 @@ pcscp_attach(device_t parent, device_t s
if (bus_dmamap_create(esc->sc_dmat, MAXPHYS, MDL_SIZE, MDL_SEG_SIZE,
MDL_SEG_SIZE, BUS_DMA_NOWAIT, &esc->sc_xfermap)) {
aprint_error(": can't create DMA maps\n");
- return;
+ return ENXIO;
}
/*
@@ -309,7 +309,7 @@ pcscp_attach(device_t parent, device_t s
/* Turn on target selection using the `DMA' method */
sc->sc_features |= NCR_F_DMASELECT;
- return;
+ return 0;
fail_4:
bus_dmamap_unload(esc->sc_dmat, esc->sc_mdldmap);
@@ -322,6 +322,7 @@ pcscp_attach(device_t parent, device_t s
bus_dmamem_free(esc->sc_dmat, &seg, rseg);
fail_0:
bus_dmamap_destroy(esc->sc_dmat, esc->sc_xfermap);
+ return ENXIO;
}
/*
Index: sys/dev/pci/pdcide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pdcide.c,v
retrieving revision 1.26
diff -u -p -r1.26 pdcide.c
--- sys/dev/pci/pdcide.c 18 Mar 2008 20:46:37 -0000 1.26
+++ sys/dev/pci/pdcide.c 1 May 2009 16:44:10 -0000
@@ -50,7 +50,7 @@ static void pdc20262_dma_start(void *, i
static int pdc20262_dma_finish(void *, int, int, int);
static int pdcide_match(device_t, cfdata_t, void *);
-static void pdcide_attach(device_t, device_t, void *);
+static int pdcide_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(pdcide, sizeof(struct pciide_softc),
pdcide_match, pdcide_attach, NULL, NULL);
@@ -130,7 +130,7 @@ pdcide_match(device_t parent, cfdata_t m
return (0);
}
-static void
+static int
pdcide_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -140,7 +140,7 @@ pdcide_attach(device_t parent, device_t
pciide_common_attach(sc, pa,
pciide_lookup_product(pa->pa_id, pciide_promise_products));
-
+ return 0;
}
/* Macros to test product */
Index: sys/dev/pci/pdcsata.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pdcsata.c,v
retrieving revision 1.16
diff -u -p -r1.16 pdcsata.c
--- sys/dev/pci/pdcsata.c 18 Mar 2008 20:46:37 -0000 1.16
+++ sys/dev/pci/pdcsata.c 1 May 2009 16:44:10 -0000
@@ -72,7 +72,7 @@ static int pdcsata_pci_intr(void *);
static void pdcsata_do_reset(struct ata_channel *, int);
static int pdcsata_match(device_t, cfdata_t, void *);
-static void pdcsata_attach(device_t, device_t, void *);
+static int pdcsata_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(pdcsata, sizeof(struct pciide_softc),
pdcsata_match, pdcsata_attach, NULL, NULL);
@@ -212,7 +212,7 @@ pdcsata_match(device_t parent, cfdata_t
return (0);
}
-static void
+static int
pdcsata_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -222,6 +222,7 @@ pdcsata_attach(device_t parent, device_t
pciide_common_attach(sc, pa,
pciide_lookup_product(pa->pa_id, pciide_pdcsata_products));
+ return 0;
}
static void
Index: sys/dev/pci/piixide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/piixide.c,v
retrieving revision 1.50
diff -u -p -r1.50 piixide.c
--- sys/dev/pci/piixide.c 14 Mar 2009 15:36:19 -0000 1.50
+++ sys/dev/pci/piixide.c 1 May 2009 16:44:10 -0000
@@ -53,7 +53,7 @@ static int piix_dma_init(void *, int, in
static bool piixide_resume(device_t PMF_FN_PROTO);
static bool piixide_suspend(device_t PMF_FN_PROTO);
static int piixide_match(device_t, cfdata_t, void *);
-static void piixide_attach(device_t, device_t, void *);
+static int piixide_attach(device_t, device_t, void *);
static const struct pciide_product_desc pciide_intel_products[] = {
{ PCI_PRODUCT_INTEL_82092AA,
@@ -314,7 +314,7 @@ piixide_match(device_t parent, cfdata_t
return (0);
}
-static void
+static int
piixide_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -327,6 +327,7 @@ piixide_attach(device_t parent, device_t
if (!pmf_device_register(self, piixide_suspend, piixide_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static bool
Index: sys/dev/pci/piixpm.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/piixpm.c,v
retrieving revision 1.29
diff -u -p -r1.29 piixpm.c
--- sys/dev/pci/piixpm.c 18 Mar 2009 16:00:19 -0000 1.29
+++ sys/dev/pci/piixpm.c 1 May 2009 16:44:10 -0000
@@ -80,7 +80,7 @@ struct piixpm_softc {
};
static int piixpm_match(device_t, cfdata_t, void *);
-static void piixpm_attach(device_t, device_t, void *);
+static int piixpm_attach(device_t, device_t, void *);
static bool piixpm_suspend(device_t PMF_FN_PROTO);
static bool piixpm_resume(device_t PMF_FN_PROTO);
@@ -131,7 +131,7 @@ piixpm_match(device_t parent, cfdata_t m
return 0;
}
-static void
+static int
piixpm_attach(device_t parent, device_t self, void *aux)
{
struct piixpm_softc *sc = device_private(self);
@@ -191,7 +191,7 @@ piixpm_attach(device_t parent, device_t
nopowermanagement:
if ((conf & PIIX_SMB_HOSTC_HSTEN) == 0) {
aprint_normal_dev(self, "SMBus disabled\n");
- return;
+ return ENXIO;
}
/* Map I/O space */
@@ -200,7 +200,7 @@ nopowermanagement:
if (bus_space_map(sc->sc_smb_iot, PCI_MAPREG_IO_ADDR(base),
PIIX_SMB_SIZE, 0, &sc->sc_smb_ioh)) {
aprint_error_dev(self, "can't map smbus I/O space\n");
- return;
+ return ENXIO;
}
sc->sc_poll = 1;
@@ -236,7 +236,7 @@ nopowermanagement:
iba.iba_tag = &sc->sc_i2c_tag;
config_found_ia(self, "i2cbus", &iba, iicbus_print);
- return;
+ return 0;
}
static bool
Index: sys/dev/pci/ppb.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ppb.c,v
retrieving revision 1.40
diff -u -p -r1.40 ppb.c
--- sys/dev/pci/ppb.c 2 Apr 2009 00:09:33 -0000 1.40
+++ sys/dev/pci/ppb.c 1 May 2009 16:44:11 -0000
@@ -94,7 +94,7 @@ ppb_fix_pcix(device_t self)
}
}
-static void
+static int
ppbattach(device_t parent, device_t self, void *aux)
{
struct ppb_softc *sc = device_private(self);
@@ -117,7 +117,7 @@ ppbattach(device_t parent, device_t self
if (PPB_BUSINFO_SECONDARY(busdata) == 0) {
aprint_normal_dev(self, "not configured by system firmware\n");
- return;
+ return ENXIO;
}
ppb_fix_pcix(self);
@@ -155,6 +155,7 @@ ppbattach(device_t parent, device_t self
pba.pba_intrtag = pa->pa_intrtag;
config_found_ia(self, "pcibus", &pba, pcibusprint);
+ return 0;
}
static int
Index: sys/dev/pci/puc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/puc.c,v
retrieving revision 1.31
diff -u -p -r1.31 puc.c
--- sys/dev/pci/puc.c 9 Jul 2008 14:46:15 -0000 1.31
+++ sys/dev/pci/puc.c 1 May 2009 16:44:11 -0000
@@ -137,7 +137,7 @@ puc_match(device_t parent, cfdata_t matc
return (0);
}
-static void
+static int
puc_attach(device_t parent, device_t self, void *aux)
{
struct puc_softc *sc = device_private(self);
@@ -173,7 +173,7 @@ puc_attach(device_t parent, device_t sel
printf("%s: and report the result with send-pr\n",
device_xname(self));
#endif
- return;
+ return ENXIO;
}
printf(": %s (", sc->sc_desc->name);
@@ -227,7 +227,7 @@ puc_attach(device_t parent, device_t sel
/* Map interrupt. */
if (pci_intr_map(pa, &intrhandle)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
/*
* XXX the sub-devices establish the interrupts, for the
@@ -301,6 +301,7 @@ puc_attach(device_t parent, device_t sel
sc->sc_ports[i].dev = config_found_sm_loc(self, "puc", locs,
&paa, puc_print, config_stdsubmatch);
}
+ return 0;
}
CFATTACH_DECL_NEW(puc, sizeof(struct puc_softc),
Index: sys/dev/pci/satalink.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/satalink.c,v
retrieving revision 1.38
diff -u -p -r1.38 satalink.c
--- sys/dev/pci/satalink.c 28 Apr 2008 20:23:55 -0000 1.38
+++ sys/dev/pci/satalink.c 1 May 2009 16:44:11 -0000
@@ -257,7 +257,7 @@ static const struct {
#define IDEDMA_CMD_INT_STEER (1U << 1)
static int satalink_match(device_t, cfdata_t, void *);
-static void satalink_attach(device_t, device_t, void *);
+static int satalink_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(satalink, sizeof(struct pciide_softc),
satalink_match, satalink_attach, NULL, NULL);
@@ -307,7 +307,7 @@ satalink_match(device_t parent, cfdata_t
return (0);
}
-static void
+static int
satalink_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -317,7 +317,7 @@ satalink_attach(device_t parent, device_
pciide_common_attach(sc, pa,
pciide_lookup_product(pa->pa_id, pciide_satalink_products));
-
+ return 0;
}
static inline uint32_t
Index: sys/dev/pci/sdhc_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/sdhc_pci.c,v
retrieving revision 1.1
diff -u -p -r1.1 sdhc_pci.c
--- sys/dev/pci/sdhc_pci.c 21 Apr 2009 03:00:29 -0000 1.1
+++ sys/dev/pci/sdhc_pci.c 1 May 2009 16:44:11 -0000
@@ -56,7 +56,7 @@ struct sdhc_pci_softc {
};
static int sdhc_pci_match(device_t, cfdata_t, void *);
-static void sdhc_pci_attach(device_t, device_t, void *);
+static int sdhc_pci_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(sdhc_pci, sizeof(struct sdhc_pci_softc),
sdhc_pci_match, sdhc_pci_attach, NULL, NULL);
@@ -162,7 +162,7 @@ sdhc_pci_match(device_t parent, cfdata_t
return 0;
}
-static void
+static int
sdhc_pci_attach(device_t parent, device_t self, void *aux)
{
struct sdhc_pci_softc *sc = device_private(self);
@@ -265,11 +265,12 @@ sdhc_pci_attach(device_t parent, device_
aprint_error_dev(self, "couldn't establish powerhook\n");
}
- return;
+ return 0;
err:
if (sc->sc.sc_host != NULL)
free(sc->sc.sc_host, M_DEVBUF);
+ return ENXIO;
}
/* TI specific register */
Index: sys/dev/pci/siisata_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/siisata_pci.c,v
retrieving revision 1.2
diff -u -p -r1.2 siisata_pci.c
--- sys/dev/pci/siisata_pci.c 16 Dec 2008 02:46:47 -0000 1.2
+++ sys/dev/pci/siisata_pci.c 1 May 2009 16:44:11 -0000
@@ -79,7 +79,7 @@ struct siisata_pci_softc {
};
static int siisata_pci_match(device_t, cfdata_t, void *);
-static void siisata_pci_attach(device_t, device_t, void *);
+static int siisata_pci_attach(device_t, device_t, void *);
static bool siisata_pci_resume(device_t PMF_FN_PROTO);
static const struct siisata_pci_product {
@@ -148,7 +148,7 @@ siisata_pci_resume(device_t dv PMF_FN_AR
return true;
}
-static void
+static int
siisata_pci_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -196,7 +196,7 @@ siisata_pci_attach(device_t parent, devi
} else {
aprint_error("%s: unable to map device global registers\n",
SIISATANAME(sc));
- return;
+ return ENXIO;
}
/* map bar1 */
@@ -221,7 +221,7 @@ siisata_pci_attach(device_t parent, devi
bus_space_unmap(sc->sc_grt, sc->sc_grh, grsize);
aprint_error("%s: unable to map device port registers\n",
SIISATANAME(sc));
- return;
+ return ENXIO;
}
if (pci_dma64_available(pa)) {
@@ -238,7 +238,7 @@ siisata_pci_attach(device_t parent, devi
bus_space_unmap(sc->sc_grt, sc->sc_grh, grsize);
bus_space_unmap(sc->sc_prt, sc->sc_prh, prsize);
aprint_error("%s: couldn't map interrupt\n", SIISATANAME(sc));
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, intrhandle);
ih = pci_intr_establish(pa->pa_pc, intrhandle,
@@ -248,7 +248,7 @@ siisata_pci_attach(device_t parent, devi
bus_space_unmap(sc->sc_prt, sc->sc_prh, prsize);
aprint_error("%s: couldn't establish interrupt"
"at %s\n", SIISATANAME(sc), intrstr);
- return;
+ return ENXIO;
}
aprint_normal("%s: interrupting at %s\n", SIISATANAME(sc),
intrstr ? intrstr : "unknown interrupt");
@@ -303,5 +303,6 @@ siisata_pci_attach(device_t parent, devi
if (!pmf_device_register(self, NULL, siisata_pci_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
Index: sys/dev/pci/siop_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/siop_pci.c,v
retrieving revision 1.21
diff -u -p -r1.21 siop_pci.c
--- sys/dev/pci/siop_pci.c 16 Nov 2006 01:33:10 -0000 1.21
+++ sys/dev/pci/siop_pci.c 1 May 2009 16:44:11 -0000
@@ -70,7 +70,7 @@ siop_pci_match(struct device *parent, st
return 0;
}
-static void
+static int
siop_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -78,9 +78,10 @@ siop_pci_attach(struct device *parent, s
if (siop_pci_attach_common(&sc->siop_pci, &sc->siop.sc_c,
pa, siop_intr) == 0)
- return;
+ return ENXIO;
siop_attach(&sc->siop);
+ return 0;
}
CFATTACH_DECL(siop_pci, sizeof(struct siop_pci_softc),
Index: sys/dev/pci/siside.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/siside.c,v
retrieving revision 1.24
diff -u -p -r1.24 siside.c
--- sys/dev/pci/siside.c 12 Mar 2009 15:02:42 -0000 1.24
+++ sys/dev/pci/siside.c 1 May 2009 16:44:11 -0000
@@ -50,7 +50,7 @@ static int sis_hostbr_match(struct pci_
static int sis_south_match(struct pci_attach_args *);
static int siside_match(device_t, cfdata_t, void *);
-static void siside_attach(device_t, device_t, void *);
+static int siside_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(siside, sizeof(struct pciide_softc),
siside_match, siside_attach, NULL, NULL);
@@ -95,7 +95,7 @@ siside_match(device_t parent, cfdata_t m
return (0);
}
-static void
+static int
siside_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -114,6 +114,7 @@ siside_attach(device_t parent, device_t
csr &= ~PCI_COMMAND_INTERRUPT_DISABLE;
pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, csr);
}
+ return 0;
}
static struct sis_hostbr_type {
Index: sys/dev/pci/slide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/slide.c,v
retrieving revision 1.20
diff -u -p -r1.20 slide.c
--- sys/dev/pci/slide.c 28 Apr 2008 20:23:55 -0000 1.20
+++ sys/dev/pci/slide.c 1 May 2009 16:44:11 -0000
@@ -45,7 +45,7 @@ static void sl82c105_chip_map(struct pci
static void sl82c105_setup_channel(struct ata_channel*);
static int slide_match(device_t, cfdata_t, void *);
-static void slide_attach(device_t, device_t, void *);
+static int slide_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(slide, sizeof(struct pciide_softc),
slide_match, slide_attach, NULL, NULL);
@@ -92,7 +92,7 @@ slide_match(device_t parent, cfdata_t ma
return (0);
}
-static void
+static int
slide_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -108,6 +108,7 @@ slide_attach(device_t parent, device_t s
if (pp == NULL)
panic("slide_attach");
pciide_common_attach(sc, pa, pp);
+ return 0;
}
static int
Index: sys/dev/pci/sv.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/sv.c,v
retrieving revision 1.39
diff -u -p -r1.39 sv.c
--- sys/dev/pci/sv.c 28 Apr 2008 20:23:55 -0000 1.39
+++ sys/dev/pci/sv.c 1 May 2009 16:44:11 -0000
@@ -112,7 +112,7 @@ int svdebug = 0;
#endif
static int sv_match(struct device *, struct cfdata *, void *);
-static void sv_attach(struct device *, struct device *, void *);
+static int sv_attach(struct device *, struct device *, void *);
static int sv_intr(void *);
struct sv_dma {
@@ -341,7 +341,7 @@ sv_defer(struct device *self)
sc->sc_dmaset = 1;
}
-static void
+static int
sv_attach(struct device *parent, struct device *self, void *aux)
{
struct sv_softc *sc;
@@ -365,19 +365,19 @@ sv_attach(struct device *parent, struct
PCI_MAPREG_TYPE_IO, 0,
&sc->sc_iot, &sc->sc_ioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "can't map enhanced i/o space\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, SV_FM_PORTBASE_SLOT,
PCI_MAPREG_TYPE_IO, 0,
&sc->sc_opliot, &sc->sc_oplioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "can't map FM i/o space\n");
- return;
+ return ENXIO;
}
if (pci_mapreg_map(pa, SV_MIDI_PORTBASE_SLOT,
PCI_MAPREG_TYPE_IO, 0,
&sc->sc_midiiot, &sc->sc_midiioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dev, "can't map MIDI i/o space\n");
- return;
+ return ENXIO;
}
DPRINTF(("sv: IO ports: enhanced=0x%x, OPL=0x%x, MIDI=0x%x\n",
(int)sc->sc_ioh, (int)sc->sc_oplioh, (int)sc->sc_midiioh));
@@ -437,7 +437,7 @@ sv_attach(struct device *parent, struct
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_AUDIO, sv_intr, sc);
@@ -446,7 +446,7 @@ sv_attach(struct device *parent, struct
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
printf("%s: interrupting at %s\n", device_xname(&sc->sc_dev), intrstr);
printf("%s: rev %d", device_xname(&sc->sc_dev),
@@ -468,6 +468,7 @@ sv_attach(struct device *parent, struct
sc->sc_pa = *pa; /* for deferred setup */
config_defer(self, sv_defer);
+ return 0;
}
#ifdef AUDIO_DEBUG
Index: sys/dev/pci/svwsata.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/svwsata.c,v
retrieving revision 1.10
diff -u -p -r1.10 svwsata.c
--- sys/dev/pci/svwsata.c 18 Mar 2008 20:46:37 -0000 1.10
+++ sys/dev/pci/svwsata.c 1 May 2009 16:44:11 -0000
@@ -32,7 +32,7 @@ __KERNEL_RCSID(0, "$NetBSD: svwsata.c,v
#include <dev/pci/pciide_svwsata_reg.h>
static int svwsata_match(device_t, cfdata_t, void *);
-static void svwsata_attach(device_t, device_t, void *);
+static int svwsata_attach(device_t, device_t, void *);
static void svwsata_chip_map(struct pciide_softc *, struct pci_attach_args *);
static void svwsata_mapreg_dma(struct pciide_softc *, struct pci_attach_args
*);
@@ -87,7 +87,7 @@ svwsata_match(device_t parent, cfdata_t
return (0);
}
-static void
+static int
svwsata_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -97,6 +97,7 @@ svwsata_attach(device_t parent, device_t
pciide_common_attach(sc, pa,
pciide_lookup_product(pa->pa_id, pciide_svwsata_products));
+ return 0;
}
static void
Index: sys/dev/pci/trm.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/trm.c,v
retrieving revision 1.30
diff -u -p -r1.30 trm.c
--- sys/dev/pci/trm.c 14 May 2008 13:29:29 -0000 1.30
+++ sys/dev/pci/trm.c 1 May 2009 16:44:12 -0000
@@ -333,7 +333,7 @@ struct trm_softc {
#define SCSI_SEL_TIMEOUT 0xFF /* Selection Timeout */
static int trm_match(device_t, cfdata_t, void *);
-static void trm_attach(device_t, device_t, void *);
+static int trm_attach(device_t, device_t, void *);
static int trm_init(struct trm_softc *);
@@ -404,7 +404,7 @@ trm_match(device_t parent, cfdata_t cf,
/*
* attach and init a host adapter
*/
-static void
+static int
trm_attach(device_t parent, device_t self, void *aux)
{
struct trm_softc *sc = device_private(self);
@@ -435,7 +435,7 @@ trm_attach(device_t parent, device_t sel
if (pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_IO, 0,
&iot, &ioh, NULL, NULL)) {
aprint_error(": unable to map registers\n");
- return;
+ return ENXIO;
}
/*
* test checksum of eeprom.. & initialize softc...
@@ -448,7 +448,7 @@ trm_attach(device_t parent, device_t sel
/*
* Error during initialization!
*/
- return;
+ return ENXIO;
}
/*
* Now try to attach all the sub-devices
@@ -466,7 +466,7 @@ trm_attach(device_t parent, device_t sel
*/
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
@@ -475,7 +475,7 @@ trm_attach(device_t parent, device_t sel
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
- return;
+ return ENXIO;
}
if (intrstr != NULL)
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -495,6 +495,7 @@ trm_attach(device_t parent, device_t sel
sc->sc_channel.chan_id = sc->sc_id;
config_found(self, &sc->sc_channel, scsiprint);
+ return 0;
}
/*
Index: sys/dev/pci/twa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/twa.c,v
retrieving revision 1.28
diff -u -p -r1.28 twa.c
--- sys/dev/pci/twa.c 27 Jul 2008 13:10:11 -0000 1.28
+++ sys/dev/pci/twa.c 1 May 2009 16:44:13 -0000
@@ -116,7 +116,7 @@ static int twa_find_aen(struct twa_softc
static uint16_t twa_enqueue_aen(struct twa_softc *sc,
struct twa_command_header *);
-static void twa_attach(struct device *, struct device *, void *);
+static int twa_attach(struct device *, struct device *, void *);
static void twa_shutdown(void *);
static int twa_init_connection(struct twa_softc *, uint16_t, uint32_t,
uint16_t, uint16_t, uint16_t, uint16_t,
uint16_t *,
@@ -1484,7 +1484,7 @@ twa_setup(struct twa_softc *sc)
void *twa_sdh;
-static void
+static int
twa_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa;
@@ -1514,7 +1514,7 @@ twa_attach(struct device *parent, struct
if (pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_IO, 0,
&sc->twa_bus_iot, &sc->twa_bus_ioh, NULL, NULL)) {
aprint_error_dev(&sc->twa_dv, "can't map i/o space\n");
- return;
+ return ENXIO;
}
} else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_3WARE_9550) {
sc->sc_nunits = TWA_MAX_UNITS;
@@ -1523,7 +1523,7 @@ twa_attach(struct device *parent, struct
PCI_MAPREG_MEM_TYPE_64BIT, 0, &sc->twa_bus_iot,
&sc->twa_bus_ioh, NULL, NULL)) {
aprint_error_dev(&sc->twa_dv, "can't map mem space\n");
- return;
+ return ENXIO;
}
} else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_3WARE_9650) {
sc->sc_nunits = TWA_9650_MAX_UNITS;
@@ -1532,7 +1532,7 @@ twa_attach(struct device *parent, struct
PCI_MAPREG_MEM_TYPE_64BIT, 0, &sc->twa_bus_iot,
&sc->twa_bus_ioh, NULL, NULL)) {
aprint_error_dev(&sc->twa_dv, "can't map mem space\n");
- return;
+ return ENXIO;
}
} else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_3WARE_9690) {
sc->sc_nunits = TWA_9690_MAX_UNITS;
@@ -1541,14 +1541,14 @@ twa_attach(struct device *parent, struct
PCI_MAPREG_MEM_TYPE_64BIT, 0, &sc->twa_bus_iot,
&sc->twa_bus_ioh, NULL, NULL)) {
aprint_error_dev(&sc->twa_dv, "can't map mem space\n");
- return;
+ return ENXIO;
}
} else {
sc->sc_nunits = 0;
use_64bit = false;
aprint_error_dev(&sc->twa_dv, "product id 0x%02x not
recognized\n",
PCI_PRODUCT(pa->pa_id));
- return;
+ return ENXIO;
}
if (pci_dma64_available(pa) && use_64bit) {
@@ -1568,7 +1568,7 @@ twa_attach(struct device *parent, struct
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->twa_dv, "can't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
@@ -1577,7 +1577,7 @@ twa_attach(struct device *parent, struct
aprint_error_dev(&sc->twa_dv, "can't establish interrupt%s%s\n",
(intrstr) ? " at " : "",
(intrstr) ? intrstr : "");
- return;
+ return ENXIO;
}
if (intrstr != NULL)
@@ -1596,7 +1596,7 @@ twa_attach(struct device *parent, struct
CTL_HW, CTL_EOL) != 0) {
aprint_error_dev(&sc->twa_dv, "could not create %s sysctl
node\n",
ctlnames[CTL_HW].ctl_name);
- return;
+ return ENXIO;
}
if (sysctl_createv(NULL, 0, NULL, &node,
0, CTLTYPE_NODE, device_xname(&sc->twa_dv),
@@ -1606,7 +1606,7 @@ twa_attach(struct device *parent, struct
aprint_error_dev(&sc->twa_dv, "could not create %s.%s sysctl
node\n",
ctlnames[CTL_HW].ctl_name,
device_xname(&sc->twa_dv));
- return;
+ return ENXIO;
}
if ((i = sysctl_createv(NULL, 0, NULL, NULL,
0, CTLTYPE_STRING, "driver_version",
@@ -1617,10 +1617,10 @@ twa_attach(struct device *parent, struct
aprint_error_dev(&sc->twa_dv, "could not create
%s.%s.driver_version sysctl\n",
ctlnames[CTL_HW].ctl_name,
device_xname(&sc->twa_dv));
- return;
+ return ENXIO;
}
- return;
+ return 0;
}
static void
Index: sys/dev/pci/twe.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/twe.c,v
retrieving revision 1.87
diff -u -p -r1.87 twe.c
--- sys/dev/pci/twe.c 8 Jun 2008 12:43:52 -0000 1.87
+++ sys/dev/pci/twe.c 1 May 2009 16:44:13 -0000
@@ -101,7 +101,7 @@ static void twe_aen_handler(struct twe_c
static void twe_aen_enqueue(struct twe_softc *sc, uint16_t, int);
static uint16_t twe_aen_dequeue(struct twe_softc *);
-static void twe_attach(struct device *, struct device *, void *);
+static int twe_attach(struct device *, struct device *, void *);
static int twe_init_connection(struct twe_softc *);
static int twe_intr(void *);
static int twe_match(struct device *, struct cfdata *, void *);
@@ -306,7 +306,7 @@ twe_match(struct device *parent, struct
*
* XXX This doesn't fail gracefully.
*/
-static void
+static int
twe_attach(struct device *parent, struct device *self, void *aux)
{
struct pci_attach_args *pa;
@@ -337,7 +337,7 @@ twe_attach(struct device *parent, struct
if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
&sc->sc_iot, &sc->sc_ioh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dv, "can't map i/o space\n");
- return;
+ return ENXIO;
}
/* Enable the device. */
@@ -348,7 +348,7 @@ twe_attach(struct device *parent, struct
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dv, "can't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
@@ -357,7 +357,7 @@ twe_attach(struct device *parent, struct
aprint_error_dev(&sc->sc_dv, "can't establish interrupt%s%s\n",
(intrstr) ? " at " : "",
(intrstr) ? intrstr : "");
- return;
+ return ENXIO;
}
if (intrstr != NULL)
@@ -372,32 +372,32 @@ twe_attach(struct device *parent, struct
if ((rv = bus_dmamem_alloc(sc->sc_dmat, size, PAGE_SIZE, 0, &seg, 1,
&rseg, BUS_DMA_NOWAIT)) != 0) {
aprint_error_dev(&sc->sc_dv, "unable to allocate commands, rv =
%d\n", rv);
- return;
+ return ENXIO;
}
if ((rv = bus_dmamem_map(sc->sc_dmat, &seg, rseg, size,
(void **)&sc->sc_cmds,
BUS_DMA_NOWAIT | BUS_DMA_COHERENT)) != 0) {
aprint_error_dev(&sc->sc_dv, "unable to map commands, rv =
%d\n", rv);
- return;
+ return ENXIO;
}
if ((rv = bus_dmamap_create(sc->sc_dmat, size, size, 1, 0,
BUS_DMA_NOWAIT, &sc->sc_dmamap)) != 0) {
aprint_error_dev(&sc->sc_dv, "unable to create command DMA map,
rv = %d\n", rv);
- return;
+ return ENXIO;
}
if ((rv = bus_dmamap_load(sc->sc_dmat, sc->sc_dmamap, sc->sc_cmds,
size, NULL, BUS_DMA_NOWAIT)) != 0) {
aprint_error_dev(&sc->sc_dv, "unable to load command DMA map,
rv = %d\n", rv);
- return;
+ return ENXIO;
}
ccb = malloc(sizeof(*ccb) * TWE_MAX_QUEUECNT, M_DEVBUF, M_NOWAIT);
if (ccb == NULL) {
aprint_error_dev(&sc->sc_dv, "unable to allocate memory for
ccbs\n");
- return;
+ return ENXIO;
}
sc->sc_cmds_paddr = sc->sc_dmamap->dm_segs[0].ds_addr;
@@ -418,7 +418,7 @@ twe_attach(struct device *parent, struct
&ccb->ccb_dmamap_xfer);
if (rv != 0) {
aprint_error_dev(&sc->sc_dv, "can't create dmamap, rv =
%d\n", rv);
- return;
+ return ENXIO;
}
/* Save the first CCB for AEN retrieval. */
@@ -430,7 +430,7 @@ twe_attach(struct device *parent, struct
/* Wait for the controller to become ready. */
if (twe_status_wait(sc, TWE_STS_MICROCONTROLLER_READY, 6)) {
aprint_error_dev(&sc->sc_dv, "microcontroller not ready\n");
- return;
+ return ENXIO;
}
twe_outl(sc, TWE_REG_CTL, TWE_CTL_DISABLE_INTRS);
@@ -441,7 +441,7 @@ twe_attach(struct device *parent, struct
splx(s);
if (rv) {
aprint_error_dev(&sc->sc_dv, "reset failed\n");
- return;
+ return ENXIO;
}
/* Initialise connection with controller. */
@@ -466,7 +466,7 @@ twe_attach(struct device *parent, struct
CTL_HW, CTL_EOL) != 0) {
aprint_error_dev(&sc->sc_dv, "could not create %s sysctl
node\n",
ctlnames[CTL_HW].ctl_name);
- return;
+ return ENXIO;
}
if (sysctl_createv(NULL, 0, NULL, &node,
0, CTLTYPE_NODE, device_xname(&sc->sc_dv),
@@ -475,7 +475,7 @@ twe_attach(struct device *parent, struct
CTL_HW, CTL_CREATE, CTL_EOL) != 0) {
aprint_error_dev(&sc->sc_dv, "could not create %s.%s sysctl
node\n",
ctlnames[CTL_HW].ctl_name, device_xname(&sc->sc_dv));
- return;
+ return ENXIO;
}
if ((i = sysctl_createv(NULL, 0, NULL, NULL,
0, CTLTYPE_STRING, "driver_version",
@@ -485,8 +485,9 @@ twe_attach(struct device *parent, struct
!= 0) {
aprint_error_dev(&sc->sc_dv, "could not create
%s.%s.driver_version sysctl\n",
ctlnames[CTL_HW].ctl_name, device_xname(&sc->sc_dv));
- return;
+ return ENXIO;
}
+ return 0;
}
void
Index: sys/dev/pci/ubsec.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ubsec.c,v
retrieving revision 1.20
diff -u -p -r1.20 ubsec.c
--- sys/dev/pci/ubsec.c 18 Apr 2009 14:58:03 -0000 1.20
+++ sys/dev/pci/ubsec.c 1 May 2009 16:44:13 -0000
@@ -83,7 +83,7 @@ __KERNEL_RCSID(0, "$NetBSD: ubsec.c,v 1.
* Prototypes and count for the pci_device structure
*/
static int ubsec_probe(struct device *, struct cfdata *, void *);
-static void ubsec_attach(struct device *, struct device *, void *);
+static int ubsec_attach(struct device *, struct device *, void *);
static void ubsec_reset_board(struct ubsec_softc *);
static void ubsec_init_board(struct ubsec_softc *);
static void ubsec_init_pciregs(struct pci_attach_args *pa);
@@ -298,7 +298,7 @@ ubsec_probe(struct device *parent, struc
return (0);
}
-static void
+static int
ubsec_attach(struct device *parent, struct device *self, void *aux)
{
struct ubsec_softc *sc = (struct ubsec_softc *)self;
@@ -336,14 +336,14 @@ ubsec_attach(struct device *parent, stru
if (pci_mapreg_map(pa, BS_BAR, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc_st, &sc->sc_sh, NULL, NULL)) {
aprint_error_dev(&sc->sc_dv, "can't find mem space");
- return;
+ return ENXIO;
}
sc->sc_dmat = pa->pa_dmat;
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(&sc->sc_dv, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, ubsec_intr, sc);
@@ -352,7 +352,7 @@ ubsec_attach(struct device *parent, stru
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(&sc->sc_dv, "interrupting at %s\n", intrstr);
@@ -360,7 +360,7 @@ ubsec_attach(struct device *parent, stru
if (sc->sc_cid < 0) {
aprint_error_dev(&sc->sc_dv, "couldn't get crypto driver id\n");
pci_intr_disestablish(pc, sc->sc_ih);
- return;
+ return ENXIO;
}
SIMPLEQ_INIT(&sc->sc_freequeue);
@@ -464,6 +464,7 @@ ubsec_attach(struct device *parent, stru
ubsec_kprocess, sc);
#endif
}
+ return 0;
}
/*
Index: sys/dev/pci/uhci_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/uhci_pci.c,v
retrieving revision 1.46
diff -u -p -r1.46 uhci_pci.c
--- sys/dev/pci/uhci_pci.c 17 Apr 2009 17:21:31 -0000 1.46
+++ sys/dev/pci/uhci_pci.c 1 May 2009 16:44:13 -0000
@@ -80,7 +80,7 @@ uhci_pci_match(device_t parent, struct c
return (0);
}
-static void
+static int
uhci_pci_attach(device_t parent, device_t self, void *aux)
{
struct uhci_pci_softc *sc = device_private(self);
@@ -108,7 +108,7 @@ uhci_pci_attach(device_t parent, device_
if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
&sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
aprint_error_dev(self, "can't map i/o space\n");
- return;
+ return ENXIO;
}
/*
@@ -131,7 +131,7 @@ uhci_pci_attach(device_t parent, device_
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_USB, uhci_intr, sc);
@@ -140,7 +140,7 @@ uhci_pci_attach(device_t parent, device_
if (intrstr != NULL)
aprint_normal(" at %s", intrstr);
aprint_normal("\n");
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -183,7 +183,7 @@ uhci_pci_attach(device_t parent, device_
r = uhci_init(&sc->sc);
if (r != USBD_NORMAL_COMPLETION) {
aprint_error_dev(self, "init failed, error=%d\n", r);
- return;
+ return ENXIO;
}
#if NEHCI > 0
@@ -195,6 +195,7 @@ uhci_pci_attach(device_t parent, device_
/* Attach usb device. */
sc->sc.sc_child = config_found(self, &sc->sc.sc_bus, usbctlprint);
+ return 0;
}
static int
Index: sys/dev/pci/vga_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/vga_pci.c,v
retrieving revision 1.44
diff -u -p -r1.44 vga_pci.c
--- sys/dev/pci/vga_pci.c 3 Aug 2008 02:12:22 -0000 1.44
+++ sys/dev/pci/vga_pci.c 1 May 2009 16:44:13 -0000
@@ -87,7 +87,7 @@ struct vga_pci_softc {
};
static int vga_pci_match(struct device *, struct cfdata *, void *);
-static void vga_pci_attach(struct device *, struct device *, void *);
+static int vga_pci_attach(struct device *, struct device *, void *);
static int vga_pci_rescan(struct device *, const char *, const int *);
static int vga_pci_lookup_quirks(struct pci_attach_args *);
static bool vga_pci_resume(device_t dv PMF_FN_PROTO);
@@ -178,7 +178,7 @@ vga_pci_match(struct device *parent, str
return (1);
}
-static void
+static int
vga_pci_attach(struct device *parent, struct device *self, void *aux)
{
struct vga_pci_softc *psc = device_private(self);
@@ -251,6 +251,7 @@ vga_pci_attach(struct device *parent, st
if (!pmf_device_register(self, NULL, vga_pci_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
config_found_ia(self, "drm", aux, vga_drm_print);
+ return 0;
}
static int
Index: sys/dev/pci/viaide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/viaide.c,v
retrieving revision 1.58
diff -u -p -r1.58 viaide.c
--- sys/dev/pci/viaide.c 21 Dec 2008 16:27:57 -0000 1.58
+++ sys/dev/pci/viaide.c 1 May 2009 16:44:13 -0000
@@ -63,7 +63,7 @@ static void via_sata_chip_map_new(struct
static void via_setup_channel(struct ata_channel *);
static int viaide_match(device_t, cfdata_t, void *);
-static void viaide_attach(device_t, device_t, void *);
+static int viaide_attach(device_t, device_t, void *);
static const struct pciide_product_desc *
viaide_lookup(pcireg_t);
static bool viaide_suspend(device_t PMF_FN_PROTO);
@@ -373,7 +373,7 @@ viaide_match(device_t parent, cfdata_t m
return (0);
}
-static void
+static int
viaide_attach(device_t parent, device_t self, void *aux)
{
struct pci_attach_args *pa = aux;
@@ -389,6 +389,7 @@ viaide_attach(device_t parent, device_t
if (!pmf_device_register(self, viaide_suspend, viaide_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static int
Index: sys/dev/pci/weasel_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/weasel_pci.c,v
retrieving revision 1.14
diff -u -p -r1.14 weasel_pci.c
--- sys/dev/pci/weasel_pci.c 18 Mar 2009 16:00:19 -0000 1.14
+++ sys/dev/pci/weasel_pci.c 1 May 2009 16:44:13 -0000
@@ -94,7 +94,7 @@ weasel_pci_match(device_t parent, cfdata
return (0);
}
-static void
+static int
weasel_pci_attach(device_t parent, device_t self, void *aux)
{
struct weasel_softc *sc = device_private(self);
@@ -113,38 +113,38 @@ weasel_pci_attach(device_t parent, devic
PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0,
&sc->sc_st, &sc->sc_sh, NULL, NULL) != 0) {
aprint_error_dev(self, "unable to map device registers\n");
- return;
+ return ENXIO;
}
/* Ping the Weasel to see if it's alive. */
if (weasel_issue_command(sc, OS_CMD_PING)) {
aprint_error_dev(self, "Weasel didn't respond to PING\n");
- return;
+ return ENXIO;
}
bus_space_write_1(sc->sc_st, sc->sc_sh, WEASEL_STATUS, 0);
if ((v = bus_space_read_1(sc->sc_st, sc->sc_sh, WEASEL_DATA_RD)) !=
OS_RET_PONG) {
aprint_error_dev(self, "unexpected PING response from Weasel:
0x%02x\n", v);
- return;
+ return ENXIO;
}
/* Read the config block. */
if (weasel_issue_command(sc, OS_CMD_SHOW_CONFIG)) {
aprint_error_dev(self, "Weasel didn't respond to
SHOW_CONFIG\n");
- return;
+ return ENXIO;
}
cfg_size = bus_space_read_1(sc->sc_st, sc->sc_sh, WEASEL_DATA_RD);
bus_space_write_1(sc->sc_st, sc->sc_sh, WEASEL_STATUS, 0);
if (++cfg_size != sizeof(cfg)) {
aprint_error_dev(self, "weird config block size from Weasel:
0x%03x\n", cfg_size);
- return;
+ return ENXIO;
}
for (cp = (uint8_t *) &cfg; cfg_size != 0; cfg_size--) {
if (weasel_wait_response(sc)) {
aprint_error_dev(self, "Weasel stopped providing config
block(%d)\n", cfg_size);
- return;
+ return ENXIO;
}
*cp++ = bus_space_read_1(sc->sc_st, sc->sc_sh, WEASEL_DATA_RD);
bus_space_write_1(sc->sc_st, sc->sc_sh, WEASEL_STATUS, 0);
@@ -251,6 +251,7 @@ weasel_pci_attach(device_t parent, devic
if (sysmon_wdog_register(&sc->sc_smw) != 0)
aprint_error_dev(self, "unable to register PC-Weasel watchdog "
"with sysmon\n");
+ return 0;
}
CFATTACH_DECL_NEW(weasel_pci, sizeof(struct weasel_softc),
Index: sys/dev/pci/yds.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/yds.c,v
retrieving revision 1.45
diff -u -p -r1.45 yds.c
--- sys/dev/pci/yds.c 17 Dec 2008 15:47:35 -0000 1.45
+++ sys/dev/pci/yds.c 1 May 2009 16:44:14 -0000
@@ -89,7 +89,7 @@ int ydsdebug = 0;
#endif
static int yds_match(device_t, cfdata_t, void *);
-static void yds_attach(device_t, device_t, void *);
+static int yds_attach(device_t, device_t, void *);
static int yds_intr(void *);
#define DMAADDR(p) ((p)->map->dm_segs[0].ds_addr)
@@ -720,7 +720,7 @@ yds_resume(device_t dv PMF_FN_ARGS)
return true;
}
-static void
+static int
yds_attach(device_t parent, device_t self, void *aux)
{
struct yds_softc *sc;
@@ -747,13 +747,13 @@ yds_attach(device_t parent, device_t sel
if (pci_mapreg_map(pa, YDS_PCI_MBA, PCI_MAPREG_TYPE_MEM, 0,
&sc->memt, &sc->memh, NULL, NULL)) {
aprint_error_dev(self, "can't map memory space\n");
- return;
+ return ENXIO;
}
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {
aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_AUDIO, yds_intr, sc);
@@ -762,7 +762,7 @@ yds_attach(device_t parent, device_t sel
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
printf("%s: interrupting at %s\n", device_xname(self), intrstr);
@@ -800,7 +800,7 @@ yds_attach(device_t parent, device_t sel
/* Initialize the device */
if (yds_init(sc)) {
aprint_error_dev(self, "initialize failed\n");
- return;
+ return ENXIO;
}
/*
@@ -819,7 +819,7 @@ yds_attach(device_t parent, device_t sel
}
if (to == AC97_TIMEOUT) {
aprint_error_dev(self, "no AC97 available\n");
- return;
+ return ENXIO;
}
/* Secondary */
@@ -895,13 +895,13 @@ detected:
if ((r = ac97_attach(&codec->host_if, self)) != 0) {
aprint_error_dev(self, "can't attach codec (error
0x%X)\n", r);
- return;
+ return ENXIO;
}
}
if (0 != auconv_create_encodings(yds_formats, YDS_NFORMATS,
&sc->sc_encodings))
- return;
+ return ENXIO;
audio_attach_mi(&yds_hw_if, sc, self);
@@ -910,6 +910,7 @@ detected:
if (!pmf_device_register(self, yds_suspend, yds_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static int
Index: sys/dev/pci/bktr/bktr_os.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/bktr/bktr_os.c,v
retrieving revision 1.55
diff -u -p -r1.55 bktr_os.c
--- sys/dev/pci/bktr/bktr_os.c 15 Mar 2009 15:48:14 -0000 1.55
+++ sys/dev/pci/bktr/bktr_os.c 1 May 2009 16:44:14 -0000
@@ -1331,7 +1331,7 @@ static int bktr_probe(struct device
#else
static int bktr_probe(struct device *, struct cfdata *, void *);
#endif
-static void bktr_attach(struct device *, struct device *, void *);
+static int bktr_attach(struct device *, struct device *, void *);
CFATTACH_DECL(bktr, sizeof(struct bktr_softc),
bktr_probe, bktr_attach, NULL, NULL);
@@ -1379,7 +1379,7 @@ bktr_probe(struct device *parent, struct
/*
* the attach routine.
*/
-static void
+static int
bktr_attach(struct device *parent, struct device *self, void *aux)
{
bktr_ptr_t bktr;
@@ -1476,7 +1476,7 @@ bktr_attach(struct device *parent, struc
(u_int)bktr->obmemsz));
if (retval) {
printf("%s: couldn't map memory\n", bktr_name(bktr));
- return;
+ return ENXIO;
}
/*
@@ -1491,7 +1491,7 @@ bktr_attach(struct device *parent, struc
if (pci_intr_map(pa, &ih)) {
printf("%s: couldn't map interrupt\n",
bktr_name(bktr));
- return;
+ return ENXIO;
}
intrstr = pci_intr_string(pa->pa_pc, ih);
bktr->ih = pci_intr_establish(pa->pa_pc, ih, IPL_VIDEO,
@@ -1502,7 +1502,7 @@ bktr_attach(struct device *parent, struc
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- return;
+ return ENXIO;
}
if (intrstr != NULL)
printf("%s: interrupting at %s\n", bktr_name(bktr),
@@ -1532,13 +1532,14 @@ bktr_attach(struct device *parent, struc
if (common_bktr_attach(bktr, unit, pa->pa_id,
PCI_REVISION(pa->pa_class)) == 0)
- return;
+ return ENXIO;
#if NRADIO > 0
/* attach to radio(4) */
if (bktr->card.tuner->pllControl[3] != 0x00)
radio_attach_mi(&bktr_hw_if, bktr, &bktr->bktr_dev);
#endif
+ return 0;
}
Index: sys/dev/pckbport/pckbd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pckbport/pckbd.c,v
retrieving revision 1.26
diff -u -p -r1.26 pckbd.c
--- sys/dev/pckbport/pckbd.c 8 Mar 2009 15:06:56 -0000 1.26
+++ sys/dev/pckbport/pckbd.c 1 May 2009 16:44:14 -0000
@@ -124,7 +124,7 @@ struct pckbd_softc {
static int pckbd_is_console(pckbport_tag_t, pckbport_slot_t);
int pckbdprobe(device_t, cfdata_t, void *);
-void pckbdattach(device_t, device_t, void *);
+int pckbdattach(device_t, device_t, void *);
CFATTACH_DECL_NEW(pckbd, sizeof(struct pckbd_softc),
pckbdprobe, pckbdattach, NULL, NULL);
@@ -337,7 +337,7 @@ pckbdprobe(device_t parent, cfdata_t cf,
return 2;
}
-void
+int
pckbdattach(device_t parent, device_t self, void *aux)
{
struct pckbd_softc *sc = device_private(self);
@@ -395,6 +395,7 @@ pckbdattach(device_t parent, device_t se
* XXX XXX XXX
*/
sc->sc_wskbddev = config_found_ia(self, "wskbddev", &a, wskbddevprint);
+ return 0;
}
int
Index: sys/dev/pckbport/pms.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pckbport/pms.c,v
retrieving revision 1.28
diff -u -p -r1.28 pms.c
--- sys/dev/pckbport/pms.c 8 Mar 2009 15:06:56 -0000 1.28
+++ sys/dev/pckbport/pms.c 1 May 2009 16:44:14 -0000
@@ -76,7 +76,7 @@ const struct pms_protocol pms_protocols[
int pmsprobe(device_t, cfdata_t, void *);
-void pmsattach(device_t, device_t, void *);
+int pmsattach(device_t, device_t, void *);
void pmsinput(void *, int);
CFATTACH_DECL_NEW(pms, sizeof(struct pms_softc),
@@ -166,7 +166,7 @@ pmsprobe(device_t parent, cfdata_t match
return 10;
}
-void
+int
pmsattach(device_t parent, device_t self, void *aux)
{
struct pms_softc *sc = device_private(self);
@@ -190,7 +190,7 @@ pmsattach(device_t parent, device_t self
res = pckbport_poll_cmd(pa->pa_tag, pa->pa_slot, cmd, 1, 2, resp, 1);
if (res || resp[0] != PMS_RSTDONE || resp[1] != 0) {
aprint_debug("pmsattach: reset error\n");
- return;
+ return ENXIO;
}
sc->inputstate = 0;
sc->buttons = 0;
@@ -237,6 +237,7 @@ pmsattach(device_t parent, device_t self
#endif
if (!pmf_device_register(self, pms_suspend, pms_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static void
Index: sys/dev/pcmcia/aic_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/aic_pcmcia.c,v
retrieving revision 1.38
diff -u -p -r1.38 aic_pcmcia.c
--- sys/dev/pcmcia/aic_pcmcia.c 14 Mar 2009 15:36:20 -0000 1.38
+++ sys/dev/pcmcia/aic_pcmcia.c 1 May 2009 16:44:14 -0000
@@ -64,7 +64,7 @@ struct aic_pcmcia_softc {
int aic_pcmcia_match(struct device *, struct cfdata *, void *);
int aic_pcmcia_validate_config(struct pcmcia_config_entry *);
-void aic_pcmcia_attach(struct device *, struct device *, void *);
+int aic_pcmcia_attach(struct device *, struct device *, void *);
int aic_pcmcia_detach(struct device *, int);
int aic_pcmcia_enable(struct device *, int);
@@ -106,7 +106,7 @@ aic_pcmcia_validate_config(struct pcmcia
return (0);
}
-void
+int
aic_pcmcia_attach(struct device *parent, struct device *self,
void *aux)
{
@@ -123,7 +123,7 @@ aic_pcmcia_attach(struct device *parent,
if (error) {
aprint_error_dev(self, "configure failed, error=%d\n",
error);
- return;
+ return ENXIO;
}
cfe = pf->cfe;
@@ -146,12 +146,13 @@ aic_pcmcia_attach(struct device *parent,
aicattach(sc);
scsipi_adapter_delref(&sc->sc_adapter);
psc->sc_state = AIC_PCMCIA_ATTACHED;
- return;
+ return 0;
fail2:
aic_pcmcia_enable(self, 0);
fail:
pcmcia_function_unconfigure(pf);
+ return ENXIO;
}
int
Index: sys/dev/pcmcia/bt3c.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/bt3c.c,v
retrieving revision 1.18
diff -u -p -r1.18 bt3c.c
--- sys/dev/pcmcia/bt3c.c 6 Apr 2008 18:55:33 -0000 1.18
+++ sys/dev/pcmcia/bt3c.c 1 May 2009 16:44:14 -0000
@@ -133,7 +133,7 @@ struct bt3c_softc {
#define BT3C_ENABLED (1 << 2) /* enabled */
static int bt3c_match(device_t, struct cfdata *, void *);
-static void bt3c_attach(device_t, device_t, void *);
+static int bt3c_attach(device_t, device_t, void *);
static int bt3c_detach(device_t, int);
static bool bt3c_suspend(device_t PMF_FN_PROTO);
static bool bt3c_resume(device_t PMF_FN_PROTO);
@@ -935,7 +935,7 @@ bt3c_match(device_t parent, struct cfdat
return 0;
}
-static void
+static int
bt3c_attach(device_t parent, device_t self, void *aux)
{
struct bt3c_softc *sc = device_private(self);
@@ -985,7 +985,7 @@ bt3c_attach(device_t parent, device_t se
if (!pmf_device_register(self, bt3c_suspend, bt3c_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
- return;
+ return 0;
iomap_failed:
/* unmap io space */
@@ -993,6 +993,7 @@ iomap_failed:
no_config_entry:
sc->sc_iow = -1;
+ return ENXIO;
}
static int
Index: sys/dev/pcmcia/btbc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/btbc.c,v
retrieving revision 1.12
diff -u -p -r1.12 btbc.c
--- sys/dev/pcmcia/btbc.c 6 Apr 2008 18:55:33 -0000 1.12
+++ sys/dev/pcmcia/btbc.c 1 May 2009 16:44:15 -0000
@@ -102,7 +102,7 @@ struct btbc_softc {
};
static int btbc_match(device_t, struct cfdata *, void *);
-static void btbc_attach(device_t, device_t, void *);
+static int btbc_attach(device_t, device_t, void *);
static int btbc_detach(device_t, int);
static bool btbc_suspend(device_t PMF_FN_PROTO);
static bool btbc_resume(device_t PMF_FN_PROTO);
@@ -162,7 +162,7 @@ btbc_pcmcia_validate_config(struct pcmci
}
/* ARGSUSED */
-static void
+static int
btbc_attach(device_t parent, device_t self, void *aux)
{
struct btbc_softc *sc = device_private(self);
@@ -180,7 +180,7 @@ btbc_attach(device_t parent, device_t se
if ((error = pcmcia_function_configure(pa->pf,
btbc_pcmcia_validate_config)) != 0) {
aprint_error_dev(self, "configure failed, error=%d\n", error);
- return;
+ return ENXIO;
}
cfe = pa->pf->cfe;
@@ -197,7 +197,7 @@ btbc_attach(device_t parent, device_t se
callout_init(&sc->sc_ledch, 0);
callout_setfunc(&sc->sc_ledch, btbc_activity_led_timeout, sc);
- return;
+ return 0;
}
/* ARGSUSED */
Index: sys/dev/pcmcia/com_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/com_pcmcia.c,v
retrieving revision 1.59
diff -u -p -r1.59 com_pcmcia.c
--- sys/dev/pcmcia/com_pcmcia.c 27 Aug 2008 05:39:01 -0000 1.59
+++ sys/dev/pcmcia/com_pcmcia.c 1 May 2009 16:44:15 -0000
@@ -91,7 +91,7 @@ __KERNEL_RCSID(0, "$NetBSD: com_pcmcia.c
int com_pcmcia_match(device_t, cfdata_t , void *);
int com_pcmcia_validate_config(struct pcmcia_config_entry *);
-void com_pcmcia_attach(device_t, device_t, void *);
+int com_pcmcia_attach(device_t, device_t, void *);
int com_pcmcia_detach(device_t, int);
int com_pcmcia_enable(struct com_softc *);
@@ -170,7 +170,7 @@ com_pcmcia_validate_config(struct pcmcia
return (0);
}
-void
+int
com_pcmcia_attach(device_t parent, device_t self, void *aux)
{
struct com_pcmcia_softc *psc = device_private(self);
@@ -185,7 +185,7 @@ com_pcmcia_attach(device_t parent, devic
error = pcmcia_function_configure(pa->pf, com_pcmcia_validate_config);
if (error) {
aprint_error_dev(self, "configure failed, error=%d\n", error);
- return;
+ return ENXIO;
}
cfe = pa->pf->cfe;
@@ -215,10 +215,11 @@ com_pcmcia_attach(device_t parent, devic
psc->sc_attached = 1;
com_pcmcia_disable(sc);
- return;
+ return 0;
fail:
pcmcia_function_unconfigure(pa->pf);
+ return ENXIO;
}
int
Index: sys/dev/pcmcia/esp_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/esp_pcmcia.c,v
retrieving revision 1.37
diff -u -p -r1.37 esp_pcmcia.c
--- sys/dev/pcmcia/esp_pcmcia.c 14 Mar 2009 15:36:20 -0000 1.37
+++ sys/dev/pcmcia/esp_pcmcia.c 1 May 2009 16:44:15 -0000
@@ -77,7 +77,7 @@ struct esp_pcmcia_softc {
int esp_pcmcia_match(device_t, cfdata_t, void *);
int esp_pcmcia_validate_config(struct pcmcia_config_entry *);
-void esp_pcmcia_attach(device_t, device_t, void *);
+int esp_pcmcia_attach(device_t, device_t, void *);
void esp_pcmcia_init(struct esp_pcmcia_softc *);
int esp_pcmcia_detach(device_t, int);
int esp_pcmcia_enable(device_t, int);
@@ -146,7 +146,7 @@ esp_pcmcia_validate_config(struct pcmcia
return 0;
}
-void
+int
esp_pcmcia_attach(device_t parent, device_t self, void *aux)
{
struct esp_pcmcia_softc *esc = device_private(self);
@@ -164,7 +164,7 @@ esp_pcmcia_attach(device_t parent, devic
if (error) {
aprint_error_dev(self, "configure failed, error=%d\n",
error);
- return;
+ return ENXIO;
}
cfe = pf->cfe;
@@ -180,6 +180,7 @@ esp_pcmcia_attach(device_t parent, devic
ncr53c9x_attach(sc);
esc->sc_state = ESP_PCMCIA_ATTACHED;
+ return 0;
}
void
Index: sys/dev/pcmcia/if_an_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/if_an_pcmcia.c,v
retrieving revision 1.37
diff -u -p -r1.37 if_an_pcmcia.c
--- sys/dev/pcmcia/if_an_pcmcia.c 14 Mar 2009 15:36:20 -0000 1.37
+++ sys/dev/pcmcia/if_an_pcmcia.c 1 May 2009 16:44:15 -0000
@@ -64,7 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_an_pcmcia
static int an_pcmcia_match(struct device *, struct cfdata *, void *);
static int an_pcmcia_validate_config(struct pcmcia_config_entry *);
-static void an_pcmcia_attach(struct device *, struct device *, void *);
+static int an_pcmcia_attach(struct device *, struct device *, void *);
static int an_pcmcia_detach(struct device *, int);
static int an_pcmcia_enable(struct an_softc *);
static void an_pcmcia_disable(struct an_softc *);
@@ -117,7 +117,7 @@ an_pcmcia_validate_config(struct pcmcia_
return (0);
}
-static void
+static int
an_pcmcia_attach(struct device *parent, struct device *self,
void *aux)
{
@@ -134,7 +134,7 @@ an_pcmcia_attach(struct device *parent,
if (error) {
aprint_error_dev(self, "configure failed, error=%d\n",
error);
- return;
+ return ENXIO;
}
cfe = pa->pf->cfe;
@@ -163,13 +163,14 @@ an_pcmcia_attach(struct device *parent,
an_pcmcia_disable(sc);
sc->sc_enabled = 0;
psc->sc_state = AN_PCMCIA_ATTACHED;
- return;
+ return 0;
fail2:
an_pcmcia_disable(sc);
sc->sc_enabled = 0;
fail:
pcmcia_function_unconfigure(pa->pf);
+ return ENXIO;
}
Index: sys/dev/pcmcia/if_awi_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/if_awi_pcmcia.c,v
retrieving revision 1.41
diff -u -p -r1.41 if_awi_pcmcia.c
--- sys/dev/pcmcia/if_awi_pcmcia.c 14 Mar 2009 15:36:20 -0000 1.41
+++ sys/dev/pcmcia/if_awi_pcmcia.c 1 May 2009 16:44:15 -0000
@@ -73,7 +73,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_awi_pcmci
static int awi_pcmcia_match(struct device *, struct cfdata *, void *);
static int awi_pcmcia_validate_config(struct pcmcia_config_entry *);
-static void awi_pcmcia_attach(struct device *, struct device *, void *);
+static int awi_pcmcia_attach(struct device *, struct device *, void *);
static int awi_pcmcia_detach(struct device *, int);
static int awi_pcmcia_enable(struct awi_softc *);
static void awi_pcmcia_disable(struct awi_softc *);
@@ -177,7 +177,7 @@ awi_pcmcia_validate_config(struct pcmcia
return (0);
}
-static void
+static int
awi_pcmcia_attach(struct device *parent, struct device *self,
void *aux)
{
@@ -193,7 +193,7 @@ awi_pcmcia_attach(struct device *parent,
if (error) {
aprint_error_dev(self, "configure failed, error=%d\n",
error);
- return;
+ return ENXIO;
}
cfe = pa->pf->cfe;
@@ -229,13 +229,14 @@ awi_pcmcia_attach(struct device *parent,
sc->sc_enabled = 0;
awi_pcmcia_disable(sc);
psc->sc_state = AWI_PCMCIA_ATTACHED;
- return;
+ return 0;
fail2:
sc->sc_enabled = 0;
awi_pcmcia_disable(sc);
fail:
pcmcia_function_unconfigure(pa->pf);
+ return ENXIO;
}
static int
Index: sys/dev/pcmcia/if_cnw.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/if_cnw.c,v
retrieving revision 1.49
diff -u -p -r1.49 if_cnw.c
--- sys/dev/pcmcia/if_cnw.c 15 Apr 2009 20:44:25 -0000 1.49
+++ sys/dev/pcmcia/if_cnw.c 1 May 2009 16:44:15 -0000
@@ -179,7 +179,7 @@ int cnw_skey = CNW_SCRAMBLEKEY; /* Scra
#define MEMORY_MAPPED
int cnw_match(struct device *, struct cfdata *, void *);
-void cnw_attach(struct device *, struct device *, void *);
+int cnw_attach(struct device *, struct device *, void *);
int cnw_detach(struct device *, int);
int cnw_activate(struct device *, enum devact);
@@ -479,7 +479,7 @@ cnw_match(struct device *parent, struct
/*
* Attach the card.
*/
-void
+int
cnw_attach(struct device *parent, struct device *self, void *aux)
{
struct cnw_softc *sc = (void *) self;
@@ -496,7 +496,7 @@ cnw_attach(struct device *parent, struc
pcmcia_function_init(sc->sc_pf, SIMPLEQ_FIRST(&sc->sc_pf->cfe_head));
if (pcmcia_function_enable(sc->sc_pf)) {
aprint_error_dev(self, "function enable failed\n");
- return;
+ return ENXIO;
}
sc->sc_resource |= CNW_RES_PCIC;
@@ -570,7 +570,7 @@ cnw_attach(struct device *parent, struc
/* Disable the card now, and turn it on when the interface goes up */
pcmcia_function_disable(sc->sc_pf);
sc->sc_resource &= ~CNW_RES_PCIC;
- return;
+ return ENXIO;
fail:
#ifndef MEMORY_MAPPED
@@ -584,6 +584,7 @@ fail:
pcmcia_function_disable(sc->sc_pf);
sc->sc_resource &= ~CNW_RES_PCIC;
}
+ return 0;
}
/*
Index: sys/dev/pcmcia/if_cs_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/if_cs_pcmcia.c,v
retrieving revision 1.16
diff -u -p -r1.16 if_cs_pcmcia.c
--- sys/dev/pcmcia/if_cs_pcmcia.c 5 Apr 2008 21:31:23 -0000 1.16
+++ sys/dev/pcmcia/if_cs_pcmcia.c 1 May 2009 16:44:15 -0000
@@ -58,7 +58,7 @@ struct cs_pcmcia_softc;
static int cs_pcmcia_match(struct device *, struct cfdata *, void *);
static int cs_pcmcia_validate_config(struct pcmcia_config_entry *);
-static void cs_pcmcia_attach(struct device *, struct device *, void *);
+static int cs_pcmcia_attach(struct device *, struct device *, void *);
static int cs_pcmcia_detach(struct device *, int);
static int cs_pcmcia_enable(struct cs_softc *);
static void cs_pcmcia_disable(struct cs_softc *);
@@ -98,7 +98,7 @@ cs_pcmcia_validate_config(struct pcmcia_
return (0);
}
-static void
+static int
cs_pcmcia_attach(struct device *parent, struct device *self, void *aux)
{
struct cs_pcmcia_softc *psc = (void *)self;
@@ -114,7 +114,7 @@ cs_pcmcia_attach(struct device *parent,
if (error) {
aprint_error_dev(self, "configure failed, error=%d\n",
error);
- return;
+ return ENXIO;
}
cfe = pf->cfe;
@@ -143,12 +143,13 @@ cs_pcmcia_attach(struct device *parent,
cs_pcmcia_disable(sc);
psc->sc_state = CS_PCMCIA_ATTACHED;
- return;
+ return 0;
fail2:
cs_pcmcia_disable(sc);
fail:
pcmcia_function_unconfigure(pf);
+ return ENXIO;
}
static int
Index: sys/dev/pcmcia/if_ep_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/if_ep_pcmcia.c,v
retrieving revision 1.62
diff -u -p -r1.62 if_ep_pcmcia.c
--- sys/dev/pcmcia/if_ep_pcmcia.c 27 Aug 2008 05:33:47 -0000 1.62
+++ sys/dev/pcmcia/if_ep_pcmcia.c 1 May 2009 16:44:15 -0000
@@ -91,7 +91,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ep_pcmcia
#include <dev/pcmcia/pcmciadevs.h>
int ep_pcmcia_match(device_t, cfdata_t, void *);
-void ep_pcmcia_attach(device_t, device_t, void *);
+int ep_pcmcia_attach(device_t, device_t, void *);
int ep_pcmcia_detach(device_t, int);
int ep_pcmcia_get_enaddr(struct pcmcia_tuple *, void *);
@@ -210,7 +210,7 @@ ep_pcmcia_disable(struct ep_softc *sc)
sc->sc_ih = 0;
}
-void
+int
ep_pcmcia_attach(device_t parent, device_t self, void *aux)
{
struct ep_pcmcia_softc *psc = device_private(self);
@@ -329,7 +329,7 @@ ep_pcmcia_attach(device_t parent, device
sc->enabled = 0;
ep_pcmcia_disable(sc);
- return;
+ return 0;
enable_failed:
pcmcia_io_unmap(psc->sc_pf, psc->sc_io_window);
@@ -337,6 +337,7 @@ iomap_failed:
pcmcia_io_free(psc->sc_pf, &psc->sc_pcioh);
ioalloc_failed:
psc->sc_io_window = -1;
+ return ENXIO;
}
int
Index: sys/dev/pcmcia/if_mbe_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/if_mbe_pcmcia.c,v
retrieving revision 1.45
diff -u -p -r1.45 if_mbe_pcmcia.c
--- sys/dev/pcmcia/if_mbe_pcmcia.c 28 Apr 2008 20:23:56 -0000 1.45
+++ sys/dev/pcmcia/if_mbe_pcmcia.c 1 May 2009 16:44:15 -0000
@@ -53,7 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_mbe_pcmci
int mbe_pcmcia_match(device_t, cfdata_t, void *);
int mbe_pcmcia_validate_config(struct pcmcia_config_entry *);
-void mbe_pcmcia_attach(device_t, device_t, void *);
+int mbe_pcmcia_attach(device_t, device_t, void *);
int mbe_pcmcia_detach(device_t, int);
struct mbe_pcmcia_softc {
@@ -157,7 +157,7 @@ mbe_pcmcia_validate_config(struct pcmcia
return 0;
}
-void
+int
mbe_pcmcia_attach(device_t parent, device_t self, void *aux)
{
struct mbe_pcmcia_softc *psc = device_private(self);
@@ -175,7 +175,7 @@ mbe_pcmcia_attach(device_t parent, devic
if (error) {
aprint_error_dev(self, "configure failed, error=%d\n",
error);
- return;
+ return ENXIO;
}
cfe = pa->pf->cfe;
@@ -228,10 +228,11 @@ mbe_pcmcia_attach(device_t parent, devic
mbe_pcmcia_disable(sc);
psc->sc_state = MBE_PCMCIA_ATTACHED;
- return;
+ return 0;
fail:
pcmcia_function_unconfigure(pa->pf);
+ return ENXIO;
}
int
Index: sys/dev/pcmcia/if_ne_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/if_ne_pcmcia.c,v
retrieving revision 1.156
diff -u -p -r1.156 if_ne_pcmcia.c
--- sys/dev/pcmcia/if_ne_pcmcia.c 5 Apr 2009 03:37:07 -0000 1.156
+++ sys/dev/pcmcia/if_ne_pcmcia.c 1 May 2009 16:44:15 -0000
@@ -66,7 +66,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ne_pcmcia
int ne_pcmcia_match(device_t, cfdata_t , void *);
int ne_pcmcia_validate_config(struct pcmcia_config_entry *);
-void ne_pcmcia_attach(device_t, device_t, void *);
+int ne_pcmcia_attach(device_t, device_t, void *);
int ne_pcmcia_detach(device_t, int);
int ne_pcmcia_enable(struct dp8390_softc *);
@@ -569,7 +569,7 @@ ne_pcmcia_validate_config(struct pcmcia_
return (0);
}
-void
+int
ne_pcmcia_attach(device_t parent, device_t self, void *aux)
{
struct ne_pcmcia_softc *psc = device_private(self);
@@ -591,7 +591,7 @@ ne_pcmcia_attach(device_t parent, device
error = pcmcia_function_configure(pa->pf, ne_pcmcia_validate_config);
if (error) {
aprint_error_dev(self, "configure failed, error=%d\n", error);
- return;
+ return ENXIO;
}
cfe = pa->pf->cfe;
@@ -751,12 +751,13 @@ found:
psc->sc_state = NE_PCMCIA_ATTACHED;
ne_pcmcia_disable(dsc);
- return;
+ return 0;
fail2:
ne_pcmcia_disable(dsc);
fail:
pcmcia_function_unconfigure(pa->pf);
+ return ENXIO;
}
int
Index: sys/dev/pcmcia/if_ray.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/if_ray.c,v
retrieving revision 1.73
diff -u -p -r1.73 if_ray.c
--- sys/dev/pcmcia/if_ray.c 14 Mar 2009 21:04:22 -0000 1.73
+++ sys/dev/pcmcia/if_ray.c 1 May 2009 16:44:16 -0000
@@ -278,7 +278,7 @@ static int ray_alloc_ccs(struct ray_soft
static bus_size_t ray_fill_in_tx_ccs(struct ray_softc *, size_t,
u_int, u_int);
static int ray_validate_config(struct pcmcia_config_entry *);
-static void ray_attach(struct device *, struct device *, void *);
+static int ray_attach(struct device *, struct device *, void *);
static ray_cmd_func_t ray_ccs_done(struct ray_softc *, bus_size_t);
static void ray_check_ccs(void *);
static void ray_check_scheduled(void *);
@@ -497,7 +497,7 @@ ray_validate_config(struct pcmcia_config
return (0);
}
-static void
+static int
ray_attach(struct device *parent, struct device *self, void *aux)
{
struct ray_softc *sc = (void *)self;
@@ -514,7 +514,7 @@ ray_attach(struct device *parent, struct
if (error) {
aprint_error_dev(self, "configure failed, error=%d\n",
error);
- return;
+ return ENXIO;
}
cfe = pa->pf->cfe;
@@ -610,12 +610,13 @@ ray_attach(struct device *parent, struct
/* The attach is successful. */
sc->sc_attached = 1;
ray_disable(sc);
- return;
+ return 0;
fail2:
ray_disable(sc);
fail:
pcmcia_function_unconfigure(pa->pf);
+ return ENXIO;
}
static int
Index: sys/dev/pcmcia/if_sm_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/if_sm_pcmcia.c,v
retrieving revision 1.52
diff -u -p -r1.52 if_sm_pcmcia.c
--- sys/dev/pcmcia/if_sm_pcmcia.c 14 Mar 2009 15:36:20 -0000 1.52
+++ sys/dev/pcmcia/if_sm_pcmcia.c 1 May 2009 16:44:16 -0000
@@ -63,7 +63,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_sm_pcmcia
int sm_pcmcia_match(struct device *, struct cfdata *, void *);
int sm_pcmcia_validate_config(struct pcmcia_config_entry *);
-void sm_pcmcia_attach(struct device *, struct device *, void *);
+int sm_pcmcia_attach(struct device *, struct device *, void *);
int sm_pcmcia_detach(struct device *, int);
struct sm_pcmcia_softc {
@@ -131,7 +131,7 @@ sm_pcmcia_validate_config(struct pcmcia_
return (0);
}
-void
+int
sm_pcmcia_attach(struct device *parent, struct device *self, void *aux)
{
struct sm_pcmcia_softc *psc = (struct sm_pcmcia_softc *)self;
@@ -147,7 +147,7 @@ sm_pcmcia_attach(struct device *parent,
if (error) {
aprint_error_dev(self, "configure failed, error=%d\n",
error);
- return;
+ return ENXIO;
}
cfe = pa->pf->cfe;
@@ -178,10 +178,11 @@ sm_pcmcia_attach(struct device *parent,
psc->sc_state = SM_PCMCIA_ATTACHED;
sm_pcmcia_disable(sc);
- return;
+ return 0;
fail:
pcmcia_function_unconfigure(pa->pf);
+ return ENXIO;
}
int
Index: sys/dev/pcmcia/if_wi_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/if_wi_pcmcia.c,v
retrieving revision 1.82
diff -u -p -r1.82 if_wi_pcmcia.c
--- sys/dev/pcmcia/if_wi_pcmcia.c 14 Mar 2009 21:04:22 -0000 1.82
+++ sys/dev/pcmcia/if_wi_pcmcia.c 1 May 2009 16:44:16 -0000
@@ -76,7 +76,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia
static int wi_pcmcia_match(struct device *, struct cfdata *, void *);
static int wi_pcmcia_validate_config(struct pcmcia_config_entry *);
-static void wi_pcmcia_attach(struct device *, struct device *, void *);
+static int wi_pcmcia_attach(struct device *, struct device *, void *);
static int wi_pcmcia_detach(struct device *, int);
static int wi_pcmcia_enable(struct wi_softc *);
static void wi_pcmcia_disable(struct wi_softc *);
@@ -321,7 +321,7 @@ wi_pcmcia_validate_config(struct pcmcia_
return (0);
}
-static void
+static int
wi_pcmcia_attach(struct device *parent, struct device *self,
void *aux)
{
@@ -340,7 +340,7 @@ wi_pcmcia_attach(struct device *parent,
if (error) {
aprint_error_dev(self, "configure failed, error=%d\n",
error);
- return;
+ return ENXIO;
}
cfe = pa->pf->cfe;
@@ -383,12 +383,13 @@ wi_pcmcia_attach(struct device *parent,
wi_pcmcia_disable(sc);
psc->sc_state = WI_PCMCIA_ATTACHED;
- return;
+ return 0;
fail2:
wi_pcmcia_disable(sc);
fail:
pcmcia_function_unconfigure(pa->pf);
+ return ENXIO;
}
static int
Index: sys/dev/pcmcia/mhzc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/mhzc.c,v
retrieving revision 1.44
diff -u -p -r1.44 mhzc.c
--- sys/dev/pcmcia/mhzc.c 14 Mar 2009 15:36:20 -0000 1.44
+++ sys/dev/pcmcia/mhzc.c 1 May 2009 16:44:17 -0000
@@ -128,7 +128,7 @@ struct mhzc_softc {
#define MHZC_ETHERNET_ALLOCED 0x20
int mhzc_match(struct device *, struct cfdata *, void *);
-void mhzc_attach(struct device *, struct device *, void *);
+int mhzc_attach(struct device *, struct device *, void *);
int mhzc_detach(struct device *, int);
int mhzc_activate(struct device *, enum devact);
@@ -176,7 +176,7 @@ mhzc_match(struct device *parent, struct
return (0);
}
-void
+int
mhzc_attach(struct device *parent, struct device *self, void *aux)
{
struct mhzc_softc *sc = (void *)self;
@@ -255,11 +255,12 @@ mhzc_attach(struct device *parent, struc
sc->sc_ethernet = config_found(self, __UNCONST("sm"), mhzc_print);
mhzc_disable(sc, MHZC_MODEM_ENABLED|MHZC_ETHERNET_ENABLED);
- return;
+ return 0;
fail:
/* I/O spaces will be freed by detach. */
;
+ return ENXIO;
}
int
@@ -617,7 +618,7 @@ mhzc_em3336_ascii_enaddr(const char *cis
#if NCOM_MHZC > 0
int com_mhzc_match(device_t, cfdata_t , void *);
-void com_mhzc_attach(device_t, device_t, void *);
+int com_mhzc_attach(device_t, device_t, void *);
int com_mhzc_detach(device_t, int);
/* No mhzc-specific goo in the softc; it's all in the parent. */
@@ -640,7 +641,7 @@ com_mhzc_match(device_t parent, cfdata_t
return (0);
}
-void
+int
com_mhzc_attach(device_t parent, device_t self, void *aux)
{
struct com_softc *sc = device_private(self);
@@ -666,6 +667,7 @@ com_mhzc_attach(device_t parent, device_
com_attach_subr(sc);
sc->enabled = 0;
+ return 0;
}
int
@@ -690,7 +692,7 @@ com_mhzc_disable(struct com_softc *sc)
#if NSM_MHZC > 0
int sm_mhzc_match(struct device *, struct cfdata *, void *);
-void sm_mhzc_attach(struct device *, struct device *, void *);
+int sm_mhzc_attach(struct device *, struct device *, void *);
/* No mhzc-specific goo in the softc; it's all in the parent. */
CFATTACH_DECL(sm_mhzc, sizeof(struct smc91cxx_softc),
@@ -713,7 +715,7 @@ sm_mhzc_match(struct device *parent, str
return (0);
}
-void
+int
sm_mhzc_attach(struct device *parent, struct device *self, void *aux)
{
struct smc91cxx_softc *sc = (void *)self;
@@ -729,10 +731,11 @@ sm_mhzc_attach(struct device *parent, st
sc->sc_disable = sm_mhzc_disable;
if ((*msc->sc_product->mp_enaddr)(msc, myla) != 1)
- return;
+ return ENXIO;
/* Perform generic initialization. */
smc91cxx_attach(sc, myla);
+ return 0;
}
int
Index: sys/dev/pcmcia/pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/pcmcia.c,v
retrieving revision 1.91
diff -u -p -r1.91 pcmcia.c
--- sys/dev/pcmcia/pcmcia.c 2 Apr 2009 00:09:34 -0000 1.91
+++ sys/dev/pcmcia/pcmcia.c 1 May 2009 16:44:17 -0000
@@ -81,7 +81,7 @@ int pcmcia_verbose = 0;
#endif
int pcmcia_match(struct device *, struct cfdata *, void *);
-void pcmcia_attach(struct device *, struct device *, void *);
+int pcmcia_attach(struct device *, struct device *, void *);
int pcmcia_detach(device_t, int);
int pcmcia_rescan(struct device *, const char *, const int *);
void pcmcia_childdetached(struct device *, struct device *);
@@ -121,7 +121,7 @@ pcmcia_match(struct device *parent, stru
return (1);
}
-void
+int
pcmcia_attach(struct device *parent, struct device *self, void *aux)
{
struct pcmciabus_attach_args *paa = aux;
@@ -140,6 +140,7 @@ pcmcia_attach(struct device *parent, str
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
int
Index: sys/dev/pcmcia/pcmcom.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/pcmcom.c,v
retrieving revision 1.35
diff -u -p -r1.35 pcmcom.c
--- sys/dev/pcmcia/pcmcom.c 14 Mar 2009 15:36:20 -0000 1.35
+++ sys/dev/pcmcia/pcmcom.c 1 May 2009 16:44:17 -0000
@@ -90,7 +90,7 @@ struct pcmcom_attach_args {
int pcmcom_match(struct device *, struct cfdata *, void *);
int pcmcom_validate_config(struct pcmcia_config_entry *);
-void pcmcom_attach(struct device *, struct device *, void *);
+int pcmcom_attach(struct device *, struct device *, void *);
int pcmcom_detach(struct device *, int);
int pcmcom_activate(struct device *, enum devact);
@@ -136,7 +136,7 @@ pcmcom_validate_config(struct pcmcia_con
return (0);
}
-void
+int
pcmcom_attach(struct device *parent, struct device *self, void *aux)
{
struct pcmcom_softc *sc = (void *)self;
@@ -152,7 +152,7 @@ pcmcom_attach(struct device *parent, str
if (error) {
aprint_error_dev(self, "configure failed, error=%d\n",
error);
- return;
+ return ENXIO;
}
cfe = pa->pf->cfe;
@@ -181,10 +181,11 @@ pcmcom_attach(struct device *parent, str
pcmcom_disable(sc);
sc->sc_state = PCMCOM_ATTACHED;
- return;
+ return 0;
fail:
pcmcia_function_unconfigure(pa->pf);
+ return ENXIO;
}
int
@@ -316,7 +317,7 @@ pcmcom_disable(struct pcmcom_softc *sc)
#if NCOM_PCMCOM > 0
int com_pcmcom_match(device_t, cfdata_t , void *);
-void com_pcmcom_attach(device_t, device_t, void *);
+int com_pcmcom_attach(device_t, device_t, void *);
/* No pcmcom-specific goo in the softc; it's all in the parent. */
CFATTACH_DECL(com_pcmcom, sizeof(struct com_softc),
@@ -333,7 +334,7 @@ com_pcmcom_match(device_t parent, cfdata
return (1);
}
-void
+int
com_pcmcom_attach(device_t parent, device_t self, void *aux)
{
struct com_softc *sc = device_private(self);
@@ -351,6 +352,7 @@ com_pcmcom_attach(device_t parent, devic
com_attach_subr(sc);
sc->enabled = 0;
+ return 0;
}
int
Index: sys/dev/pcmcia/slhci_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/slhci_pcmcia.c,v
retrieving revision 1.4
diff -u -p -r1.4 slhci_pcmcia.c
--- sys/dev/pcmcia/slhci_pcmcia.c 28 Mar 2008 17:14:46 -0000 1.4
+++ sys/dev/pcmcia/slhci_pcmcia.c 1 May 2009 16:44:17 -0000
@@ -43,7 +43,7 @@ struct slhci_pcmcia_softc {
int slhci_pcmcia_probe(struct device *, struct cfdata *, void *);
-void slhci_pcmcia_attach(struct device *, struct device *, void *);
+int slhci_pcmcia_attach(struct device *, struct device *, void *);
int slhci_pcmcia_detach(struct device *, int);
int slhci_pcmcia_validate_config(struct pcmcia_config_entry *);
int slhci_pcmcia_enable(struct slhci_pcmcia_softc *, int);
@@ -82,7 +82,7 @@ slhci_pcmcia_validate_config(struct pcmc
return 0;
}
-void
+int
slhci_pcmcia_attach(struct device *parent, struct device *self, void *aux)
{
struct slhci_pcmcia_softc *psc = device_private(self);
@@ -96,7 +96,7 @@ slhci_pcmcia_attach(struct device *paren
slhci_pcmcia_enable(psc, 1);
- return;
+ return 0;
}
int
Index: sys/dev/pcmcia/spc_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/spc_pcmcia.c,v
retrieving revision 1.20
diff -u -p -r1.20 spc_pcmcia.c
--- sys/dev/pcmcia/spc_pcmcia.c 28 Apr 2008 20:23:56 -0000 1.20
+++ sys/dev/pcmcia/spc_pcmcia.c 1 May 2009 16:44:17 -0000
@@ -63,7 +63,7 @@ struct spc_pcmcia_softc {
static int spc_pcmcia_match(device_t, cfdata_t, void *);
static int spc_pcmcia_validate_config(struct pcmcia_config_entry *);
-static void spc_pcmcia_attach(device_t, device_t, void *);
+static int spc_pcmcia_attach(device_t, device_t, void *);
static int spc_pcmcia_detach(device_t, int);
static int spc_pcmcia_enable(device_t, int);
@@ -98,7 +98,7 @@ spc_pcmcia_validate_config(struct pcmcia
return 0;
}
-void
+int
spc_pcmcia_attach(device_t parent, device_t self, void *aux)
{
struct spc_pcmcia_softc *sc = device_private(self);
@@ -114,7 +114,7 @@ spc_pcmcia_attach(device_t parent, devic
error = pcmcia_function_configure(pf, spc_pcmcia_validate_config);
if (error) {
aprint_error_dev(self, "configure failed, error=%d\n", error);
- return;
+ return ENXIO;
}
cfe = pf->cfe;
@@ -135,10 +135,11 @@ spc_pcmcia_attach(device_t parent, devic
spc_attach(spc);
scsipi_adapter_delref(&spc->sc_adapter);
sc->sc_state = SPC_PCMCIA_ATTACHED;
- return;
+ return 0;
fail:
pcmcia_function_unconfigure(pf);
+ return ENXIO;
}
int
Index: sys/dev/pcmcia/wdc_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/wdc_pcmcia.c,v
retrieving revision 1.115
diff -u -p -r1.115 wdc_pcmcia.c
--- sys/dev/pcmcia/wdc_pcmcia.c 5 Apr 2009 02:35:03 -0000 1.115
+++ sys/dev/pcmcia/wdc_pcmcia.c 1 May 2009 16:44:17 -0000
@@ -85,7 +85,7 @@ struct wdc_pcmcia_softc {
static int wdc_pcmcia_match(device_t, cfdata_t, void *);
static int wdc_pcmcia_validate_config_io(struct pcmcia_config_entry *);
static int wdc_pcmcia_validate_config_memory(struct pcmcia_config_entry *);
-static void wdc_pcmcia_attach(device_t, device_t, void *);
+static int wdc_pcmcia_attach(device_t, device_t, void *);
static int wdc_pcmcia_detach(device_t, int);
CFATTACH_DECL_NEW(wdc_pcmcia, sizeof(struct wdc_pcmcia_softc),
@@ -203,7 +203,7 @@ wdc_pcmcia_validate_config_memory(struct
return (0);
}
-static void
+static int
wdc_pcmcia_attach(device_t parent, device_t self, void *aux)
{
struct wdc_pcmcia_softc *sc = device_private(self);
@@ -228,7 +228,7 @@ wdc_pcmcia_attach(device_t parent, devic
wdc_pcmcia_validate_config_memory);
if (error) {
aprint_error_dev(self, "configure failed, error=%d\n", error);
- return;
+ return ENXIO;
}
cfe = pa->pf->cfe;
@@ -327,10 +327,11 @@ wdc_pcmcia_attach(device_t parent, devic
config_pending_decr();
ata_delref(&sc->ata_channel);
sc->sc_state = WDC_PCMCIA_ATTACHED;
- return;
+ return 0;
fail:
pcmcia_function_unconfigure(pa->pf);
+ return ENXIO;
}
static int
Index: sys/dev/pcmcia/xirc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/xirc.c,v
retrieving revision 1.27
diff -u -p -r1.27 xirc.c
--- sys/dev/pcmcia/xirc.c 14 Mar 2009 21:04:22 -0000 1.27
+++ sys/dev/pcmcia/xirc.c 1 May 2009 16:44:17 -0000
@@ -122,7 +122,7 @@ struct xirc_softc {
};
int xirc_match(struct device *, struct cfdata *, void *);
-void xirc_attach(struct device *, struct device *, void *);
+int xirc_attach(struct device *, struct device *, void *);
int xirc_detach(struct device *, int);
int xirc_activate(struct device *, enum devact);
@@ -167,7 +167,7 @@ xirc_match(struct device *parent, struct
return (0);
}
-void
+int
xirc_attach(struct device *parent, struct device *self, void *aux)
{
struct xirc_softc *sc = (void *)self;
@@ -183,7 +183,7 @@ xirc_attach(struct device *parent, struc
pcmcia_socket_disable(parent);
if (!rv) {
aprint_error_dev(self, "failed to find ID\n");
- return;
+ return ENXIO;
}
switch (sc->sc_id & 0x100f) {
@@ -210,7 +210,7 @@ xirc_attach(struct device *parent, struc
default:
aprint_error_dev(self, "unknown ID %04x\n",
sc->sc_id);
- return;
+ return ENXIO;
}
aprint_normal_dev(self, "id=%04x\n", sc->sc_id);
@@ -272,11 +272,12 @@ xirc_attach(struct device *parent, struc
xirc_disable(sc, XIRC_MODEM_ENABLED|XIRC_ETHERNET_ENABLED,
sc->sc_id & (XIMEDIA_MODEM|XIMEDIA_ETHER));
- return;
+ return 0;
fail:
/* I/O spaces will be freed by detach. */
;
+ return ENXIO;
}
int
@@ -548,7 +549,7 @@ xirc_disable(struct xirc_softc *sc, int
#if NCOM_XIRC > 0
int com_xirc_match(device_t, cfdata_t , void *);
-void com_xirc_attach(device_t, device_t, void *);
+int com_xirc_attach(device_t, device_t, void *);
int com_xirc_detach(device_t, int);
/* No xirc-specific goo in the softc; it's all in the parent. */
@@ -570,7 +571,7 @@ com_xirc_match(device_t parent, cfdata_t
return (0);
}
-void
+int
com_xirc_attach(device_t parent, device_t self, void *aux)
{
struct com_softc *sc = device_private(self);
@@ -597,6 +598,7 @@ com_xirc_attach(device_t parent, device_
com_attach_subr(sc);
sc->enabled = 0;
+ return 0;
}
int
@@ -623,7 +625,7 @@ com_xirc_disable(struct com_softc *sc)
#if NXI_XIRC > 0
int xi_xirc_match(struct device *, struct cfdata *, void *);
-void xi_xirc_attach(struct device *, struct device *, void *);
+int xi_xirc_attach(struct device *, struct device *, void *);
/* No xirc-specific goo in the softc; it's all in the parent. */
CFATTACH_DECL(xi_xirc, sizeof(struct xi_softc),
@@ -646,7 +648,7 @@ xi_xirc_match(struct device *parent, str
return (0);
}
-void
+int
xi_xirc_attach(struct device *parent, struct device *self, void *aux)
{
struct xi_softc *sc = (void *)self;
@@ -666,11 +668,12 @@ xi_xirc_attach(struct device *parent, st
if (!pcmcia_scan_cis(device_parent(&msc->sc_dev),
xi_xirc_lan_nid_ciscallback, myla)) {
aprint_error_dev(self, "can't find MAC address\n");
- return;
+ return ENXIO;
}
/* Perform generic initialization. */
xi_attach(sc, myla);
+ return 0;
}
int
Index: sys/dev/raidframe/rf_netbsdkintf.c
===================================================================
RCS file: /cvsroot/src/sys/dev/raidframe/rf_netbsdkintf.c,v
retrieving revision 1.260
diff -u -p -r1.260 rf_netbsdkintf.c
--- sys/dev/raidframe/rf_netbsdkintf.c 3 Apr 2009 16:23:41 -0000 1.260
+++ sys/dev/raidframe/rf_netbsdkintf.c 1 May 2009 16:44:18 -0000
@@ -219,7 +219,7 @@ static void raidinit(RF_Raid_t *);
void raidattach(int);
static int raid_match(struct device *, struct cfdata *, void *);
-static void raid_attach(struct device *, struct device *, void *);
+static int raid_attach(struct device *, struct device *, void *);
static int raid_detach(struct device *, int);
dev_type_open(raidopen);
@@ -3604,11 +3604,11 @@ raid_match(struct device *self, struct c
return 1;
}
-static void
+static int
raid_attach(struct device *parent, struct device *self,
void *aux)
{
-
+ return 0;
}
Index: sys/dev/scsipi/atapiconf.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/atapiconf.c,v
retrieving revision 1.78
diff -u -p -r1.78 atapiconf.c
--- sys/dev/scsipi/atapiconf.c 7 Apr 2009 18:35:17 -0000 1.78
+++ sys/dev/scsipi/atapiconf.c 1 May 2009 16:44:18 -0000
@@ -57,7 +57,7 @@ const struct scsipi_periphsw atapi_probe
};
static int atapibusmatch(device_t, cfdata_t, void *);
-static void atapibusattach(device_t, device_t, void *);
+static int atapibusattach(device_t, device_t, void *);
static int atapibusactivate(device_t, enum devact);
static int atapibusdetach(device_t, int flags);
static void atapibuschilddet(device_t, device_t);
@@ -141,7 +141,7 @@ atapibussubmatch(device_t parent, cfdata
return (config_match(parent, cf, aux));
}
-static void
+static int
atapibusattach(device_t parent, device_t self, void *aux)
{
struct atapibus_softc *sc = device_private(self);
@@ -166,7 +166,7 @@ atapibusattach(device_t parent, device_t
aprint_error_dev(self, "couldn't establish power handler\n");
/* Probe the bus for devices. */
- atapi_probe_bus(sc, -1);
+ return atapi_probe_bus(sc, -1);
}
static int
Index: sys/dev/scsipi/cd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/cd.c,v
retrieving revision 1.292
diff -u -p -r1.292 cd.c
--- sys/dev/scsipi/cd.c 7 Apr 2009 18:35:17 -0000 1.292
+++ sys/dev/scsipi/cd.c 1 May 2009 16:44:19 -0000
@@ -170,7 +170,7 @@ static int cd_load_unload(struct cd_soft
static int cd_setblksize(struct cd_softc *);
static int cdmatch(device_t, cfdata_t, void *);
-static void cdattach(device_t, device_t, void *);
+static int cdattach(device_t, device_t, void *);
static int cdactivate(device_t, enum devact);
static int cddetach(device_t, int);
@@ -243,7 +243,7 @@ cdmatch(device_t parent, cfdata_t match,
return (priority);
}
-static void
+static int
cdattach(device_t parent, device_t self, void *aux)
{
struct cd_softc *cd = device_private(self);
@@ -296,6 +296,7 @@ cdattach(device_t parent, device_t self,
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static int
Index: sys/dev/scsipi/ch.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/ch.c,v
retrieving revision 1.82
diff -u -p -r1.82 ch.c
--- sys/dev/scsipi/ch.c 8 Jun 2008 18:18:34 -0000 1.82
+++ sys/dev/scsipi/ch.c 1 May 2009 16:44:19 -0000
@@ -100,7 +100,7 @@ struct ch_softc {
/* Autoconfiguration glue */
static int chmatch(struct device *, struct cfdata *, void *);
-static void chattach(struct device *, struct device *, void *);
+static int chattach(struct device *, struct device *, void *);
CFATTACH_DECL(ch, sizeof(struct ch_softc),
chmatch, chattach, NULL, NULL);
@@ -186,7 +186,7 @@ chmatch(struct device *parent, struct cf
return (priority);
}
-static void
+static int
chattach(struct device *parent, struct device *self, void *aux)
{
struct ch_softc *sc = device_private(self);
@@ -246,6 +246,7 @@ chattach(struct device *parent, struct d
/* Default the current picker. */
sc->sc_picker = sc->sc_firsts[CHET_MT];
+ return 0;
}
static int
Index: sys/dev/scsipi/scsiconf.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/scsiconf.c,v
retrieving revision 1.251
diff -u -p -r1.251 scsiconf.c
--- sys/dev/scsipi/scsiconf.c 7 Apr 2009 18:35:17 -0000 1.251
+++ sys/dev/scsipi/scsiconf.c 1 May 2009 16:44:19 -0000
@@ -88,7 +88,7 @@ static struct simplelock scsibus_interlo
static int scsi_probe_device(struct scsibus_softc *, int, int);
static int scsibusmatch(struct device *, struct cfdata *, void *);
-static void scsibusattach(struct device *, struct device *, void *);
+static int scsibusattach(struct device *, struct device *, void *);
static int scsibusactivate(struct device *, enum devact);
static int scsibusdetach(struct device *, int flags);
static int scsibusrescan(struct device *, const char *, const int *);
@@ -152,7 +152,7 @@ scsibusmatch(struct device *parent, stru
return (1);
}
-static void
+static int
scsibusattach(struct device *parent, struct device *self, void *aux)
{
struct scsibus_softc *sc = device_private(self);
@@ -174,7 +174,7 @@ scsibusattach(struct device *parent, str
chan->chan_nluns == 1 ? "" : "s");
if (scsipi_adapter_addref(chan->chan_adapter))
- return;
+ return ENXIO;
/* Initialize the channel structure first */
chan->chan_init_cb = scsibus_config;
@@ -186,8 +186,9 @@ scsibusattach(struct device *parent, str
config_pending_incr();
if (scsipi_channel_init(chan)) {
aprint_error_dev(sc->sc_dev, "failed to init channel\n");
- return;
+ return ENXIO;
}
+ return 0;
}
static void
Index: sys/dev/scsipi/sd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/sd.c,v
retrieving revision 1.279
diff -u -p -r1.279 sd.c
--- sys/dev/scsipi/sd.c 10 Apr 2009 17:36:42 -0000 1.279
+++ sys/dev/scsipi/sd.c 1 May 2009 16:44:20 -0000
@@ -124,7 +124,7 @@ static int sd_getcache(struct sd_softc *
static int sd_setcache(struct sd_softc *, int);
static int sdmatch(struct device *, struct cfdata *, void *);
-static void sdattach(struct device *, struct device *, void *);
+static int sdattach(struct device *, struct device *, void *);
static int sdactivate(struct device *, enum devact);
static int sddetach(struct device *, int);
static void sd_set_properties(struct sd_softc *);
@@ -211,7 +211,7 @@ sdmatch(struct device *parent, struct cf
/*
* Attach routine common to atapi & scsi.
*/
-static void
+static int
sdattach(struct device *parent, struct device *self, void *aux)
{
struct sd_softc *sd = device_private(self);
@@ -324,6 +324,7 @@ sdattach(struct device *parent, struct d
dkwedge_discover(&sd->sc_dk);
sd_set_properties(sd);
+ return 0;
}
static int
Index: sys/dev/scsipi/ses.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/ses.c,v
retrieving revision 1.40
diff -u -p -r1.40 ses.c
--- sys/dev/scsipi/ses.c 8 Jun 2008 18:18:34 -0000 1.40
+++ sys/dev/scsipi/ses.c 1 May 2009 16:44:20 -0000
@@ -168,7 +168,7 @@ struct ses_softc {
#define SESUNIT(x) (minor((x)))
static int ses_match(struct device *, struct cfdata *, void *);
-static void ses_attach(struct device *, struct device *, void *);
+static int ses_attach(struct device *, struct device *, void *);
static enctyp ses_device_type(struct scsipibus_attach_args *);
CFATTACH_DECL(ses, sizeof (struct ses_softc),
@@ -212,7 +212,7 @@ ses_match(struct device *parent, struct
* it's not until the return from the match routine that we have
* the softc available to set stuff in.
*/
-static void
+static int
ses_attach(struct device *parent, struct device *self, void *aux)
{
const char *tname;
@@ -275,6 +275,7 @@ ses_attach(struct device *parent, struct
break;
}
printf("\n%s: %s\n", device_xname(&softc->sc_device), tname);
+ return 0;
}
Index: sys/dev/scsipi/ss.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/ss.c,v
retrieving revision 1.76
diff -u -p -r1.76 ss.c
--- sys/dev/scsipi/ss.c 13 Jan 2009 13:35:54 -0000 1.76
+++ sys/dev/scsipi/ss.c 1 May 2009 16:44:20 -0000
@@ -70,7 +70,7 @@ __KERNEL_RCSID(0, "$NetBSD: ss.c,v 1.76
#define MODE_CONTROL 3
static int ssmatch(struct device *, struct cfdata *, void *);
-static void ssattach(struct device *, struct device *, void *);
+static int ssattach(struct device *, struct device *, void *);
static int ssdetach(struct device *self, int flags);
static int ssactivate(struct device *self, enum devact act);
@@ -141,7 +141,7 @@ ssmatch(struct device *parent, struct cf
* If it is a know special, call special attach routine to install
* special handlers into the ss_softc structure
*/
-static void
+static int
ssattach(struct device *parent, struct device *self, void *aux)
{
struct ss_softc *ss = device_private(self);
@@ -183,6 +183,7 @@ ssattach(struct device *parent, struct d
}
ss->flags &= ~SSF_AUTOCONF;
+ return 0;
}
static int
Index: sys/dev/scsipi/st_atapi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/st_atapi.c,v
retrieving revision 1.20
diff -u -p -r1.20 st_atapi.c
--- sys/dev/scsipi/st_atapi.c 16 Nov 2006 01:33:26 -0000 1.20
+++ sys/dev/scsipi/st_atapi.c 1 May 2009 16:44:20 -0000
@@ -48,7 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: st_atapi.c,v
#include <dev/scsipi/atapi_tape.h>
static int st_atapibus_match(struct device *, struct cfdata *, void *);
-static void st_atapibus_attach(struct device *, struct device *, void *);
+static int st_atapibus_attach(struct device *, struct device *, void *);
static int st_atapibus_ops(struct st_softc *, int, int);
static int st_atapibus_mode_sense(struct st_softc *, int);
static int st_atapibus_mode_select(struct st_softc *, int);
@@ -78,7 +78,7 @@ st_atapibus_match(struct device *parent,
return (priority);
}
-static void
+static int
st_atapibus_attach(struct device *parent, struct device *self, void *aux)
{
struct st_softc *st = device_private(self);
@@ -95,7 +95,7 @@ st_atapibus_attach(struct device *parent
ST_RETRIES, ST_CTL_TIME);
if (error) {
printf("onstream get identify: error %d\n", error);
- return;
+ return ENXIO;
}
strncpy(identify.ident, "NBSD", 4);
error = scsipi_mode_select(periph, SMS_PF,
@@ -104,12 +104,13 @@ st_atapibus_attach(struct device *parent
ST_RETRIES, ST_CTL_TIME);
if (error) {
printf("onstream set identify: error %d\n", error);
- return;
+ return ENXIO;
}
}
st->ops = st_atapibus_ops;
stattach(parent, st, aux);
+ return 0;
}
static int
Index: sys/dev/scsipi/st_scsi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/st_scsi.c,v
retrieving revision 1.27
diff -u -p -r1.27 st_scsi.c
--- sys/dev/scsipi/st_scsi.c 28 Apr 2008 20:23:58 -0000 1.27
+++ sys/dev/scsipi/st_scsi.c 1 May 2009 16:44:21 -0000
@@ -68,7 +68,7 @@ __KERNEL_RCSID(0, "$NetBSD: st_scsi.c,v
#include <dev/scsipi/stvar.h>
static int st_scsibus_match(struct device *, struct cfdata *, void *);
-static void st_scsibus_attach(struct device *, struct device *, void *);
+static int st_scsibus_attach(struct device *, struct device *, void *);
static int st_scsibus_ops(struct st_softc *, int, int);
static int st_scsibus_read_block_limits(struct st_softc *, int);
static int st_scsibus_mode_sense(struct st_softc *, int);
@@ -100,13 +100,14 @@ st_scsibus_match(struct device *parent,
return (priority);
}
-static void
+static int
st_scsibus_attach(struct device *parent, struct device *self, void *aux)
{
struct st_softc *st = device_private(self);
st->ops = st_scsibus_ops;
stattach(parent, st, aux);
+ return ENXIO;
}
static int
Index: sys/dev/scsipi/uk.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/uk.c,v
retrieving revision 1.56
diff -u -p -r1.56 uk.c
--- sys/dev/scsipi/uk.c 11 Jan 2009 10:58:26 -0000 1.56
+++ sys/dev/scsipi/uk.c 1 May 2009 16:44:21 -0000
@@ -59,7 +59,7 @@ struct uk_softc {
};
static int ukmatch(struct device *, struct cfdata *, void *);
-static void ukattach(struct device *, struct device *, void *);
+static int ukattach(struct device *, struct device *, void *);
static int ukactivate(struct device *, enum devact);
static int ukdetach(struct device *, int);
@@ -90,7 +90,7 @@ ukmatch(struct device *parent, struct cf
* The routine called by the low level scsi routine when it discovers
* a device suitable for this driver.
*/
-static void
+static int
ukattach(struct device *parent, struct device *self, void *aux)
{
struct uk_softc *uk = device_private(self);
@@ -106,6 +106,7 @@ ukattach(struct device *parent, struct d
periph->periph_dev = &uk->sc_dev;
printf("\n");
+ return 0;
}
static int
Index: sys/dev/sdmmc/ld_sdmmc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/sdmmc/ld_sdmmc.c,v
retrieving revision 1.1
diff -u -p -r1.1 ld_sdmmc.c
--- sys/dev/sdmmc/ld_sdmmc.c 21 Apr 2009 03:00:30 -0000 1.1
+++ sys/dev/sdmmc/ld_sdmmc.c 1 May 2009 16:44:21 -0000
@@ -78,7 +78,7 @@ struct ld_sdmmc_softc {
};
static int ld_sdmmc_match(device_t, struct cfdata *, void *);
-static void ld_sdmmc_attach(device_t, device_t, void *);
+static int ld_sdmmc_attach(device_t, device_t, void *);
static int ld_sdmmc_detach(device_t, int);
static int ld_sdmmc_dump(struct ld_softc *, void *, int, int);
@@ -103,7 +103,7 @@ ld_sdmmc_match(device_t parent, struct c
}
/* ARGSUSED */
-static void
+static int
ld_sdmmc_attach(device_t parent, device_t self, void *aux)
{
struct ld_sdmmc_softc *sc = device_private(self);
@@ -129,6 +129,7 @@ ld_sdmmc_attach(device_t parent, device_
ld->sc_start = ld_sdmmc_start;
ldattach(ld);
+ return 0;
}
static int
Index: sys/dev/sdmmc/sbt.c
===================================================================
RCS file: /cvsroot/src/sys/dev/sdmmc/sbt.c,v
retrieving revision 1.1
diff -u -p -r1.1 sbt.c
--- sys/dev/sdmmc/sbt.c 21 Apr 2009 03:00:30 -0000 1.1
+++ sys/dev/sdmmc/sbt.c 1 May 2009 16:44:21 -0000
@@ -77,7 +77,7 @@ struct sbt_softc {
#define SBT_ENABLED (1 << 1) /* device is enabled */
static int sbt_match(device_t, struct cfdata *, void *);
-static void sbt_attach(device_t, device_t, void *);
+static int sbt_attach(device_t, device_t, void *);
static int sbt_detach(device_t, int);
CFATTACH_DECL_NEW(sbt, sizeof(struct sbt_softc),
@@ -158,7 +158,7 @@ sbt_match(device_t parent, struct cfdata
return 0;
}
-static void
+static int
sbt_attach(device_t parent, device_t self, void *aux)
{
struct sbt_softc *sc = device_private(self);
@@ -176,7 +176,7 @@ sbt_attach(device_t parent, device_t sel
(void)sdmmc_io_function_disable(sc->sc_sf);
if (sdmmc_io_function_enable(sc->sc_sf)) {
printf("%s: function not ready\n", DEVNAME(sc));
- return;
+ return ENXIO;
}
/* It may be Type-B, but we use it only in Type-A mode. */
@@ -185,7 +185,7 @@ sbt_attach(device_t parent, device_t sel
sc->sc_buf = malloc(SBT_PKT_BUFSIZ, M_DEVBUF, M_NOWAIT | M_CANFAIL);
if (sc->sc_buf == NULL) {
printf("%s: can't allocate cmd buffer\n", DEVNAME(sc));
- return;
+ return ENXIO;
}
/* Enable the HCI packet transport read interrupt. */
@@ -195,7 +195,7 @@ sbt_attach(device_t parent, device_t sel
sc->sc_ih = sdmmc_intr_establish(parent, sbt_intr, sc, DEVNAME(sc));
if (sc->sc_ih == NULL) {
printf("%s: can't establish interrupt\n", DEVNAME(sc));
- return;
+ return ENXIO;
}
sdmmc_intr_enable(sc->sc_sf);
@@ -203,6 +203,7 @@ sbt_attach(device_t parent, device_t sel
* Attach Bluetooth unit (machine-independent HCI).
*/
sc->sc_unit = hci_attach(&sbt_hci, self, 0);
+ return 0;
}
static int
Index: sys/dev/sdmmc/sdmmc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/sdmmc/sdmmc.c,v
retrieving revision 1.1
diff -u -p -r1.1 sdmmc.c
--- sys/dev/sdmmc/sdmmc.c 21 Apr 2009 03:00:30 -0000 1.1
+++ sys/dev/sdmmc/sdmmc.c 1 May 2009 16:44:21 -0000
@@ -76,7 +76,7 @@ static void sdmmc_dump_command(struct sd
#define DEVNAME(sc) SDMMCDEVNAME(sc)
static int sdmmc_match(device_t, cfdata_t, void *);
-static void sdmmc_attach(device_t, device_t, void *);
+static int sdmmc_attach(device_t, device_t, void *);
static int sdmmc_detach(device_t, int);
CFATTACH_DECL_NEW(sdmmc, sizeof(struct sdmmc_softc),
@@ -103,7 +103,7 @@ sdmmc_match(device_t parent, cfdata_t cf
return 0;
}
-static void
+static int
sdmmc_attach(device_t parent, device_t self, void *aux)
{
struct sdmmc_softc *sc = device_private(self);
@@ -129,7 +129,7 @@ sdmmc_attach(device_t parent, device_t s
if (error) {
aprint_error_dev(sc->sc_dev,
"couldn't create dma map. (error=%d)\n", error);
- return;
+ return ENXIO;
}
}
@@ -158,6 +158,7 @@ sdmmc_attach(device_t parent, device_t s
*/
config_pending_incr();
config_interrupts(self, sdmmc_doattach);
+ return 0;
}
static int
Index: sys/dev/usb/pseye.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/pseye.c,v
retrieving revision 1.11
diff -u -p -r1.11 pseye.c
--- sys/dev/usb/pseye.c 3 Feb 2009 13:31:24 -0000 1.11
+++ sys/dev/usb/pseye.c 1 May 2009 16:44:21 -0000
@@ -100,7 +100,7 @@ struct pseye_softc {
};
static int pseye_match(device_t, cfdata_t, void *);
-static void pseye_attach(device_t, device_t, void *);
+static int pseye_attach(device_t, device_t, void *);
static int pseye_detach(device_t, int);
static void pseye_childdet(device_t, device_t);
static int pseye_activate(device_t, enum devact);
@@ -174,7 +174,7 @@ pseye_match(device_t parent, cfdata_t ma
return UMATCH_NONE;
}
-static void
+static int
pseye_attach(device_t parent, device_t self, void *opaque)
{
struct pseye_softc *sc = device_private(self);
@@ -203,7 +203,7 @@ pseye_attach(device_t parent, device_t s
if (id == NULL) {
aprint_error_dev(self, "failed to get interface descriptor\n");
sc->sc_dying = 1;
- return;
+ return ENXIO;
}
for (i = 0; i < id->bNumEndpoints; i++) {
@@ -211,7 +211,7 @@ pseye_attach(device_t parent, device_t s
if (ed == NULL) {
aprint_error_dev(self, "couldn't get ep %d\n", i);
sc->sc_dying = 1;
- return;
+ return ENXIO;
}
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
@@ -224,7 +224,7 @@ pseye_attach(device_t parent, device_t s
if (ed_bulkin == NULL) {
aprint_error_dev(self, "no bulk-in endpoint found\n");
sc->sc_dying = 1;
- return;
+ return ENXIO;
}
sc->sc_bulkin = ed_bulkin->bEndpointAddress;
@@ -232,7 +232,7 @@ pseye_attach(device_t parent, device_t s
sc->sc_bulkin_xfer = usbd_alloc_xfer(sc->sc_udev);
if (sc->sc_bulkin_xfer == NULL) {
sc->sc_dying = 1;
- return;
+ return ENXIO;
}
sc->sc_bulkin_buffer = usbd_alloc_buffer(sc->sc_bulkin_xfer,
sc->sc_bulkin_bufferlen);
@@ -240,7 +240,7 @@ pseye_attach(device_t parent, device_t s
usbd_free_xfer(sc->sc_bulkin_xfer);
sc->sc_bulkin_xfer = NULL;
sc->sc_dying = 1;
- return;
+ return ENXIO;
}
pseye_init(sc);
@@ -252,12 +252,12 @@ pseye_attach(device_t parent, device_t s
if (sc->sc_videodev == NULL) {
aprint_error_dev(self, "couldn't attach video layer\n");
sc->sc_dying = 1;
- return;
+ return ENXIO;
}
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
USBDEV(self));
-
+ return 0;
}
static int
Index: sys/dev/usb/stuirda.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/stuirda.c,v
retrieving revision 1.9
diff -u -p -r1.9 stuirda.c
--- sys/dev/usb/stuirda.c 13 Oct 2008 10:01:24 -0000 1.9
+++ sys/dev/usb/stuirda.c 1 May 2009 16:44:21 -0000
@@ -124,6 +124,7 @@ USB_ATTACH(stuirda)
sc->sc_uirda.sc_hdszi = STUIRDA_HEADER_SIZE;
uirda_attach(parent,self,aux);
+ return 0;
}
int
Index: sys/dev/usb/u3g.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/u3g.c,v
retrieving revision 1.6
diff -u -p -r1.6 u3g.c
--- sys/dev/usb/u3g.c 3 Jan 2009 03:43:23 -0000 1.6
+++ sys/dev/usb/u3g.c 1 May 2009 16:44:21 -0000
@@ -309,7 +309,7 @@ u3g_match(device_t parent, cfdata_t matc
return UMATCH_NONE;
}
-static void
+static int
u3g_attach(device_t parent, device_t self, void *aux)
{
struct u3g_softc *sc = device_private(self);
@@ -329,7 +329,7 @@ u3g_attach(device_t parent, device_t sel
uaa->product == USB_PRODUCT_NOVATEL2_MC950D_DRIVER) {
/* About to disappear... */
sc->sc_pseudodev = true;
- return;
+ return ENXIO;
}
sc->sc_dev = self;
@@ -342,7 +342,7 @@ u3g_attach(device_t parent, device_t sel
if (error) {
aprint_error_dev(self, "failed to set configuration: %s\n",
usbd_errstr(error));
- return;
+ return ENXIO;
}
/* get the config descriptor */
@@ -350,20 +350,20 @@ u3g_attach(device_t parent, device_t sel
if (cdesc == NULL) {
aprint_error_dev(self, "failed to get configuration
descriptor\n");
- return;
+ return ENXIO;
}
if (uaa->vendor == USB_VENDOR_HUAWEI && cdesc->bNumInterface > 1) {
/* About to disappear... */
sc->sc_pseudodev = true;
- return;
+ return ENXIO;
}
if (uaa->vendor == USB_VENDOR_SIERRA &&
uaa->product == USB_PRODUCT_SIERRA_INSTALLER) {
/* About to disappear... */
sc->sc_pseudodev = true;
- return;
+ return ENXIO;
}
sc->sc_udev = dev;
@@ -376,7 +376,7 @@ u3g_attach(device_t parent, device_t sel
aprint_error_dev(self,
"failed to get interface, err=%s\n",
usbd_errstr(error));
- return;
+ return ENXIO;
}
id = usbd_get_interface_descriptor(iface);
@@ -397,7 +397,7 @@ u3g_attach(device_t parent, device_t sel
if (ed == NULL) {
aprint_error_dev(self,
"could not read endpoint descriptor\n");
- return;
+ return ENXIO;
}
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK)
@@ -408,7 +408,7 @@ u3g_attach(device_t parent, device_t sel
}
if (uca.bulkin == -1 || uca.bulkout == -1) {
aprint_error_dev(self, "missing endpoint\n");
- return;
+ return ENXIO;
}
sc->sc_ucom[i] = config_found_sm_loc(self, "ucombus", NULL,
&uca,
@@ -431,7 +431,7 @@ u3g_attach(device_t parent, device_t sel
aprint_error_dev(self,
"cannot open interrupt pipe (addr %d)\n",
sc->sc_intr_number);
- return;
+ return ENXIO;
}
}
#endif
@@ -439,6 +439,7 @@ u3g_attach(device_t parent, device_t sel
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
static int
Index: sys/dev/usb/uaudio.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uaudio.c,v
retrieving revision 1.115
diff -u -p -r1.115 uaudio.c
--- sys/dev/usb/uaudio.c 9 Mar 2009 15:59:33 -0000 1.115
+++ sys/dev/usb/uaudio.c 1 May 2009 16:44:22 -0000
@@ -356,7 +356,7 @@ Static struct audio_device uaudio_device
};
int uaudio_match(device_t, cfdata_t, void *);
-void uaudio_attach(device_t, device_t, void *);
+int uaudio_attach(device_t, device_t, void *);
int uaudio_detach(device_t, int);
void uaudio_childdet(device_t, device_t);
int uaudio_activate(device_t, enum devact);
Index: sys/dev/usb/ubsa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ubsa.c,v
retrieving revision 1.23
diff -u -p -r1.23 ubsa.c
--- sys/dev/usb/ubsa.c 24 May 2008 16:40:58 -0000 1.23
+++ sys/dev/usb/ubsa.c 1 May 2009 16:44:22 -0000
@@ -138,7 +138,7 @@ Static const struct usb_devno ubsa_devs[
#define ubsa_lookup(v, p) usb_lookup(ubsa_devs, v, p)
int ubsa_match(device_t, cfdata_t, void *);
-void ubsa_attach(device_t, device_t, void *);
+int ubsa_attach(device_t, device_t, void *);
void ubsa_childdet(device_t, device_t);
int ubsa_detach(device_t, int);
int ubsa_activate(device_t, enum devact);
Index: sys/dev/usb/uchcom.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uchcom.c,v
retrieving revision 1.7
diff -u -p -r1.7 uchcom.c
--- sys/dev/usb/uchcom.c 22 Oct 2008 10:35:50 -0000 1.7
+++ sys/dev/usb/uchcom.c 1 May 2009 16:44:22 -0000
@@ -207,7 +207,7 @@ struct ucom_methods uchcom_methods = {
};
int uchcom_match(device_t, cfdata_t, void *);
-void uchcom_attach(device_t, device_t, void *);
+int uchcom_attach(device_t, device_t, void *);
void uchcom_childdet(device_t, device_t);
int uchcom_detach(device_t, int);
int uchcom_activate(device_t, enum devact);
Index: sys/dev/usb/ucycom.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ucycom.c,v
retrieving revision 1.25
diff -u -p -r1.25 ucycom.c
--- sys/dev/usb/ucycom.c 20 Jan 2009 18:20:48 -0000 1.25
+++ sys/dev/usb/ucycom.c 1 May 2009 16:44:22 -0000
@@ -182,7 +182,7 @@ ucycom_match(device_t parent, cfdata_t m
UMATCH_VENDOR_PRODUCT : UMATCH_NONE);
}
-void
+int
ucycom_attach(device_t parent, device_t self, void *aux)
{
struct ucycom_softc *sc = device_private(self);
@@ -213,6 +213,7 @@ ucycom_attach(device_t parent, device_t
/* Nothing interesting to report */
aprint_normal("\n");
+ return 0;
}
Index: sys/dev/usb/udsbr.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/udsbr.c,v
retrieving revision 1.15
diff -u -p -r1.15 udsbr.c
--- sys/dev/usb/udsbr.c 24 May 2008 16:40:58 -0000 1.15
+++ sys/dev/usb/udsbr.c 1 May 2009 16:44:22 -0000
@@ -97,7 +97,7 @@ Static void udsbr_setfreq(struct udsbr_s
Static int udsbr_status(struct udsbr_softc *sc);
int udsbr_match(device_t, cfdata_t, void *);
-void udsbr_attach(device_t, device_t, void *);
+int udsbr_attach(device_t, device_t, void *);
void udsbr_childdet(device_t, device_t);
int udsbr_detach(device_t, int);
int udsbr_activate(device_t, enum devact);
Index: sys/dev/usb/uep.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uep.c,v
retrieving revision 1.12
diff -u -p -r1.12 uep.c
--- sys/dev/usb/uep.c 24 May 2008 16:40:58 -0000 1.12
+++ sys/dev/usb/uep.c 1 May 2009 16:44:22 -0000
@@ -99,7 +99,7 @@ const struct wsmouse_accessops uep_acces
};
int uep_match(device_t, cfdata_t, void *);
-void uep_attach(device_t, device_t, void *);
+int uep_attach(device_t, device_t, void *);
void uep_childdet(device_t, device_t);
int uep_detach(device_t, int);
int uep_activate(device_t, enum devact);
Index: sys/dev/usb/uftdi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uftdi.c,v
retrieving revision 1.40
diff -u -p -r1.40 uftdi.c
--- sys/dev/usb/uftdi.c 21 Apr 2009 16:26:01 -0000 1.40
+++ sys/dev/usb/uftdi.c 1 May 2009 16:44:22 -0000
@@ -155,7 +155,7 @@ static const struct usb_devno uftdi_devs
#define uftdi_lookup(v, p) usb_lookup(uftdi_devs, v, p)
int uftdi_match(device_t, cfdata_t, void *);
-void uftdi_attach(device_t, device_t, void *);
+int uftdi_attach(device_t, device_t, void *);
void uftdi_childdet(device_t, device_t);
int uftdi_detach(device_t, int);
int uftdi_activate(device_t, enum devact);
Index: sys/dev/usb/ugensa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ugensa.c,v
retrieving revision 1.22
diff -u -p -r1.22 ugensa.c
--- sys/dev/usb/ugensa.c 19 Oct 2008 11:40:02 -0000 1.22
+++ sys/dev/usb/ugensa.c 1 May 2009 16:44:22 -0000
@@ -112,7 +112,7 @@ static const struct ugensa_type ugensa_d
((const struct ugensa_type *)usb_lookup(ugensa_devs, v, p))
int ugensa_match(device_t, cfdata_t, void *);
-void ugensa_attach(device_t, device_t, void *);
+int ugensa_attach(device_t, device_t, void *);
void ugensa_childdet(device_t, device_t);
int ugensa_detach(device_t, int);
int ugensa_activate(device_t, enum devact);
Index: sys/dev/usb/uhid.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uhid.c,v
retrieving revision 1.82
diff -u -p -r1.82 uhid.c
--- sys/dev/usb/uhid.c 24 May 2008 16:40:58 -0000 1.82
+++ sys/dev/usb/uhid.c 1 May 2009 16:44:22 -0000
@@ -137,7 +137,7 @@ uhid_match(device_t parent, cfdata_t mat
return (UMATCH_IFACECLASS_GENERIC);
}
-void
+int
uhid_attach(device_t parent, device_t self, void *aux)
{
struct uhid_softc *sc = device_private(self);
Index: sys/dev/usb/uhidev.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uhidev.c,v
retrieving revision 1.42
diff -u -p -r1.42 uhidev.c
--- sys/dev/usb/uhidev.c 26 May 2008 19:01:51 -0000 1.42
+++ sys/dev/usb/uhidev.c 1 May 2009 16:44:22 -0000
@@ -77,7 +77,7 @@ Static int uhidev_maxrepid(void *, int);
Static int uhidevprint(void *, const char *);
int uhidev_match(device_t, cfdata_t, void *);
-void uhidev_attach(device_t, device_t, void *);
+int uhidev_attach(device_t, device_t, void *);
void uhidev_childdet(device_t, device_t);
int uhidev_detach(device_t, int);
int uhidev_activate(device_t, enum devact);
Index: sys/dev/usb/uhub.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uhub.c,v
retrieving revision 1.104
diff -u -p -r1.104 uhub.c
--- sys/dev/usb/uhub.c 7 Apr 2009 18:15:45 -0000 1.104
+++ sys/dev/usb/uhub.c 1 May 2009 16:44:23 -0000
@@ -94,7 +94,7 @@ Static void uhub_intr(usbd_xfer_handle,
*/
int uhub_match(device_t, cfdata_t, void *);
-void uhub_attach(device_t, device_t, void *);
+int uhub_attach(device_t, device_t, void *);
int uhub_rescan(device_t, const char *, const int *);
void uhub_childdet(device_t, device_t);
int uhub_detach(device_t, int);
Index: sys/dev/usb/uipaq.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uipaq.c,v
retrieving revision 1.13
diff -u -p -r1.13 uipaq.c
--- sys/dev/usb/uipaq.c 8 Jul 2008 08:47:32 -0000 1.13
+++ sys/dev/usb/uipaq.c 1 May 2009 16:44:23 -0000
@@ -128,7 +128,7 @@ static const struct uipaq_type uipaq_dev
#define uipaq_lookup(v, p) ((const struct uipaq_type *)usb_lookup(uipaq_devs,
v, p))
int uipaq_match(device_t, cfdata_t, void *);
-void uipaq_attach(device_t, device_t, void *);
+int uipaq_attach(device_t, device_t, void *);
void uipaq_childdet(device_t, device_t);
int uipaq_detach(device_t, int);
int uipaq_activate(device_t, enum devact);
Index: sys/dev/usb/uirda.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uirda.c,v
retrieving revision 1.31
diff -u -p -r1.31 uirda.c
--- sys/dev/usb/uirda.c 24 May 2008 16:40:58 -0000 1.31
+++ sys/dev/usb/uirda.c 1 May 2009 16:44:23 -0000
@@ -143,7 +143,7 @@ Static const struct usb_devno uirda_devs
#define uirda_lookup(v, p) (usb_lookup(uirda_devs, v, p))
int uirda_match(device_t, cfdata_t, void *);
-void uirda_attach(device_t, device_t, void *);
+int uirda_attach(device_t, device_t, void *);
void uirda_childdet(device_t, device_t);
int uirda_detach(device_t, int);
int uirda_activate(device_t, enum devact);
Index: sys/dev/usb/ukbd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ukbd.c,v
retrieving revision 1.103
diff -u -p -r1.103 ukbd.c
--- sys/dev/usb/ukbd.c 9 Mar 2009 15:59:33 -0000 1.103
+++ sys/dev/usb/ukbd.c 1 May 2009 16:44:23 -0000
@@ -268,7 +268,7 @@ const struct wskbd_mapdata ukbd_keymapda
#endif
static int ukbd_match(device_t, cfdata_t, void *);
-static void ukbd_attach(device_t, device_t, void *);
+static int ukbd_attach(device_t, device_t, void *);
static int ukbd_detach(device_t, int);
static int ukbd_activate(device_t, enum devact);
static void ukbd_childdet(device_t, device_t);
@@ -293,7 +293,7 @@ ukbd_match(device_t parent, cfdata_t mat
return (UMATCH_IFACECLASS);
}
-void
+int
ukbd_attach(device_t parent, device_t self, void *aux)
{
struct ukbd_softc *sc = device_private(self);
Index: sys/dev/usb/umass.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/umass.c,v
retrieving revision 1.131
diff -u -p -r1.131 umass.c
--- sys/dev/usb/umass.c 17 Mar 2009 19:12:17 -0000 1.131
+++ sys/dev/usb/umass.c 1 May 2009 16:44:23 -0000
@@ -189,7 +189,7 @@ const char *states[TSTATE_STATES+1] = {
/* USB device probe/attach/detach functions */
int umass_match(device_t, cfdata_t, void *);
-void umass_attach(device_t, device_t, void *);
+int umass_attach(device_t, device_t, void *);
int umass_detach(device_t, int);
static void umass_childdet(device_t, device_t);
int umass_activate(device_t, enum devact);
@@ -295,7 +295,7 @@ umass_match(device_t parent, cfdata_t ma
return (UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO);
}
-void
+int
umass_attach(device_t parent, device_t self, void *aux)
{
struct umass_softc *sc = device_private(self);
@@ -353,7 +353,7 @@ umass_attach(device_t parent, device_t s
("%s: Unsupported wire protocol %u\n",
device_xname(sc->sc_dev),
uaa->proto));
- return;
+ return ENXIO;
}
}
@@ -378,7 +378,7 @@ umass_attach(device_t parent, device_t s
("%s: Unsupported command protocol %u\n",
device_xname(sc->sc_dev),
uaa->subclass));
- return;
+ return ENXIO;
}
}
@@ -425,7 +425,7 @@ umass_attach(device_t parent, device_t s
if (err) {
aprint_error_dev(self, "quirk init failed\n");
umass_disco(sc);
- return;
+ return ENXIO;
}
}
@@ -446,7 +446,7 @@ umass_attach(device_t parent, device_t s
if (ed == NULL) {
aprint_error_dev(self,
"could not read endpoint descriptor\n");
- return;
+ return ENXIO;
}
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN
&& (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) {
@@ -476,7 +476,7 @@ umass_attach(device_t parent, device_t s
sc->sc_epaddr[UMASS_BULKIN],
sc->sc_epaddr[UMASS_BULKOUT],
sc->sc_epaddr[UMASS_INTRIN]);
- return;
+ return ENXIO;
}
/*
@@ -488,7 +488,7 @@ umass_attach(device_t parent, device_t s
if (err) {
aprint_error_dev(self, "unable to get Max Lun: %s\n",
usbd_errstr(err));
- return;
+ return ENXIO;
}
if (sc->maxlun > 0)
sc->sc_busquirks |= PQUIRK_FORCELUNS;
@@ -507,7 +507,7 @@ umass_attach(device_t parent, device_t s
aprint_error_dev(self, "cannot open %u-out pipe (bulk)\n",
sc->sc_epaddr[UMASS_BULKOUT]);
umass_disco(sc);
- return;
+ return ENXIO;
}
DPRINTF(UDMASS_USB, ("%s: opening iface %p epaddr %d for BULKIN\n",
device_xname(sc->sc_dev), sc->sc_iface,
@@ -518,7 +518,7 @@ umass_attach(device_t parent, device_t s
aprint_error_dev(self, "could not open %u-in pipe (bulk)\n",
sc->sc_epaddr[UMASS_BULKIN]);
umass_disco(sc);
- return;
+ return ENXIO;
}
/*
* Open the intr-in pipe if the protocol is CBI with CCI.
@@ -542,7 +542,7 @@ umass_attach(device_t parent, device_t s
aprint_error_dev(self, "couldn't open %u-in (intr)\n",
sc->sc_epaddr[UMASS_INTRIN]);
umass_disco(sc);
- return;
+ return ENXIO;
}
}
@@ -555,7 +555,7 @@ umass_attach(device_t parent, device_t s
if (sc->transfer_xfer[i] == NULL) {
aprint_error_dev(self, "Out of memory\n");
umass_disco(sc);
- return;
+ return ENXIO;
}
}
/* Allocate buffer for data transfer (it's huge). */
@@ -574,7 +574,7 @@ umass_attach(device_t parent, device_t s
if (sc->data_buffer == NULL) {
aprint_error_dev(self, "no buffer memory\n");
umass_disco(sc);
- return;
+ return ENXIO;
}
break;
default:
@@ -592,7 +592,7 @@ umass_attach(device_t parent, device_t s
break;
default:
umass_disco(sc);
- return;
+ return ENXIO;
}
error = 0;
@@ -627,12 +627,12 @@ umass_attach(device_t parent, device_t s
aprint_error_dev(self, "command protocol=0x%x not supported\n",
sc->sc_cmd);
umass_disco(sc);
- return;
+ return ENXIO;
}
if (error) {
aprint_error_dev(self, "bus attach failed\n");
umass_disco(sc);
- return;
+ return ENXIO;
}
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
@@ -643,7 +643,7 @@ umass_attach(device_t parent, device_t s
DPRINTF(UDMASS_GEN, ("%s: Attach finished\n",
device_xname(sc->sc_dev)));
- return;
+ return 0;
}
static void
Index: sys/dev/usb/umct.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/umct.c,v
retrieving revision 1.26
diff -u -p -r1.26 umct.c
--- sys/dev/usb/umct.c 24 May 2008 16:40:58 -0000 1.26
+++ sys/dev/usb/umct.c 1 May 2009 16:44:23 -0000
@@ -148,7 +148,7 @@ static const struct usb_devno umct_devs[
#define umct_lookup(v, p) usb_lookup(umct_devs, v, p)
int umct_match(device_t, struct cfdata *, void *);
-void umct_attach(device_t, device_t, void *);
+int umct_attach(device_t, device_t, void *);
void umct_childdet(device_t, device_t);
int umct_detach(device_t, int);
int umct_activate(device_t, enum devact);
Index: sys/dev/usb/umidi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/umidi.c,v
retrieving revision 1.39
diff -u -p -r1.39 umidi.c
--- sys/dev/usb/umidi.c 11 Jan 2009 11:06:08 -0000 1.39
+++ sys/dev/usb/umidi.c 1 May 2009 16:44:24 -0000
@@ -148,7 +148,7 @@ struct midi_hw_if_ext umidi_hw_if_mm = {
};
int umidi_match(device_t, cfdata_t, void *);
-void umidi_attach(device_t, device_t, void *);
+int umidi_attach(device_t, device_t, void *);
void umidi_childdet(device_t, device_t);
int umidi_detach(device_t, int);
int umidi_activate(device_t, enum devact);
Index: sys/dev/usb/ums.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ums.c,v
retrieving revision 1.74
diff -u -p -r1.74 ums.c
--- sys/dev/usb/ums.c 9 Mar 2009 15:59:33 -0000 1.74
+++ sys/dev/usb/ums.c 1 May 2009 16:44:24 -0000
@@ -119,7 +119,7 @@ const struct wsmouse_accessops ums_acces
};
int ums_match(device_t, cfdata_t, void *);
-void ums_attach(device_t, device_t, void *);
+int ums_attach(device_t, device_t, void *);
void ums_childdet(device_t, device_t);
int ums_detach(device_t, int);
int ums_activate(device_t, enum devact);
@@ -142,7 +142,7 @@ ums_match(device_t parent, cfdata_t matc
return (UMATCH_IFACECLASS);
}
-void
+int
ums_attach(device_t parent, device_t self, void *aux)
{
struct ums_softc *sc = device_private(self);
Index: sys/dev/usb/uplcom.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uplcom.c,v
retrieving revision 1.67
diff -u -p -r1.67 uplcom.c
--- sys/dev/usb/uplcom.c 20 Nov 2008 10:50:42 -0000 1.67
+++ sys/dev/usb/uplcom.c 1 May 2009 16:44:24 -0000
@@ -195,7 +195,7 @@ static const struct usb_devno uplcom_dev
#define uplcom_lookup(v, p) usb_lookup(uplcom_devs, v, p)
int uplcom_match(device_t, cfdata_t, void *);
-void uplcom_attach(device_t, device_t, void *);
+int uplcom_attach(device_t, device_t, void *);
void uplcom_childdet(device_t, device_t);
int uplcom_detach(device_t, int);
int uplcom_activate(device_t, enum devact);
Index: sys/dev/usb/usb.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usb.c,v
retrieving revision 1.116
diff -u -p -r1.116 usb.c
--- sys/dev/usb/usb.c 7 Apr 2009 18:15:45 -0000 1.116
+++ sys/dev/usb/usb.c 1 May 2009 16:44:24 -0000
@@ -154,7 +154,7 @@ Static void usb_copy_old_devinfo(struct
Static const char *usbrev_str[] = USBREV_STR;
static int usb_match(device_t, struct cfdata *, void *);
-static void usb_attach(device_t, device_t, void *);
+static int usb_attach(device_t, device_t, void *);
static int usb_detach(device_t, int);
static int usb_activate(device_t, enum devact);
static void usb_childdet(device_t, device_t);
@@ -195,6 +195,7 @@ USB_ATTACH(usb)
aprint_normal("\n");
config_interrupts(self, usb_doattach);
+ return 0;
}
static void
@@ -240,7 +241,7 @@ usb_doattach(device_t self)
aprint_error("%s: can't register softintr\n",
device_xname(self));
sc->sc_dying = 1;
- USB_ATTACH_ERROR_RETURN;
+ return /* ENXIO */;
}
#endif
@@ -252,7 +253,7 @@ usb_doattach(device_t self)
sc->sc_dying = 1;
aprint_error("%s: root device is not a hub\n",
device_xname(self));
- USB_ATTACH_ERROR_RETURN;
+ return /* ENXIO */;
}
sc->sc_bus->root_hub = dev;
#if 1
@@ -279,7 +280,7 @@ usb_doattach(device_t self)
usb_async_sih = softint_establish(SOFTINT_CLOCK | SOFTINT_MPSAFE,
usb_async_intr, NULL);
- USB_ATTACH_SUCCESS_RETURN;
+ return /* 0 */ ;
}
static const char *taskq_names[] = USB_TASKQ_NAMES;
Index: sys/dev/usb/usb_port.h
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usb_port.h,v
retrieving revision 1.85
diff -u -p -r1.85 usb_port.h
--- sys/dev/usb/usb_port.h 28 Jun 2008 09:06:20 -0000 1.85
+++ sys/dev/usb/usb_port.h 1 May 2009 16:44:24 -0000
@@ -126,7 +126,7 @@ typedef struct malloc_type *usb_malloc_t
#define USB_DNAME(dname) dname
#define USB_DECLARE_DRIVER(dname) \
int __CONCAT(dname,_match)(device_t, cfdata_t, void *); \
-void __CONCAT(dname,_attach)(device_t, device_t, void *); \
+int __CONCAT(dname,_attach)(device_t, device_t, void *); \
int __CONCAT(dname,_detach)(device_t, int); \
int __CONCAT(dname,_activate)(device_t, enum devact); \
\
@@ -150,7 +150,7 @@ int __CONCAT(dname,_match)(device_t pare
struct usbif_attach_arg *uaa = aux
#define USB_ATTACH(dname) \
-void __CONCAT(dname,_attach)(device_t parent, \
+int __CONCAT(dname,_attach)(device_t parent, \
device_t self, void *aux)
#define USB_ATTACH_START(dname, sc, uaa) \
@@ -164,8 +164,8 @@ void __CONCAT(dname,_attach)(device_t pa
struct usbif_attach_arg *uaa = aux
/* Returns from attach */
-#define USB_ATTACH_ERROR_RETURN return
-#define USB_ATTACH_SUCCESS_RETURN return
+#define USB_ATTACH_ERROR_RETURN return ENXIO
+#define USB_ATTACH_SUCCESS_RETURN return 0
#define USB_ATTACH_SETUP \
do { \
Index: sys/dev/usb/uslsa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uslsa.c,v
retrieving revision 1.9
diff -u -p -r1.9 uslsa.c
--- sys/dev/usb/uslsa.c 5 Jan 2009 17:22:18 -0000 1.9
+++ sys/dev/usb/uslsa.c 1 May 2009 16:44:24 -0000
@@ -208,7 +208,7 @@ static const struct usb_devno uslsa_devs
#define uslsa_lookup(v, p) usb_lookup(uslsa_devs, v, p)
int uslsa_match(device_t, cfdata_t, void *);
-void uslsa_attach(device_t, device_t, void *);
+int uslsa_attach(device_t, device_t, void *);
void uslsa_childdet(device_t, device_t);
int uslsa_detach(device_t, int);
int uslsa_activate(device_t, enum devact);
Index: sys/dev/usb/usscanner.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usscanner.c,v
retrieving revision 1.27
diff -u -p -r1.27 usscanner.c
--- sys/dev/usb/usscanner.c 14 Mar 2009 15:36:21 -0000 1.27
+++ sys/dev/usb/usscanner.c 1 May 2009 16:44:24 -0000
@@ -146,7 +146,7 @@ Static callback usscanner_sensecmd_cb;
Static callback usscanner_sensedata_cb;
int usscanner_match(device_t, cfdata_t, void *);
-void usscanner_attach(device_t, device_t, void *);
+int usscanner_attach(device_t, device_t, void *);
void usscanner_childdet(device_t, device_t);
int usscanner_detach(device_t, int);
int usscanner_activate(device_t, enum devact);
Index: sys/dev/usb/ustir.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ustir.c,v
retrieving revision 1.26
diff -u -p -r1.26 ustir.c
--- sys/dev/usb/ustir.c 24 May 2008 16:40:58 -0000 1.26
+++ sys/dev/usb/ustir.c 1 May 2009 16:44:25 -0000
@@ -282,7 +282,7 @@ ustir_dumpdata(u_int8_t const *data, siz
#endif
int ustir_match(device_t, cfdata_t, void *);
-void ustir_attach(device_t, device_t, void *);
+int ustir_attach(device_t, device_t, void *);
void ustir_childdet(device_t, device_t);
int ustir_detach(device_t, int);
int ustir_activate(device_t, enum devact);
Index: sys/dev/usb/uvideo.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uvideo.c,v
retrieving revision 1.29
diff -u -p -r1.29 uvideo.c
--- sys/dev/usb/uvideo.c 9 Mar 2009 15:59:33 -0000 1.29
+++ sys/dev/usb/uvideo.c 1 May 2009 16:44:25 -0000
@@ -258,7 +258,7 @@ struct uvideo_softc {
};
int uvideo_match(device_t, cfdata_t, void *);
-void uvideo_attach(device_t, device_t, void *);
+int uvideo_attach(device_t, device_t, void *);
int uvideo_detach(device_t, int);
void uvideo_childdet(device_t, device_t);
int uvideo_activate(device_t, enum devact);
Index: sys/dev/usb/uvisor.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uvisor.c,v
retrieving revision 1.40
diff -u -p -r1.40 uvisor.c
--- sys/dev/usb/uvisor.c 24 May 2008 16:40:58 -0000 1.40
+++ sys/dev/usb/uvisor.c 1 May 2009 16:44:26 -0000
@@ -190,7 +190,7 @@ static const struct uvisor_type uvisor_d
#define uvisor_lookup(v, p) ((const struct uvisor_type
*)usb_lookup(uvisor_devs, v, p))
int uvisor_match(device_t, cfdata_t, void *);
-void uvisor_attach(device_t, device_t, void *);
+int uvisor_attach(device_t, device_t, void *);
void uvisor_childdet(device_t, device_t);
int uvisor_detach(device_t, int);
int uvisor_activate(device_t, enum devact);
Index: sys/dev/usb/uvscom.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uvscom.c,v
retrieving revision 1.22
diff -u -p -r1.22 uvscom.c
--- sys/dev/usb/uvscom.c 24 May 2008 16:40:58 -0000 1.22
+++ sys/dev/usb/uvscom.c 1 May 2009 16:44:26 -0000
@@ -233,7 +233,7 @@ static const struct usb_devno uvscom_dev
#define uvscom_lookup(v, p) usb_lookup(uvscom_devs, v, p)
int uvscom_match(device_t, cfdata_t, void *);
-void uvscom_attach(device_t, device_t, void *);
+int uvscom_attach(device_t, device_t, void *);
void uvscom_childdet(device_t, device_t);
int uvscom_detach(device_t, int);
int uvscom_activate(device_t, enum devact);
Index: sys/dev/wscons/wsdisplay.c
===================================================================
RCS file: /cvsroot/src/sys/dev/wscons/wsdisplay.c,v
retrieving revision 1.126
diff -u -p -r1.126 wsdisplay.c
--- sys/dev/wscons/wsdisplay.c 22 Jan 2009 20:40:20 -0000 1.126
+++ sys/dev/wscons/wsdisplay.c 1 May 2009 16:44:26 -0000
@@ -163,9 +163,9 @@ extern struct cfdriver wsdisplay_cd;
/* Autoconfiguration definitions. */
static int wsdisplay_emul_match(device_t , cfdata_t, void *);
-static void wsdisplay_emul_attach(device_t, device_t, void *);
+static int wsdisplay_emul_attach(device_t, device_t, void *);
static int wsdisplay_noemul_match(device_t, cfdata_t, void *);
-static void wsdisplay_noemul_attach(device_t, device_t, void *);
+static int wsdisplay_noemul_attach(device_t, device_t, void *);
static bool wsdisplay_suspend(device_t PMF_FN_PROTO);
CFATTACH_DECL_NEW(wsdisplay_emul, sizeof (struct wsdisplay_softc),
@@ -539,7 +539,7 @@ wsdisplay_emul_match(device_t parent, cf
return (1);
}
-void
+int
wsdisplay_emul_attach(device_t parent, device_t self, void *aux)
{
struct wsdisplay_softc *sc = device_private(self);
@@ -564,6 +564,7 @@ wsdisplay_emul_attach(device_t parent, d
cn_tab->cn_dev = makedev(maj, WSDISPLAYMINOR(device_unit(self),
0));
}
+ return 0;
}
/* Print function (for parent devices). */
@@ -594,7 +595,7 @@ wsdisplay_noemul_match(device_t parent,
return (1);
}
-void
+int
wsdisplay_noemul_attach(device_t parent, device_t self, void *aux)
{
struct wsdisplay_softc *sc = device_private(self);
@@ -605,6 +606,7 @@ wsdisplay_noemul_attach(device_t parent,
wsdisplay_common_attach(sc, 0,
device_cfdata(self)->wsemuldisplaydevcf_kbdmux, NULL,
ap->accessops, ap->accesscookie);
+ return 0;
}
static void
Index: sys/dev/wscons/wskbd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/wscons/wskbd.c,v
retrieving revision 1.122
diff -u -p -r1.122 wskbd.c
--- sys/dev/wscons/wskbd.c 15 Jan 2009 04:22:11 -0000 1.122
+++ sys/dev/wscons/wskbd.c 1 May 2009 16:44:26 -0000
@@ -243,7 +243,7 @@ struct wskbd_softc {
} while (0)
static int wskbd_match(device_t, cfdata_t, void *);
-static void wskbd_attach(device_t, device_t, void *);
+static int wskbd_attach(device_t, device_t, void *);
static int wskbd_detach(device_t, int);
static int wskbd_activate(device_t, enum devact);
@@ -405,7 +405,7 @@ wskbd_match(device_t parent, cfdata_t ma
return (1);
}
-void
+int
wskbd_attach(device_t parent, device_t self, void *aux)
{
struct wskbd_softc *sc = device_private(self);
@@ -502,6 +502,7 @@ wskbd_attach(device_t parent, device_t s
aprint_error_dev(self, "couldn't establish power handler\n");
else if (!pmf_class_input_register(self))
aprint_error_dev(self, "couldn't register as input device\n");
+ return 0;
}
static bool
Index: sys/dev/wscons/wsmouse.c
===================================================================
RCS file: /cvsroot/src/sys/dev/wscons/wsmouse.c,v
retrieving revision 1.62
diff -u -p -r1.62 wsmouse.c
--- sys/dev/wscons/wsmouse.c 15 Jan 2009 04:22:11 -0000 1.62
+++ sys/dev/wscons/wsmouse.c 1 May 2009 16:44:26 -0000
@@ -171,7 +171,7 @@ struct wsmouse_softc {
};
static int wsmouse_match(device_t, cfdata_t, void *);
-static void wsmouse_attach(device_t, device_t, void *);
+static int wsmouse_attach(device_t, device_t, void *);
static int wsmouse_detach(device_t, int);
static int wsmouse_activate(device_t, enum devact);
@@ -231,7 +231,7 @@ wsmouse_match(device_t parent, cfdata_t
return (1);
}
-void
+int
wsmouse_attach(device_t parent, device_t self, void *aux)
{
struct wsmouse_softc *sc = device_private(self);
@@ -271,6 +271,7 @@ wsmouse_attach(device_t parent, device_t
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
+ return 0;
}
int
Index: sys/kern/subr_autoconf.c
===================================================================
RCS file: /cvsroot/src/sys/kern/subr_autoconf.c,v
retrieving revision 1.175
diff -u -p -r1.175 subr_autoconf.c
--- sys/kern/subr_autoconf.c 1 May 2009 08:27:41 -0000 1.175
+++ sys/kern/subr_autoconf.c 1 May 2009 16:44:27 -0000
@@ -1314,6 +1314,7 @@ config_attach_loc(device_t parent, cfdat
device_t dev;
struct cftable *ct;
const char *drvname;
+ int error = 0;
#if defined(SPLASHSCREEN) && defined(SPLASHSCREEN_PROGRESS)
if (splash_progress_state)
@@ -1321,8 +1322,11 @@ config_attach_loc(device_t parent, cfdat
#endif
dev = config_devalloc(parent, cf, locs);
- if (!dev)
- panic("config_attach: allocation of device softc failed");
+ if (!dev) {
+ aprint_debug("%s: allocation of device softc failed",
+ __func__);
+ return NULL;
+ }
/* XXX redundant - see below? */
if (cf->cf_fstate != FSTATE_STAR) {
@@ -1377,6 +1381,15 @@ config_attach_loc(device_t parent, cfdat
}
}
}
+
+#if defined(SPLASHSCREEN) && defined(SPLASHSCREEN_PROGRESS)
+ if (splash_progress_state)
+ splash_progress_update(splash_progress_state);
+#endif
+ error = (*dev->dv_cfattach->ca_attach)(parent, dev, aux);
+ if (error)
+ goto fail;
+
#ifdef __HAVE_DEVICE_REGISTER
device_register(dev, aux);
#endif
@@ -1388,17 +1401,18 @@ config_attach_loc(device_t parent, cfdat
if (splash_progress_state)
splash_progress_update(splash_progress_state);
#endif
- (*dev->dv_cfattach->ca_attach)(parent, dev, aux);
-#if defined(SPLASHSCREEN) && defined(SPLASHSCREEN_PROGRESS)
- if (splash_progress_state)
- splash_progress_update(splash_progress_state);
-#endif
if (!device_pmf_is_registered(dev))
aprint_debug_dev(dev, "WARNING: power management not
supported\n");
config_process_deferred(&deferred_config_queue, dev);
return dev;
+
+fail:
+ config_devunlink(dev);
+ aprint_normal_dev(dev, "detached\n");
+ config_devdealloc(dev);
+ return NULL;
}
device_t
@@ -1421,10 +1435,14 @@ device_t
config_attach_pseudo(cfdata_t cf)
{
device_t dev;
+ int error = 0;
dev = config_devalloc(ROOT, cf, NULL);
- if (!dev)
+ if (!dev) {
+ aprint_debug("%s: allocation of device softc failed",
+ __func__);
return NULL;
+ }
/* XXX mark busy in cfdata */
@@ -1435,14 +1453,23 @@ config_attach_pseudo(cfdata_t cf)
config_devlink(dev);
+ error = (*dev->dv_cfattach->ca_attach)(ROOT, dev, NULL);
+ if (error)
+ goto fail;
+
#if 0 /* XXXJRT not yet */
#ifdef __HAVE_DEVICE_REGISTER
device_register(dev, NULL); /* like a root node */
#endif
#endif
- (*dev->dv_cfattach->ca_attach)(ROOT, dev, NULL);
config_process_deferred(&deferred_config_queue, dev);
return dev;
+
+fail:
+ config_devunlink(dev);
+ aprint_normal_dev(dev, "detached\n");
+ config_devdealloc(dev);
+ return NULL;
}
/*
Index: sys/net/if_tap.c
===================================================================
RCS file: /cvsroot/src/sys/net/if_tap.c,v
retrieving revision 1.57
diff -u -p -r1.57 if_tap.c
--- sys/net/if_tap.c 11 Apr 2009 23:05:26 -0000 1.57
+++ sys/net/if_tap.c 1 May 2009 16:44:28 -0000
@@ -126,7 +126,7 @@ struct tap_softc {
void tapattach(int);
static int tap_match(device_t, cfdata_t, void *);
-static void tap_attach(device_t, device_t, void *);
+static int tap_attach(device_t, device_t, void *);
static int tap_detach(device_t, int);
CFATTACH_DECL_NEW(tap, sizeof(struct tap_softc),
@@ -256,7 +256,7 @@ tap_match(device_t parent, cfdata_t cfda
return (1);
}
-void
+int
tap_attach(device_t parent, device_t self, void *aux)
{
struct tap_softc *sc = device_private(self);
@@ -375,6 +375,7 @@ tap_attach(device_t parent, device_t sel
simple_lock_init(&sc->sc_kqlock);
selinit(&sc->sc_rsel);
+ return 0;
}
/*
Index: sys/sys/device.h
===================================================================
RCS file: /cvsroot/src/sys/sys/device.h,v
retrieving revision 1.117
diff -u -p -r1.117 device.h
--- sys/sys/device.h 2 Apr 2009 00:09:34 -0000 1.117
+++ sys/sys/device.h 1 May 2009 16:44:28 -0000
@@ -290,7 +290,7 @@ struct cfattach {
size_t ca_devsize; /* size of dev data (for malloc) */
int ca_flags; /* flags for driver allocation etc */
int (*ca_match)(device_t, cfdata_t, void *);
- void (*ca_attach)(device_t, device_t, void *);
+ int (*ca_attach)(device_t, device_t, void *);
int (*ca_detach)(device_t, int);
int (*ca_activate)(device_t, devact_t);
/* technically, the next 2 belong into "struct cfdriver" */
Home |
Main Index |
Thread Index |
Old Index