Commit 6e9d8629 authored by Jeff Garzik's avatar Jeff Garzik

[libata] pata_marvell: minor and trivial cleanups

- use pci_iomap() [Alan, version 0.0.5t]
- fix Alan's version 0.0.5t change
- line length, trailing whitespace, case indentation cleanups
- don't use deprecated ->eng_timeout() in a driver that uses new EH
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 75742cb4
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <linux/ata.h> #include <linux/ata.h>
#define DRV_NAME "pata_marvell" #define DRV_NAME "pata_marvell"
#define DRV_VERSION "0.0.4t" #define DRV_VERSION "0.0.5u"
/** /**
* marvell_pre_reset - check for 40/80 pin * marvell_pre_reset - check for 40/80 pin
...@@ -33,14 +33,12 @@ static int marvell_pre_reset(struct ata_port *ap) ...@@ -33,14 +33,12 @@ static int marvell_pre_reset(struct ata_port *ap)
{ {
struct pci_dev *pdev = to_pci_dev(ap->host->dev); struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u32 devices; u32 devices;
unsigned long bar5;
void __iomem *barp; void __iomem *barp;
int i; int i;
/* Check if our port is enabled */ /* Check if our port is enabled */
bar5 = pci_resource_start(pdev, 5); barp = pci_iomap(pdev, 5, 0x10);
barp = ioremap(bar5, 0x10);
if (barp == NULL) if (barp == NULL)
return -ENOMEM; return -ENOMEM;
printk("BAR5:"); printk("BAR5:");
...@@ -49,9 +47,10 @@ static int marvell_pre_reset(struct ata_port *ap) ...@@ -49,9 +47,10 @@ static int marvell_pre_reset(struct ata_port *ap)
printk("\n"); printk("\n");
devices = readl(barp + 0x0C); devices = readl(barp + 0x0C);
iounmap(barp); pci_iounmap(pdev, barp);
if (pdev->device == 0x6145 && ap->port_no == 0 && !(devices & 0x10)) /* PATA enable ? */ if ((pdev->device == 0x6145) && (ap->port_no == 0) &&
(!(devices & 0x10))) /* PATA enable ? */
return -ENOENT; return -ENOENT;
/* Cable type */ /* Cable type */
...@@ -59,7 +58,7 @@ static int marvell_pre_reset(struct ata_port *ap) ...@@ -59,7 +58,7 @@ static int marvell_pre_reset(struct ata_port *ap)
{ {
case 0: case 0:
/* Might be backward, docs unclear */ /* Might be backward, docs unclear */
if(inb(ap->ioaddr.bmdma_addr + 1) & 1) if (inb(ap->ioaddr.bmdma_addr + 1) & 1)
ap->cbl = ATA_CBL_PATA80; ap->cbl = ATA_CBL_PATA80;
else else
ap->cbl = ATA_CBL_PATA40; ap->cbl = ATA_CBL_PATA40;
...@@ -81,7 +80,8 @@ static int marvell_pre_reset(struct ata_port *ap) ...@@ -81,7 +80,8 @@ static int marvell_pre_reset(struct ata_port *ap)
static void marvell_error_handler(struct ata_port *ap) static void marvell_error_handler(struct ata_port *ap)
{ {
return ata_bmdma_drive_eh(ap, marvell_pre_reset, ata_std_softreset, NULL, ata_std_postreset); return ata_bmdma_drive_eh(ap, marvell_pre_reset, ata_std_softreset,
NULL, ata_std_postreset);
} }
/* No PIO or DMA methods needed for this device */ /* No PIO or DMA methods needed for this device */
...@@ -130,7 +130,6 @@ static const struct ata_port_operations marvell_ops = { ...@@ -130,7 +130,6 @@ static const struct ata_port_operations marvell_ops = {
.data_xfer = ata_pio_data_xfer, .data_xfer = ata_pio_data_xfer,
/* Timeout handling */ /* Timeout handling */
.eng_timeout = ata_eng_timeout,
.irq_handler = ata_interrupt, .irq_handler = ata_interrupt,
.irq_clear = ata_bmdma_irq_clear, .irq_clear = ata_bmdma_irq_clear,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment