Skip to content

Commit

Permalink
pata_hpt37x: unify ->pre_reset methods
Browse files Browse the repository at this point in the history
We can use the same ->pre_reset method for all HPT37x chipsets now.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz authored and Jeff Garzik committed Dec 3, 2009
1 parent 9e87be9 commit ab81a50
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions drivers/ata/pata_hpt37x.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ static int hpt374_fn1_cable_detect(struct ata_port *ap)
* @link: ATA link to reset
* @deadline: deadline jiffies for the operation
*
* Perform the initial reset handling for the 370/372 and 374 func 0
* Perform the initial reset handling for the HPT37x.
*/

static int hpt37x_pre_reset(struct ata_link *link, unsigned long deadline)
Expand All @@ -381,25 +381,6 @@ static int hpt37x_pre_reset(struct ata_link *link, unsigned long deadline)
return ata_sff_prereset(link, deadline);
}

static int hpt374_fn1_pre_reset(struct ata_link *link, unsigned long deadline)
{
static const struct pci_bits hpt37x_enable_bits[] = {
{ 0x50, 1, 0x04, 0x04 },
{ 0x54, 1, 0x04, 0x04 }
};
struct ata_port *ap = link->ap;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);

if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no]))
return -ENOENT;

/* Reset the state machine */
pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37);
udelay(100);

return ata_sff_prereset(link, deadline);
}

/**
* hpt370_set_piomode - PIO setup
* @ap: ATA interface
Expand Down Expand Up @@ -646,7 +627,7 @@ static struct ata_port_operations hpt372_port_ops = {
static struct ata_port_operations hpt374_fn1_port_ops = {
.inherits = &hpt372_port_ops,
.cable_detect = hpt374_fn1_cable_detect,
.prereset = hpt374_fn1_pre_reset,
.prereset = hpt37x_pre_reset,
};

/**
Expand Down

0 comments on commit ab81a50

Please sign in to comment.