linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] pata_it8213: fix register naming used in it8213_set_piomode()
@ 2011-10-13 15:44 Bartlomiej Zolnierkiewicz
  2011-10-13 15:54 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2011-10-13 15:44 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide, linux-kernel

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH v2] pata_it8213: fix register naming used in it8213_set_piomode()

Rename 'idetm_port' and 'idetm_data' variables to 'master_port'
and 'master_data' respectively to match register naming used in
it8213_set_dmamode() and in ata_piix.c.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
v2: don't change master_port type

earlier references:
https://lkml.org/lkml/2011/2/8/103

 drivers/ata/pata_it8213.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Index: b/drivers/ata/pata_it8213.c
===================================================================
--- a/drivers/ata/pata_it8213.c
+++ b/drivers/ata/pata_it8213.c
@@ -76,8 +76,8 @@ static void it8213_set_piomode (struct a
 {
 	unsigned int pio	= adev->pio_mode - XFER_PIO_0;
 	struct pci_dev *dev	= to_pci_dev(ap->host->dev);
-	unsigned int idetm_port= ap->port_no ? 0x42 : 0x40;
-	u16 idetm_data;
+	unsigned int master_port = ap->port_no ? 0x42 : 0x40;
+	u16 master_data;
 	int control = 0;
 
 	/*
@@ -100,19 +100,19 @@ static void it8213_set_piomode (struct a
 	if (adev->class != ATA_DEV_ATA)
 		control |= 4;	/* PPE */
 
-	pci_read_config_word(dev, idetm_port, &idetm_data);
+	pci_read_config_word(dev, master_port, &master_data);
 
 	/* Set PPE, IE, and TIME as appropriate */
 	if (adev->devno == 0) {
-		idetm_data &= 0xCCF0;
-		idetm_data |= control;
-		idetm_data |= (timings[pio][0] << 12) |
+		master_data &= 0xCCF0;
+		master_data |= control;
+		master_data |= (timings[pio][0] << 12) |
 			(timings[pio][1] << 8);
 	} else {
 		u8 slave_data;
 
-		idetm_data &= 0xFF0F;
-		idetm_data |= (control << 4);
+		master_data &= 0xFF0F;
+		master_data |= (control << 4);
 
 		/* Slave timing in separate register */
 		pci_read_config_byte(dev, 0x44, &slave_data);
@@ -121,8 +121,8 @@ static void it8213_set_piomode (struct a
 		pci_write_config_byte(dev, 0x44, slave_data);
 	}
 
-	idetm_data |= 0x4000;	/* Ensure SITRE is set */
-	pci_write_config_word(dev, idetm_port, idetm_data);
+	master_data |= 0x4000;	/* Ensure SITRE is set */
+	pci_write_config_word(dev, master_port, master_data);
 }
 
 /**

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] pata_it8213: fix register naming used in it8213_set_piomode()
  2011-10-13 15:44 [PATCH v2] pata_it8213: fix register naming used in it8213_set_piomode() Bartlomiej Zolnierkiewicz
@ 2011-10-13 15:54 ` Alan Cox
  2011-10-13 16:10   ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2011-10-13 15:54 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Jeff Garzik, linux-ide, linux-kernel

On Thu, 13 Oct 2011 17:44:22 +0200
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:

> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH v2] pata_it8213: fix register naming used in it8213_set_piomode()
> 
> Rename 'idetm_port' and 'idetm_data' variables to 'master_port'
> and 'master_data' respectively to match register naming used in
> it8213_set_dmamode() and in ata_piix.c.

I do question this renaming. Surely we should reflect the names on the
data sheets if anything ?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] pata_it8213: fix register naming used in it8213_set_piomode()
  2011-10-13 15:54 ` Alan Cox
@ 2011-10-13 16:10   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2011-10-13 16:10 UTC (permalink / raw)
  To: Alan Cox; +Cc: Jeff Garzik, linux-ide, linux-kernel

Alan Cox wrote:

> On Thu, 13 Oct 2011 17:44:22 +0200
> Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> 
> > From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > Subject: [PATCH v2] pata_it8213: fix register naming used in it8213_set_piomode()
> > 
> > Rename 'idetm_port' and 'idetm_data' variables to 'master_port'
> > and 'master_data' respectively to match register naming used in
> > it8213_set_dmamode() and in ata_piix.c.
> 
> I do question this renaming. Surely we should reflect the names on the
> data sheets if anything ?

Please lets have some consistency in the driver first (same names used
in ->set_piomode and ->set_dmamode)..  we can always do global rename
later if needed.
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-13 16:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-13 15:44 [PATCH v2] pata_it8213: fix register naming used in it8213_set_piomode() Bartlomiej Zolnierkiewicz
2011-10-13 15:54 ` Alan Cox
2011-10-13 16:10   ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).