diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2011-10-11 13:45:52 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2011-10-14 13:06:56 -0400 |
commit | f6b56696b974a7d6d55f98ebcfb0a1099696fc2e (patch) | |
tree | 8fcac87e23e36d62b9d09d33a4c29772b2a8532a /drivers/ata | |
parent | d0dd4a016bf29ebc5074ae99c3dd2019c582f4e5 (diff) |
pata_artop: unify ->prereset methods
* Unify ->prereset methods for ATP850 and ATP86x[R] chipsets.
* Fix ->prereset documentation while at it.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/pata_artop.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c index 78a93b690959..ef2bec0d4479 100644 --- a/drivers/ata/pata_artop.c +++ b/drivers/ata/pata_artop.c | |||
@@ -39,31 +39,15 @@ | |||
39 | 39 | ||
40 | static int clock = 0; | 40 | static int clock = 0; |
41 | 41 | ||
42 | static int artop6210_pre_reset(struct ata_link *link, unsigned long deadline) | ||
43 | { | ||
44 | struct ata_port *ap = link->ap; | ||
45 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | ||
46 | const struct pci_bits artop_enable_bits[] = { | ||
47 | { 0x4AU, 1U, 0x02UL, 0x02UL }, /* port 0 */ | ||
48 | { 0x4AU, 1U, 0x04UL, 0x04UL }, /* port 1 */ | ||
49 | }; | ||
50 | |||
51 | if (!pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no])) | ||
52 | return -ENOENT; | ||
53 | |||
54 | return ata_sff_prereset(link, deadline); | ||
55 | } | ||
56 | |||
57 | /** | 42 | /** |
58 | * artop6260_pre_reset - check for 40/80 pin | 43 | * artop62x0_pre_reset - probe begin |
59 | * @link: link | 44 | * @link: link |
60 | * @deadline: deadline jiffies for the operation | 45 | * @deadline: deadline jiffies for the operation |
61 | * | 46 | * |
62 | * The ARTOP hardware reports the cable detect bits in register 0x49. | ||
63 | * Nothing complicated needed here. | 47 | * Nothing complicated needed here. |
64 | */ | 48 | */ |
65 | 49 | ||
66 | static int artop6260_pre_reset(struct ata_link *link, unsigned long deadline) | 50 | static int artop62x0_pre_reset(struct ata_link *link, unsigned long deadline) |
67 | { | 51 | { |
68 | static const struct pci_bits artop_enable_bits[] = { | 52 | static const struct pci_bits artop_enable_bits[] = { |
69 | { 0x4AU, 1U, 0x02UL, 0x02UL }, /* port 0 */ | 53 | { 0x4AU, 1U, 0x02UL, 0x02UL }, /* port 0 */ |
@@ -73,7 +57,7 @@ static int artop6260_pre_reset(struct ata_link *link, unsigned long deadline) | |||
73 | struct ata_port *ap = link->ap; | 57 | struct ata_port *ap = link->ap; |
74 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 58 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
75 | 59 | ||
76 | /* Odd numbered device ids are the units with enable bits (the -R cards) */ | 60 | /* Odd numbered device ids are the units with enable bits. */ |
77 | if ((pdev->device & 1) && | 61 | if ((pdev->device & 1) && |
78 | !pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no])) | 62 | !pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no])) |
79 | return -ENOENT; | 63 | return -ENOENT; |
@@ -317,7 +301,7 @@ static struct ata_port_operations artop6210_ops = { | |||
317 | .cable_detect = ata_cable_40wire, | 301 | .cable_detect = ata_cable_40wire, |
318 | .set_piomode = artop6210_set_piomode, | 302 | .set_piomode = artop6210_set_piomode, |
319 | .set_dmamode = artop6210_set_dmamode, | 303 | .set_dmamode = artop6210_set_dmamode, |
320 | .prereset = artop6210_pre_reset, | 304 | .prereset = artop62x0_pre_reset, |
321 | .qc_defer = artop6210_qc_defer, | 305 | .qc_defer = artop6210_qc_defer, |
322 | }; | 306 | }; |
323 | 307 | ||
@@ -326,7 +310,7 @@ static struct ata_port_operations artop6260_ops = { | |||
326 | .cable_detect = artop6260_cable_detect, | 310 | .cable_detect = artop6260_cable_detect, |
327 | .set_piomode = artop6260_set_piomode, | 311 | .set_piomode = artop6260_set_piomode, |
328 | .set_dmamode = artop6260_set_dmamode, | 312 | .set_dmamode = artop6260_set_dmamode, |
329 | .prereset = artop6260_pre_reset, | 313 | .prereset = artop62x0_pre_reset, |
330 | }; | 314 | }; |
331 | 315 | ||
332 | 316 | ||