Diff for /src/sys/dev/disk/ata/atapi-cd.c between versions 1.16 and 1.17

version 1.16, 2004/05/13 23:49:14 version 1.17, 2004/05/19 22:52:40
Line 201  acddetach(struct ata_device *atadev) Line 201  acddetach(struct ata_device *atadev)
                 bp->b_error = ENXIO;                  bp->b_error = ENXIO;
                 biodone(bp);                  biodone(bp);
             }              }
            destroy_dev(cdp->driver[subdev]->dev);            release_dev(cdp->driver[subdev]->dev);
             while ((entry = TAILQ_FIRST(&cdp->driver[subdev]->dev_list))) {              while ((entry = TAILQ_FIRST(&cdp->driver[subdev]->dev_list))) {
                destroy_dev(entry->dev);                release_dev(entry->dev);
                 TAILQ_REMOVE(&cdp->driver[subdev]->dev_list, entry, chain);                  TAILQ_REMOVE(&cdp->driver[subdev]->dev_list, entry, chain);
                 free(entry, M_ACD);                  free(entry, M_ACD);
             }              }
Line 221  acddetach(struct ata_device *atadev) Line 221  acddetach(struct ata_device *atadev)
         biodone(bp);          biodone(bp);
     }      }
     while ((entry = TAILQ_FIRST(&cdp->dev_list))) {      while ((entry = TAILQ_FIRST(&cdp->dev_list))) {
        destroy_dev(entry->dev);        release_dev(entry->dev);
         TAILQ_REMOVE(&cdp->dev_list, entry, chain);          TAILQ_REMOVE(&cdp->dev_list, entry, chain);
         free(entry, M_ACD);          free(entry, M_ACD);
     }      }
    destroy_dev(cdp->dev);    release_dev(cdp->dev);
     devstat_remove_entry(cdp->stats);      devstat_remove_entry(cdp->stats);
       cdevsw_remove(&acd_cdevsw, dkunitmask(), dkmakeunit(cdp->lun));
     free(cdp->stats, M_ACD);      free(cdp->stats, M_ACD);
     ata_free_name(atadev);      ata_free_name(atadev);
     ata_free_lun(&acd_lun_map, cdp->lun);      ata_free_lun(&acd_lun_map, cdp->lun);
Line 256  acd_make_dev(struct acd_softc *cdp) Line 257  acd_make_dev(struct acd_softc *cdp)
 {  {
     dev_t dev;      dev_t dev;
   
       cdevsw_add(&acd_cdevsw, dkunitmask(), dkmakeunit(cdp->lun));
     dev = make_dev(&acd_cdevsw, dkmakeminor(cdp->lun, 0, 0),      dev = make_dev(&acd_cdevsw, dkmakeminor(cdp->lun, 0, 0),
                    UID_ROOT, GID_OPERATOR, 0644, "acd%d", cdp->lun);                     UID_ROOT, GID_OPERATOR, 0644, "acd%d", cdp->lun);
       reference_dev(dev);
     dev->si_drv1 = cdp;      dev->si_drv1 = cdp;
     cdp->dev = dev;      cdp->dev = dev;
     cdp->device->flags |= ATA_D_MEDIA_CHANGED;      cdp->device->flags |= ATA_D_MEDIA_CHANGED;
Line 1330  acd_read_toc(struct acd_softc *cdp) Line 1333  acd_read_toc(struct acd_softc *cdp)
         entry->dev = make_dev(&acd_cdevsw, (cdp->lun << 3) | (track << 16),          entry->dev = make_dev(&acd_cdevsw, (cdp->lun << 3) | (track << 16),
                               0, 0, 0644, name, NULL);                                0, 0, 0644, name, NULL);
         entry->dev->si_drv1 = cdp->dev->si_drv1;          entry->dev->si_drv1 = cdp->dev->si_drv1;
           reference_dev(entry->dev);
         TAILQ_INSERT_TAIL(&cdp->dev_list, entry, chain);          TAILQ_INSERT_TAIL(&cdp->dev_list, entry, chain);
     }      }
   

Removed from v.1.16  
changed lines
  Added in v.1.17