summaryrefslogtreecommitdiffstats
path: root/sys/dev/ed/if_ed_cbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ed/if_ed_cbus.c')
-rw-r--r--sys/dev/ed/if_ed_cbus.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/ed/if_ed_cbus.c b/sys/dev/ed/if_ed_cbus.c
index bcc0d85..7302619 100644
--- a/sys/dev/ed/if_ed_cbus.c
+++ b/sys/dev/ed/if_ed_cbus.c
@@ -242,15 +242,18 @@ ed_cbus_attach(dev)
ed_alloc_irq(dev, sc->irq_rid, 0);
- error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
- NULL, edintr, sc, &sc->irq_handle);
+ if (sc->sc_media_ioctl == NULL)
+ ed_gen_ifmedia_init(sc);
+ error = ed_attach(dev);
if (error) {
ed_release_resources(dev);
return (error);
}
- if (sc->sc_media_ioctl == NULL)
- ed_gen_ifmedia_init(sc);
- return ed_attach(dev);
+ error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
+ NULL, edintr, sc, &sc->irq_handle);
+ if (error)
+ ed_release_resources(dev);
+ return (error);
}
/*
OpenPOWER on IntegriCloud