diff options
author | Sergei Shtylylov <sshtylyov@ru.mvista.com> | 2008-10-13 15:39:30 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-13 15:39:30 -0400 |
commit | 9b5a18e19f8c610c270ee9a0ba03177d737f6aa5 (patch) | |
tree | 0919d07d5767fe06cb2034515c1a23c0c44579c6 /drivers/ide/pci | |
parent | aa95f0e76571dc1b067d2839c11f2e5589d063d7 (diff) |
sgiioc4: fix messages
Fix several issues with the log messages printed by ide_dma_sgiioc4() and
sgiioc4_ide_setup_pci_device():
- IOC4 registers are memory-mapped but the "BM-DMA at" format corresponds to
I/O mapped registers;
- "%p" format specifiers and type casts used to print non-pointer values;
- using KERN_INFO log level for the error message;
- 'hwif->name' printed as drive's name.
While at it, also:
- return more fitting -EBUSY if request_mem_region() fails;
- make the error message style consistent;
- fix indentation, put the printk() facility and message on the same line;
- use comparisions with NULL instead of ! operator..
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: jeremy@sgi.com
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci')
-rw-r--r-- | drivers/ide/pci/sgiioc4.c | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index 12ad4ca4b037..84cd986810cf 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c | |||
@@ -339,23 +339,20 @@ ide_dma_sgiioc4(ide_hwif_t *hwif, const struct ide_port_info *d) | |||
339 | if (dma_base == 0) | 339 | if (dma_base == 0) |
340 | return -1; | 340 | return -1; |
341 | 341 | ||
342 | printk(KERN_INFO "%s: BM-DMA at 0x%04lx-0x%04lx\n", hwif->name, | 342 | printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name); |
343 | dma_base, dma_base + num_ports - 1); | ||
344 | 343 | ||
345 | if (!request_mem_region(dma_base, num_ports, hwif->name)) { | 344 | if (request_mem_region(dma_base, num_ports, hwif->name) == NULL) { |
346 | printk(KERN_ERR | 345 | printk(KERN_ERR "%s(%s) -- ERROR: addresses 0x%08lx to 0x%08lx " |
347 | "%s(%s) -- ERROR, Addresses 0x%p to 0x%p " | 346 | "already in use\n", __func__, hwif->name, |
348 | "ALREADY in use\n", | 347 | dma_base, dma_base + num_ports - 1); |
349 | __func__, hwif->name, (void *) dma_base, | ||
350 | (void *) dma_base + num_ports - 1); | ||
351 | return -1; | 348 | return -1; |
352 | } | 349 | } |
353 | 350 | ||
354 | virt_dma_base = ioremap(dma_base, num_ports); | 351 | virt_dma_base = ioremap(dma_base, num_ports); |
355 | if (virt_dma_base == NULL) { | 352 | if (virt_dma_base == NULL) { |
356 | printk(KERN_ERR | 353 | printk(KERN_ERR "%s(%s) -- ERROR: unable to map addresses " |
357 | "%s(%s) -- ERROR, Unable to map addresses 0x%lx to 0x%lx\n", | 354 | "0x%lx to 0x%lx\n", __func__, hwif->name, |
358 | __func__, hwif->name, dma_base, dma_base + num_ports - 1); | 355 | dma_base, dma_base + num_ports - 1); |
359 | goto dma_remap_failure; | 356 | goto dma_remap_failure; |
360 | } | 357 | } |
361 | hwif->dma_base = (unsigned long) virt_dma_base; | 358 | hwif->dma_base = (unsigned long) virt_dma_base; |
@@ -378,11 +375,9 @@ ide_dma_sgiioc4(ide_hwif_t *hwif, const struct ide_port_info *d) | |||
378 | 375 | ||
379 | pci_free_consistent(dev, IOC4_PRD_ENTRIES * IOC4_PRD_BYTES, | 376 | pci_free_consistent(dev, IOC4_PRD_ENTRIES * IOC4_PRD_BYTES, |
380 | hwif->dmatable_cpu, hwif->dmatable_dma); | 377 | hwif->dmatable_cpu, hwif->dmatable_dma); |
381 | printk(KERN_INFO | 378 | printk(KERN_ERR "%s(%s) -- ERROR: Unable to allocate DMA maps\n", |
382 | "%s() -- Error! Unable to allocate DMA Maps for drive %s\n", | ||
383 | __func__, hwif->name); | 379 | __func__, hwif->name); |
384 | printk(KERN_INFO | 380 | printk(KERN_INFO "%s: changing from DMA to PIO mode", hwif->name); |
385 | "Changing from DMA to PIO mode for Drive %s\n", hwif->name); | ||
386 | 381 | ||
387 | dma_pci_alloc_failure: | 382 | dma_pci_alloc_failure: |
388 | iounmap(virt_dma_base); | 383 | iounmap(virt_dma_base); |
@@ -618,14 +613,12 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev) | |||
618 | irqport = (unsigned long) virt_base + IOC4_INTR_OFFSET; | 613 | irqport = (unsigned long) virt_base + IOC4_INTR_OFFSET; |
619 | 614 | ||
620 | cmd_phys_base = bar0 + IOC4_CMD_OFFSET; | 615 | cmd_phys_base = bar0 + IOC4_CMD_OFFSET; |
621 | if (!request_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE, | 616 | if (request_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE, |
622 | DRV_NAME)) { | 617 | DRV_NAME) == NULL) { |
623 | printk(KERN_ERR | 618 | printk(KERN_ERR "%s %s -- ERROR: addresses 0x%08lx to 0x%08lx " |
624 | "%s %s: -- ERROR, Addresses " | 619 | "already in use\n", DRV_NAME, pci_name(dev), |
625 | "0x%p to 0x%p ALREADY in use\n", | 620 | cmd_phys_base, cmd_phys_base + IOC4_CMD_CTL_BLK_SIZE); |
626 | DRV_NAME, pci_name(dev), (void *)cmd_phys_base, | 621 | return -EBUSY; |
627 | (void *) cmd_phys_base + IOC4_CMD_CTL_BLK_SIZE); | ||
628 | return -ENOMEM; | ||
629 | } | 622 | } |
630 | 623 | ||
631 | /* Initialize the IO registers */ | 624 | /* Initialize the IO registers */ |