Bartlomiej Zolnierkiewicz wrote:
quoted text > * Move dma_base check from sgiioc4_ide_setup_pci_device()
> to ide_dma_sgiioc4().
This check should've been thrown out -- it's never true.
quoted text > * Replace ide_dma_sgiioc4() 'unsigned long dma_base' argument
> by 'const struct ide_port_info *d'.
quoted text > * Move hwif->INB setup from ide_init_sgiioc4() to
> sgiioc4_ide_setup_pci_device().
quoted text > * Move ide_init_sgiioc4() call from sgiioc4_ide_setup_pci_device()
> to ide_dma_sgiioc4().
quoted text > * Convert the driver to use ->init_dma method.
quoted text > Cc: Jeremy Higdon <jeremy@sgi.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
quoted text > Index: b/drivers/ide/pci/sgiioc4.c
> ===================================================================
> --- a/drivers/ide/pci/sgiioc4.c
> +++ b/drivers/ide/pci/sgiioc4.c
> @@ -327,15 +327,21 @@ sgiioc4_INB(unsigned long port)
> return reg;
> }
>
> +static void __devinit ide_init_sgiioc4(ide_hwif_t *);
> +
> /* Creates a dma map for the scatter-gather list entries */
> static int __devinit
> -ide_dma_sgiioc4(ide_hwif_t * hwif, unsigned long dma_base)
> +ide_dma_sgiioc4(ide_hwif_t *hwif, const struct ide_port_info *d)
> {
> struct pci_dev *dev = to_pci_dev(hwif->dev);
> + unsigned long dma_base = pci_resource_start(dev, 0) + IOC4_DMA_OFFSET;
> void __iomem *virt_dma_base;
> int num_ports = sizeof (ioc4_dma_regs_t);
> void *pad;
>
> + if (dma_base == 0)
> + return -1;
> +
It should be quite obvious that 'dma_base' will never be 0 since
IOC4_DMA_OFFSET == 0x140.
quoted text > printk(KERN_INFO "%s: BM-DMA at 0x%04lx-0x%04lx\n", hwif->name,
> dma_base, dma_base + num_ports - 1);
It should print "MMIO-DMA" since the registers are memory-mapped.
Making another notch...
MBR, Sergei
--
unsubscribe notice To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Messages in current thread:
Re: [PATCH 5/7] sgiioc4: use ->init_dma method , Sergei Shtylyov , (Tue Sep 9, 12:32 pm)