]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-disk.c
powerpc: Remove outdated Documentation/powerpc/smp.txt
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-disk.c
index 28d85b410f7ce03361ddec4c957c930a9aa08518..07ef88bd109b69a04c0addfcac588024ea7286dd 100644 (file)
@@ -65,11 +65,10 @@ static struct ide_disk_obj *ide_disk_get(struct gendisk *disk)
        mutex_lock(&idedisk_ref_mutex);
        idkp = ide_disk_g(disk);
        if (idkp) {
-               kref_get(&idkp->kref);
-               if (ide_device_get(idkp->drive)) {
-                       kref_put(&idkp->kref, ide_disk_release);
+               if (ide_device_get(idkp->drive))
                        idkp = NULL;
-               }
+               else
+                       kref_get(&idkp->kref);
        }
        mutex_unlock(&idedisk_ref_mutex);
        return idkp;
@@ -77,9 +76,11 @@ static struct ide_disk_obj *ide_disk_get(struct gendisk *disk)
 
 static void ide_disk_put(struct ide_disk_obj *idkp)
 {
+       ide_drive_t *drive = idkp->drive;
+
        mutex_lock(&idedisk_ref_mutex);
-       ide_device_put(idkp->drive);
        kref_put(&idkp->kref, ide_disk_release);
+       ide_device_put(drive);
        mutex_unlock(&idedisk_ref_mutex);
 }
 
@@ -444,20 +445,6 @@ static void idedisk_check_hpa(ide_drive_t *drive)
        }
 }
 
-/*
- * Compute drive->capacity, the full capacity of the drive
- * Called with drive->id != NULL.
- *
- * To compute capacity, this uses either of
- *
- *    1. CHS value set by user       (whatever user sets will be trusted)
- *    2. LBA value from target drive (require new ATA feature)
- *    3. LBA value from system BIOS  (new one is OK, old one may break)
- *    4. CHS value from system BIOS  (traditional style)
- *
- * in above order (i.e., if value of higher priority is available,
- * reset will be ignored).
- */
 static void init_idedisk_capacity(ide_drive_t *drive)
 {
        struct hd_driveid *id = drive->id;