Re: [PATCH 4/6] trm290: add IDE_HFLAG_TRM290 host flag

Sergei Shtylyov
2008-11-04T17:36:46Z

Bartlomiej Zolnierkiewicz wrote:

> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] trm290: add IDE_HFLAG_TRM290 host flag

> * Add IDE_HFLAG_TRM290 host flag and use it in ide_build_dmatable().

Actually, I've considered removing TRM290 hacks from that function and
re-implemeting the whole thing in the driver but that wouldn't sever this
driver's ties with CONFIG_BLK_DEV_IDEDMA_SFF since the latter gets selected by
CONFIG_BLK_DEV_IDEDMA_PCI...

> * Remove no longer needed ide_trm290 chipset type.

> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

> Index: b/drivers/ide/ide-dma-sff.c
> ===================================================================
> --- a/drivers/ide/ide-dma-sff.c
> +++ b/drivers/ide/ide-dma-sff.c
> @@ -98,10 +98,10 @@ int ide_build_dmatable(ide_drive_t *driv
> {
> ide_hwif_t *hwif = drive->hwif;
> __le32 *table = (__le32 *)hwif->dmatable_cpu;
> - unsigned int is_trm290 = (hwif->chipset == ide_trm290) ? 1 : 0;
> unsigned int count = 0;
> int i;
> struct scatterlist *sg;
> + u8 is_trm290 = !!(hwif->host_flags & IDE_HFLAG_TRM290);

I'd keep all the initilaized variables together...

MBR, Sergei