]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/finish.c
Merge: Correction for 2.6.23-git kernel - unregister_chrdev() does not return value.
[lincan.git] / lincan / src / finish.c
index 752b177793ea5db26273da44094cd5d7d47a39e4..f10f309789d03d699a8f03e963aaf0ed7b74ff27 100644 (file)
@@ -32,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;
        }
        
@@ -60,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;
@@ -96,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; i<candev->nr_all_chips; i++){
                if((chip=candev->chip[i])==NULL)