Skip to contentSkip to conversation

ide-pmac: use custom hwif->sg_max_nents only if DMA support is enabled

PATCH In review Bartlomiej Zolnierkiewicz 3 participants 3 messages Nov 27, 2007 – Nov 28, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 6/6 ide-pmac: use custom hwif->sg_max_nents only if DMA support is enabled

Move setting hwif->sg_max_nents from pmac_ide_setup_device() to pmac_ide_setup_dma().

---
 drivers/ide/ppc/pmac.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ide/ppc/pmac.c +2 -2
Index: b/drivers/ide/ppc/pmac.c
===================================================================
@@ -1133,8 +1133,6 @@ pmac_ide_setup_device(pmac_ide_hwif_t *p
 		hwif->noprobe = 0;
 #endif /* CONFIG_PMAC_MEDIABAY */
 
-	hwif->sg_max_nents = MAX_DCMDS;
-
 #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
 	/* has a DBDMA controller channel */
 	if (pmif->dma_regs)
@@ -1751,6 +1749,8 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif
 		return;
 	}
 
+	hwif->sg_max_nents = MAX_DCMDS;
+
 	hwif->dma_host_set = &pmac_ide_dma_host_set;
 	hwif->dma_setup = &pmac_ide_dma_setup;
 	hwif->dma_exec_cmd = &pmac_ide_dma_exec_cmd;
#1 lore raw
Quoted 5 lines · Bartlomiej Zolnierkiewicz

Move setting hwif->sg_max_nents from pmac_ide_setup_device() to pmac_ide_setup_dma().

Ack.

Quoted 26 lines
---
 drivers/ide/ppc/pmac.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: b/drivers/ide/ppc/pmac.c
===================================================================

drivers/ide/ppc/pmac.c +2 -2
@@ -1133,8 +1133,6 @@ pmac_ide_setup_device(pmac_ide_hwif_t *p
 		hwif->noprobe = 0;
 #endif /* CONFIG_PMAC_MEDIABAY */
 
-	hwif->sg_max_nents = MAX_DCMDS;
-
 #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
 	/* has a DBDMA controller channel */
 	if (pmif->dma_regs)
@@ -1751,6 +1749,8 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif
 		return;
 	}
 
+	hwif->sg_max_nents = MAX_DCMDS;
+
 	hwif->dma_host_set = &pmac_ide_dma_host_set;
 	hwif->dma_setup = &pmac_ide_dma_setup;
 	hwif->dma_exec_cmd = &pmac_ide_dma_exec_cmd;