aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_cmd640.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_cmd640.c')
-rw-r--r--drivers/ata/pata_cmd640.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/ata/pata_cmd640.c b/drivers/ata/pata_cmd640.c
index 45896b3c6538..e5f289f59ca3 100644
--- a/drivers/ata/pata_cmd640.c
+++ b/drivers/ata/pata_cmd640.c
@@ -153,24 +153,20 @@ static int cmd640_port_start(struct ata_port *ap)
153 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 153 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
154 struct cmd640_reg *timing; 154 struct cmd640_reg *timing;
155 155
156 int ret = ata_sff_port_start(ap);
157 if (ret < 0)
158 return ret;
159
160 timing = devm_kzalloc(&pdev->dev, sizeof(struct cmd640_reg), GFP_KERNEL); 156 timing = devm_kzalloc(&pdev->dev, sizeof(struct cmd640_reg), GFP_KERNEL);
161 if (timing == NULL) 157 if (timing == NULL)
162 return -ENOMEM; 158 return -ENOMEM;
163 timing->last = -1; /* Force a load */ 159 timing->last = -1; /* Force a load */
164 ap->private_data = timing; 160 ap->private_data = timing;
165 return ret; 161 return 0;
166} 162}
167 163
168static struct scsi_host_template cmd640_sht = { 164static struct scsi_host_template cmd640_sht = {
169 ATA_BMDMA_SHT(DRV_NAME), 165 ATA_PIO_SHT(DRV_NAME),
170}; 166};
171 167
172static struct ata_port_operations cmd640_port_ops = { 168static struct ata_port_operations cmd640_port_ops = {
173 .inherits = &ata_bmdma_port_ops, 169 .inherits = &ata_sff_port_ops,
174 /* In theory xfer_noirq is not needed once we kill the prefetcher */ 170 /* In theory xfer_noirq is not needed once we kill the prefetcher */
175 .sff_data_xfer = ata_sff_data_xfer_noirq, 171 .sff_data_xfer = ata_sff_data_xfer_noirq,
176 .qc_issue = cmd640_qc_issue, 172 .qc_issue = cmd640_qc_issue,
@@ -181,13 +177,10 @@ static struct ata_port_operations cmd640_port_ops = {
181 177
182static void cmd640_hardware_init(struct pci_dev *pdev) 178static void cmd640_hardware_init(struct pci_dev *pdev)
183{ 179{
184 u8 r;
185 u8 ctrl; 180 u8 ctrl;
186 181
187 /* CMD640 detected, commiserations */ 182 /* CMD640 detected, commiserations */
188 pci_write_config_byte(pdev, 0x5B, 0x00); 183 pci_write_config_byte(pdev, 0x5B, 0x00);
189 /* Get version info */
190 pci_read_config_byte(pdev, CFR, &r);
191 /* PIO0 command cycles */ 184 /* PIO0 command cycles */
192 pci_write_config_byte(pdev, CMDTIM, 0); 185 pci_write_config_byte(pdev, CMDTIM, 0);
193 /* 512 byte bursts (sector) */ 186 /* 512 byte bursts (sector) */