Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129837
b: refs/heads/master
c: 1602823
h: refs/heads/master
i:
  129835: 2f0fe64
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Jan 16, 2009
1 parent 1c08e9d commit c4da28f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 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: 94be9a58d7e683ac3c1df1858a17f09ebade8da0
refs/heads/master: 16028232bf6dc5ed7e4bd341ef335f386229ad0b
32 changes: 13 additions & 19 deletions trunk/drivers/ata/pata_atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,6 @@ enum {
ATIIXP_IDE_UDMA_MODE = 0x56
};

static int atiixp_pre_reset(struct ata_link *link, unsigned long deadline)
{
struct ata_port *ap = link->ap;
static const struct pci_bits atiixp_enable_bits[] = {
{ 0x48, 1, 0x01, 0x00 },
{ 0x48, 1, 0x08, 0x00 }
};
struct pci_dev *pdev = to_pci_dev(ap->host->dev);

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

return ata_sff_prereset(link, deadline);
}

static int atiixp_cable_detect(struct ata_port *ap)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
Expand Down Expand Up @@ -229,10 +214,9 @@ static struct ata_port_operations atiixp_port_ops = {
.cable_detect = atiixp_cable_detect,
.set_piomode = atiixp_set_piomode,
.set_dmamode = atiixp_set_dmamode,
.prereset = atiixp_pre_reset,
};

static int atiixp_init_one(struct pci_dev *dev, const struct pci_device_id *id)
static int atiixp_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
{
static const struct ata_port_info info = {
.flags = ATA_FLAG_SLAVE_POSS,
Expand All @@ -241,8 +225,18 @@ static int atiixp_init_one(struct pci_dev *dev, const struct pci_device_id *id)
.udma_mask = 0x3F,
.port_ops = &atiixp_port_ops
};
const struct ata_port_info *ppi[] = { &info, NULL };
return ata_pci_sff_init_one(dev, ppi, &atiixp_sht, NULL);
static const struct pci_bits atiixp_enable_bits[] = {
{ 0x48, 1, 0x01, 0x00 },
{ 0x48, 1, 0x08, 0x00 }
};
const struct ata_port_info *ppi[] = { &info, &info };
int i;

for (i = 0; i < 2; i++)
if (!pci_test_config_bits(pdev, &atiixp_enable_bits[i]))
ppi[i] = &ata_dummy_port_info;

return ata_pci_sff_init_one(pdev, ppi, &atiixp_sht, NULL);
}

static const struct pci_device_id atiixp[] = {
Expand Down

0 comments on commit c4da28f

Please sign in to comment.