Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21844
b: refs/heads/master
c: 3d2ca91
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Feb 12, 2006
1 parent a83fcf5 commit e1ae377
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2940740bcaa5948967d261dfceec04f40b2d2fa1
refs/heads/master: 3d2ca91095f8ab6dc0cb925374eec62fa5336764
6 changes: 1 addition & 5 deletions trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,6 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)
{
struct ata_device *dev = &ap->device[device];
unsigned int major_version;
u16 tmp;
unsigned long xfer_modes;
unsigned int using_edd;
struct ata_taskfile tf;
Expand Down Expand Up @@ -1030,10 +1029,7 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)
goto err_out_nosup;

/* get major version */
tmp = dev->id[ATA_ID_MAJOR_VER];
for (major_version = 14; major_version >= 1; major_version--)
if (tmp & (1 << major_version))
break;
major_version = ata_id_major_version(dev->id);

/*
* The exact sequence expected by certain pre-ATA4 drives is:
Expand Down
10 changes: 10 additions & 0 deletions trunk/include/linux/ata.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,16 @@ struct ata_taskfile {
((u64) (id)[(n) + 1] << 16) | \
((u64) (id)[(n) + 0]) )

static inline unsigned int ata_id_major_version(const u16 *id)
{
unsigned int mver;

for (mver = 14; mver >= 1; mver--)
if (id[ATA_ID_MAJOR_VER] & (1 << mver))
break;
return mver;
}

static inline int ata_id_current_chs_valid(const u16 *id)
{
/* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
Expand Down

0 comments on commit e1ae377

Please sign in to comment.