diff options
author | Tejun Heo <htejun@gmail.com> | 2006-02-12 08:47:04 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-02-12 14:24:41 -0500 |
commit | 2e02671daa2cd69d93c828c40579bbe953f17210 (patch) | |
tree | bcafe5d5b36be475de57081600fae13408cd0c4e /drivers/scsi/sata_sil.c | |
parent | 0e949ff304a7ca07db38c17fbbf3ead1085d7bbf (diff) |
[PATCH] libata: use ata_dev_id_c_string()
Use ata_dev_id_c_string()
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/sata_sil.c')
-rw-r--r-- | drivers/scsi/sata_sil.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c index bd2887741d78..61c4ac7ff9db 100644 --- a/drivers/scsi/sata_sil.c +++ b/drivers/scsi/sata_sil.c | |||
@@ -337,22 +337,13 @@ static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) | |||
337 | static void sil_dev_config(struct ata_port *ap, struct ata_device *dev) | 337 | static void sil_dev_config(struct ata_port *ap, struct ata_device *dev) |
338 | { | 338 | { |
339 | unsigned int n, quirks = 0; | 339 | unsigned int n, quirks = 0; |
340 | unsigned char model_num[40]; | 340 | unsigned char model_num[41]; |
341 | const char *s; | ||
342 | unsigned int len; | ||
343 | 341 | ||
344 | ata_dev_id_string(dev->id, model_num, ATA_ID_PROD_OFS, | 342 | ata_dev_id_c_string(dev->id, model_num, ATA_ID_PROD_OFS, |
345 | sizeof(model_num)); | 343 | sizeof(model_num)); |
346 | s = &model_num[0]; | ||
347 | len = strnlen(s, sizeof(model_num)); | ||
348 | |||
349 | /* ATAPI specifies that empty space is blank-filled; remove blanks */ | ||
350 | while ((len > 0) && (s[len - 1] == ' ')) | ||
351 | len--; | ||
352 | 344 | ||
353 | for (n = 0; sil_blacklist[n].product; n++) | 345 | for (n = 0; sil_blacklist[n].product; n++) |
354 | if (!memcmp(sil_blacklist[n].product, s, | 346 | if (!strcmp(sil_blacklist[n].product, model_num)) { |
355 | strlen(sil_blacklist[n].product))) { | ||
356 | quirks = sil_blacklist[n].quirk; | 347 | quirks = sil_blacklist[n].quirk; |
357 | break; | 348 | break; |
358 | } | 349 | } |
@@ -372,7 +363,7 @@ static void sil_dev_config(struct ata_port *ap, struct ata_device *dev) | |||
372 | /* limit to udma5 */ | 363 | /* limit to udma5 */ |
373 | if (quirks & SIL_QUIRK_UDMA5MAX) { | 364 | if (quirks & SIL_QUIRK_UDMA5MAX) { |
374 | printk(KERN_INFO "ata%u(%u): applying Maxtor errata fix %s\n", | 365 | printk(KERN_INFO "ata%u(%u): applying Maxtor errata fix %s\n", |
375 | ap->id, dev->devno, s); | 366 | ap->id, dev->devno, model_num); |
376 | ap->udma_mask &= ATA_UDMA5; | 367 | ap->udma_mask &= ATA_UDMA5; |
377 | return; | 368 | return; |
378 | } | 369 | } |