diff options
Diffstat (limited to 'drivers/ata/pata_hpt366.c')
-rw-r--r-- | drivers/ata/pata_hpt366.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c index 2663599a7c02..27d724b5eea2 100644 --- a/drivers/ata/pata_hpt366.c +++ b/drivers/ata/pata_hpt366.c | |||
@@ -151,23 +151,13 @@ static const char *bad_ata66_3[] = { | |||
151 | 151 | ||
152 | static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, const char *list[]) | 152 | static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, const char *list[]) |
153 | { | 153 | { |
154 | unsigned char model_num[40]; | 154 | unsigned char model_num[ATA_ID_PROD_LEN + 1]; |
155 | char *s; | ||
156 | unsigned int len; | ||
157 | int i = 0; | 155 | int i = 0; |
158 | 156 | ||
159 | ata_id_string(dev->id, model_num, ATA_ID_PROD_OFS, sizeof(model_num)); | 157 | ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); |
160 | s = &model_num[0]; | ||
161 | len = strnlen(s, sizeof(model_num)); | ||
162 | 158 | ||
163 | /* ATAPI specifies that empty space is blank-filled; remove blanks */ | 159 | while (list[i] != NULL) { |
164 | while ((len > 0) && (s[len - 1] == ' ')) { | 160 | if (!strcmp(list[i], model_num)) { |
165 | len--; | ||
166 | s[len] = 0; | ||
167 | } | ||
168 | |||
169 | while(list[i] != NULL) { | ||
170 | if (!strncmp(list[i], s, len)) { | ||
171 | printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", | 161 | printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", |
172 | modestr, list[i]); | 162 | modestr, list[i]); |
173 | return 1; | 163 | return 1; |
@@ -232,7 +222,7 @@ static int hpt36x_pre_reset(struct ata_port *ap) | |||
232 | 222 | ||
233 | if (!pci_test_config_bits(pdev, &hpt36x_enable_bits[ap->port_no])) | 223 | if (!pci_test_config_bits(pdev, &hpt36x_enable_bits[ap->port_no])) |
234 | return -ENOENT; | 224 | return -ENOENT; |
235 | 225 | ||
236 | pci_read_config_byte(pdev, 0x5A, &ata66); | 226 | pci_read_config_byte(pdev, 0x5A, &ata66); |
237 | if (ata66 & (1 << ap->port_no)) | 227 | if (ata66 & (1 << ap->port_no)) |
238 | ap->cbl = ATA_CBL_PATA40; | 228 | ap->cbl = ATA_CBL_PATA40; |
@@ -371,14 +361,14 @@ static struct ata_port_operations hpt366_port_ops = { | |||
371 | .qc_prep = ata_qc_prep, | 361 | .qc_prep = ata_qc_prep, |
372 | .qc_issue = ata_qc_issue_prot, | 362 | .qc_issue = ata_qc_issue_prot, |
373 | 363 | ||
374 | .data_xfer = ata_pio_data_xfer, | 364 | .data_xfer = ata_data_xfer, |
375 | 365 | ||
376 | .irq_handler = ata_interrupt, | 366 | .irq_handler = ata_interrupt, |
377 | .irq_clear = ata_bmdma_irq_clear, | 367 | .irq_clear = ata_bmdma_irq_clear, |
368 | .irq_on = ata_irq_on, | ||
369 | .irq_ack = ata_irq_ack, | ||
378 | 370 | ||
379 | .port_start = ata_port_start, | 371 | .port_start = ata_port_start, |
380 | .port_stop = ata_port_stop, | ||
381 | .host_stop = ata_host_stop | ||
382 | }; | 372 | }; |
383 | 373 | ||
384 | /** | 374 | /** |