Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269335
b: refs/heads/master
c: f6b5669
h: refs/heads/master
i:
  269333: c7f9f8a
  269331: 9aafdef
  269327: 782bfaa
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz authored and Jeff Garzik committed Oct 14, 2011
1 parent 8e853a9 commit bb637cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 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: d0dd4a016bf29ebc5074ae99c3dd2019c582f4e5
refs/heads/master: f6b56696b974a7d6d55f98ebcfb0a1099696fc2e
26 changes: 5 additions & 21 deletions trunk/drivers/ata/pata_artop.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,15 @@

static int clock = 0;

static int artop6210_pre_reset(struct ata_link *link, unsigned long deadline)
{
struct ata_port *ap = link->ap;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
const struct pci_bits artop_enable_bits[] = {
{ 0x4AU, 1U, 0x02UL, 0x02UL }, /* port 0 */
{ 0x4AU, 1U, 0x04UL, 0x04UL }, /* port 1 */
};

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

return ata_sff_prereset(link, deadline);
}

/**
* artop6260_pre_reset - check for 40/80 pin
* artop62x0_pre_reset - probe begin
* @link: link
* @deadline: deadline jiffies for the operation
*
* The ARTOP hardware reports the cable detect bits in register 0x49.
* Nothing complicated needed here.
*/

static int artop6260_pre_reset(struct ata_link *link, unsigned long deadline)
static int artop62x0_pre_reset(struct ata_link *link, unsigned long deadline)
{
static const struct pci_bits artop_enable_bits[] = {
{ 0x4AU, 1U, 0x02UL, 0x02UL }, /* port 0 */
Expand All @@ -73,7 +57,7 @@ static int artop6260_pre_reset(struct ata_link *link, unsigned long deadline)
struct ata_port *ap = link->ap;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);

/* Odd numbered device ids are the units with enable bits (the -R cards) */
/* Odd numbered device ids are the units with enable bits. */
if ((pdev->device & 1) &&
!pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no]))
return -ENOENT;
Expand Down Expand Up @@ -317,7 +301,7 @@ static struct ata_port_operations artop6210_ops = {
.cable_detect = ata_cable_40wire,
.set_piomode = artop6210_set_piomode,
.set_dmamode = artop6210_set_dmamode,
.prereset = artop6210_pre_reset,
.prereset = artop62x0_pre_reset,
.qc_defer = artop6210_qc_defer,
};

Expand All @@ -326,7 +310,7 @@ static struct ata_port_operations artop6260_ops = {
.cable_detect = artop6260_cable_detect,
.set_piomode = artop6260_set_piomode,
.set_dmamode = artop6260_set_dmamode,
.prereset = artop6260_pre_reset,
.prereset = artop62x0_pre_reset,
};


Expand Down

0 comments on commit bb637cd

Please sign in to comment.