Date: Thu, 4 Aug 2005 14:18:33 +0400 (MSD) From: "Felix-KM" <Felix-KM@yandex.ru> To: NKoch@demig.de Cc: freebsd-hackers@freebsd.org Subject: RE: (no subject) Message-ID: <42F1EB79.000002.18984@mfront8.yandex.ru> In-Reply-To: <000001c598c8$e4045ee0$4801a8c0@ws-ew-3.W2KDEMIG> References: <000001c598c8$e4045ee0$4801a8c0@ws-ew-3.W2KDEMIG>
next in thread | previous in thread | raw e-mail | index | archive | help
>> #define DEVICE2SOFTC(device) ((struct dev_softc >> *)device_get_softc(device)) >> >> static void dev_intr(void *arg); >> >> struct dev_softc { >> ... >> int rid_irq; >> struct resource* res_irq; >> void *intr_cookie; >> ... >> }; >> >> static int >> dev_attach(device_t device) >> { >> ... >> >> dev_sc->rid_irq = 0; >> dev_sc->res_irq = bus_alloc_resource_any(device, SYS_RES_IRQ, >> &(dev_sc->rid_irq), >> RF_SHAREABLE|RF_ACTIVE); >> if (dev_sc->res_irq == NULL) >> { >> uprintf("!!! Could not map interrupt !!!\n"); >> goto fail; >> } >> >> if (bus_setup_intr(device, dev_sc->res_irq, INTR_TYPE_TTY, >> dev_intr, dev_sc, &dev_sc->intr_cookie)) >> { >> uprintf("!!! Could not setup irq !!!\n"); >> goto fail; >> } >> >> ... >> >> fail: >> return ENXIO; >> } >> >> static int >> dev_detach(device_t device) >> { >> struct dev_softc *dev_sc = DEVICE2SOFTC(device); >> >> destroy_dev(dev_sc->device); >> >> if (bus_teardown_intr(device, dev_sc->res_irq, >> dev_sc->intr_cookie) != 0); > >!!!! Do you see that semicolon? !!!! > > >Norbert > > Oops... I am ashamed for my inattention... Thank you very much...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42F1EB79.000002.18984>