X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/dd8f5100e766813dca62a82c6b99ebf3648f2448..62c38bb3d6fe5ca4d22fa0e552d4eeeef0e2b61e:/lincan/src/finish.c diff --git a/lincan/src/finish.c b/lincan/src/finish.c index 9016ae8..f10f309 100644 --- a/lincan/src/finish.c +++ b/lincan/src/finish.c @@ -1,3 +1,12 @@ +/* finish.c - finalization of the driver operation + * Linux CAN-bus device driver. + * Written by Arnaud Westenberg email:arnaud@wanadoo.nl + * Rewritten for new CAN queues by Pavel Pisa - OCERA team member + * email:pisa@cmp.felk.cvut.cz + * This software is released under the GPL-License. + * Version lincan-0.3 17 Jun 2004 + */ + #include "../include/can.h" #include "../include/can_sysdep.h" #include "../include/main.h" @@ -23,7 +32,7 @@ void msgobj_done(struct msgobj_t *obj) if(obj->hostchip->msgobj[obj->object-1] == obj) obj->hostchip->msgobj[obj->object-1]=NULL; else - CANMSG("msgobj_done: not registered in the chip_t\n"); + CANMSG("msgobj_done: not registered in the canchip_t\n"); obj->hostchip=NULL; } @@ -51,12 +60,15 @@ void msgobj_done(struct msgobj_t *obj) * canchip_done - destroys one CAN chip representation * @chip: pointer to CAN chip structure */ -void canchip_done(struct chip_t *chip) +void canchip_done(struct canchip_t *chip) { int i; struct msgobj_t *obj; + if(chip->flags & CHIP_ATTACHED) + chip->chipspecops->release_chip(chip); + if((chip->hostdevice) && (chip->chip_idx>=0)) { if(chip->hostdevice->chip[chip->chip_idx] == chip) chip->hostdevice->chip[chip->chip_idx] = NULL; @@ -87,7 +99,7 @@ void canchip_done(struct chip_t *chip) void candevice_done(struct candevice_t *candev) { int i; - struct chip_t *chip; + struct canchip_t *chip; for(i=0; inr_all_chips; i++){ if((chip=candev->chip[i])==NULL)