All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 6/9] au1xxx-ide: use hwif->dev
Date: Thu, 27 Dec 2007 20:12:38 +0100	[thread overview]
Message-ID: <20071227191238.1357.62168.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20071227191153.1357.63211.sendpatchset@localhost.localdomain>

* Setup hwif->dev in au_ide_probe().

* Use hwif->dev instead of ahwif->dev in auide_build_sglist(),
  auide_build_dmatable(), auide_dma_end() and auide_ddma_init().

* Remove no longer needed 'dev' field from _auide_hwif type.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/mips/au1xxx-ide.c             |   15 ++++++---------
 include/asm-mips/mach-au1x00/au1xxx_ide.h |    1 -
 2 files changed, 6 insertions(+), 10 deletions(-)

Index: b/drivers/ide/mips/au1xxx-ide.c
===================================================================
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -213,7 +213,6 @@ static void auide_set_dma_mode(ide_drive
 static int auide_build_sglist(ide_drive_t *drive,  struct request *rq)
 {
 	ide_hwif_t *hwif = drive->hwif;
-	_auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data;
 	struct scatterlist *sg = hwif->sg_table;
 
 	ide_map_sg(drive, rq);
@@ -223,7 +222,7 @@ static int auide_build_sglist(ide_drive_
 	else
 		hwif->sg_dma_direction = DMA_TO_DEVICE;
 
-	return dma_map_sg(ahwif->dev, sg, hwif->sg_nents,
+	return dma_map_sg(hwif->dev, sg, hwif->sg_nents,
 			  hwif->sg_dma_direction);
 }
 
@@ -300,7 +299,7 @@ static int auide_build_dmatable(ide_driv
 		return 1;
 
  use_pio_instead:
-	dma_unmap_sg(ahwif->dev,
+	dma_unmap_sg(hwif->dev,
 		     hwif->sg_table,
 		     hwif->sg_nents,
 		     hwif->sg_dma_direction);
@@ -311,10 +310,9 @@ static int auide_build_dmatable(ide_driv
 static int auide_dma_end(ide_drive_t *drive)
 {
 	ide_hwif_t *hwif = HWIF(drive);
-	_auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data;
 
 	if (hwif->sg_nents) {
-		dma_unmap_sg(ahwif->dev, hwif->sg_table, hwif->sg_nents,
+		dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->sg_nents,
 			     hwif->sg_dma_direction);
 		hwif->sg_nents = 0;
 	}
@@ -504,7 +502,7 @@ static int auide_ddma_init(_auide_hwif *
 	auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan,
 							     NUM_DESCRIPTORS);
  
-	hwif->dmatable_cpu = dma_alloc_coherent(auide->dev,
+	hwif->dmatable_cpu = dma_alloc_coherent(hwif->dev,
 						PRD_ENTRIES * PRD_BYTES,        /* 1 Page */
 						&hwif->dmatable_dma, GFP_KERNEL);
 	
@@ -592,9 +590,6 @@ static int au_ide_probe(struct device *d
 #endif
 
 	memset(&auide_hwif, 0, sizeof(_auide_hwif));
-	auide_hwif.dev                  = 0;
-
-	ahwif->dev = dev;
 	ahwif->irq = platform_get_irq(pdev, 0);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -633,6 +628,8 @@ static int au_ide_probe(struct device *d
 
 	ide_init_port_hw(hwif, &hw);
 
+	hwif->dev = dev;
+
 	hwif->ultra_mask                = 0x0;  /* Disable Ultra DMA */
 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
 	hwif->mwdma_mask                = 0x07; /* Multimode-2 DMA  */
Index: b/include/asm-mips/mach-au1x00/au1xxx_ide.h
===================================================================
--- a/include/asm-mips/mach-au1x00/au1xxx_ide.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h
@@ -74,7 +74,6 @@ typedef struct
         struct dbdma_cmd        *dma_table_cpu;
         dma_addr_t              dma_table_dma;
 #endif
-        struct device           *dev;
 	int			irq;
 	u32			regbase;
 #ifdef CONFIG_PM

WARNING: multiple messages have this Message-ID (diff)
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org, bzolnier@gmail.com
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 6/9] au1xxx-ide: use hwif->dev
Date: Thu, 27 Dec 2007 20:12:38 +0100	[thread overview]
Message-ID: <20071227191238.1357.62168.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20071227191153.1357.63211.sendpatchset@localhost.localdomain>

* Setup hwif->dev in au_ide_probe().

* Use hwif->dev instead of ahwif->dev in auide_build_sglist(),
  auide_build_dmatable(), auide_dma_end() and auide_ddma_init().

* Remove no longer needed 'dev' field from _auide_hwif type.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/mips/au1xxx-ide.c             |   15 ++++++---------
 include/asm-mips/mach-au1x00/au1xxx_ide.h |    1 -
 2 files changed, 6 insertions(+), 10 deletions(-)

Index: b/drivers/ide/mips/au1xxx-ide.c
===================================================================
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -213,7 +213,6 @@ static void auide_set_dma_mode(ide_drive
 static int auide_build_sglist(ide_drive_t *drive,  struct request *rq)
 {
 	ide_hwif_t *hwif = drive->hwif;
-	_auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data;
 	struct scatterlist *sg = hwif->sg_table;
 
 	ide_map_sg(drive, rq);
@@ -223,7 +222,7 @@ static int auide_build_sglist(ide_drive_
 	else
 		hwif->sg_dma_direction = DMA_TO_DEVICE;
 
-	return dma_map_sg(ahwif->dev, sg, hwif->sg_nents,
+	return dma_map_sg(hwif->dev, sg, hwif->sg_nents,
 			  hwif->sg_dma_direction);
 }
 
@@ -300,7 +299,7 @@ static int auide_build_dmatable(ide_driv
 		return 1;
 
  use_pio_instead:
-	dma_unmap_sg(ahwif->dev,
+	dma_unmap_sg(hwif->dev,
 		     hwif->sg_table,
 		     hwif->sg_nents,
 		     hwif->sg_dma_direction);
@@ -311,10 +310,9 @@ static int auide_build_dmatable(ide_driv
 static int auide_dma_end(ide_drive_t *drive)
 {
 	ide_hwif_t *hwif = HWIF(drive);
-	_auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data;
 
 	if (hwif->sg_nents) {
-		dma_unmap_sg(ahwif->dev, hwif->sg_table, hwif->sg_nents,
+		dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->sg_nents,
 			     hwif->sg_dma_direction);
 		hwif->sg_nents = 0;
 	}
@@ -504,7 +502,7 @@ static int auide_ddma_init(_auide_hwif *
 	auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan,
 							     NUM_DESCRIPTORS);
  
-	hwif->dmatable_cpu = dma_alloc_coherent(auide->dev,
+	hwif->dmatable_cpu = dma_alloc_coherent(hwif->dev,
 						PRD_ENTRIES * PRD_BYTES,        /* 1 Page */
 						&hwif->dmatable_dma, GFP_KERNEL);
 	
@@ -592,9 +590,6 @@ static int au_ide_probe(struct device *d
 #endif
 
 	memset(&auide_hwif, 0, sizeof(_auide_hwif));
-	auide_hwif.dev                  = 0;
-
-	ahwif->dev = dev;
 	ahwif->irq = platform_get_irq(pdev, 0);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -633,6 +628,8 @@ static int au_ide_probe(struct device *d
 
 	ide_init_port_hw(hwif, &hw);
 
+	hwif->dev = dev;
+
 	hwif->ultra_mask                = 0x0;  /* Disable Ultra DMA */
 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
 	hwif->mwdma_mask                = 0x07; /* Multimode-2 DMA  */
Index: b/include/asm-mips/mach-au1x00/au1xxx_ide.h
===================================================================
--- a/include/asm-mips/mach-au1x00/au1xxx_ide.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h
@@ -74,7 +74,6 @@ typedef struct
         struct dbdma_cmd        *dma_table_cpu;
         dma_addr_t              dma_table_dma;
 #endif
-        struct device           *dev;
 	int			irq;
 	u32			regbase;
 #ifdef CONFIG_PM

  parent reply	other threads:[~2007-12-27 19:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-27 19:11 [PATCH 0/9] ide: switch to generic DMA-mapping API Bartlomiej Zolnierkiewicz
2007-12-27 19:11 ` Bartlomiej Zolnierkiewicz
2007-12-27 19:12 ` [PATCH 1/9] piix: remove stale comments Bartlomiej Zolnierkiewicz
2007-12-27 19:12   ` Bartlomiej Zolnierkiewicz
2007-12-28 12:02   ` Sergei Shtylyov
2007-12-30 17:09     ` Bartlomiej Zolnierkiewicz
2007-12-27 19:12 ` [PATCH 2/9] ide: fix ide_intr() for non-PCI devices and CONFIG_BLK_DEV_IDEPCI=y Bartlomiej Zolnierkiewicz
2007-12-27 19:12   ` Bartlomiej Zolnierkiewicz
2007-12-28 12:15   ` Sergei Shtylyov
2007-12-27 19:12 ` [PATCH 3/9] ide: remove BUG_ON() from ide_build_sglist() Bartlomiej Zolnierkiewicz
2007-12-27 19:12   ` Bartlomiej Zolnierkiewicz
2007-12-27 19:12 ` [PATCH 4/9] ide: use ide_destroy_dmatable() instead of pci_unmap_sg() Bartlomiej Zolnierkiewicz
2007-12-27 19:12   ` Bartlomiej Zolnierkiewicz
2007-12-29 13:43   ` Sergei Shtylyov
2007-12-27 19:12 ` [PATCH 5/9] ide: keep pointer to struct device instead of struct pci_dev in ide_hwif_t Bartlomiej Zolnierkiewicz
2007-12-27 19:12   ` Bartlomiej Zolnierkiewicz
2007-12-27 19:12 ` Bartlomiej Zolnierkiewicz [this message]
2007-12-27 19:12   ` [PATCH 6/9] au1xxx-ide: use hwif->dev Bartlomiej Zolnierkiewicz
2007-12-27 19:12 ` [PATCH 7/9] icside: " Bartlomiej Zolnierkiewicz
2007-12-27 19:12   ` Bartlomiej Zolnierkiewicz
2007-12-28 13:24   ` Sergei Shtylyov
2007-12-29 13:52   ` Sergei Shtylyov
2007-12-29 13:55     ` Sergei Shtylyov
2007-12-27 19:12 ` [PATCH 8/9] ide: switch to DMA-mapping API Bartlomiej Zolnierkiewicz
2007-12-27 19:12   ` Bartlomiej Zolnierkiewicz
2008-01-02  8:34   ` Bryan Wu
2007-12-27 19:12 ` [PATCH 9/9] ide: use ide_build_sglist() and ide_destroy_dmatable() in non-PCI host drivers Bartlomiej Zolnierkiewicz
2007-12-27 19:12   ` Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071227191238.1357.62168.sendpatchset@localhost.localdomain \
    --to=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.