public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 7/9] cs5536: convert to ide2libata
Date: Sat, 30 Jan 2010 16:55:47 -0500	[thread overview]
Message-ID: <4B64AAE3.5040501@garzik.org> (raw)
In-Reply-To: <20100130195004.30779.89524.sendpatchset@localhost>

On 01/30/2010 02:50 PM, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz<bzolnier@gmail.com>
> Subject: [PATCH] cs5536: convert to ide2libata
>
> Signed-off-by: Bartlomiej Zolnierkiewicz<bzolnier@gmail.com>
> ---
>   drivers/ata/pata_cs5536.h |   22 +++++
>   drivers/ide/cs5536.c      |  189 +---------------------------------------------
>   2 files changed, 26 insertions(+), 185 deletions(-)
>
> Index: b/drivers/ata/pata_cs5536.h
> ===================================================================
> --- a/drivers/ata/pata_cs5536.h
> +++ b/drivers/ata/pata_cs5536.h
> @@ -64,7 +64,11 @@ static int cs5536_write(struct pci_dev *
>
>   static void cs5536_program_dtc(struct ata_device *adev, u8 tim)
>   {
> +#ifndef __IDE2LIBATA
>   	struct pci_dev *pdev = to_pci_dev(adev->link->ap->host->dev);
> +#else
> +	struct pci_dev *pdev = to_pci_dev(adev->hwif->dev);
> +#endif
>   	int dshift = adev->devno ? IDE_D1_SHIFT : IDE_D0_SHIFT;
>   	u32 dtc;
>
> @@ -121,11 +125,19 @@ static void cs5536_set_piomode(struct at
>   	int mode = adev->pio_mode - XFER_PIO_0;
>   	int cmdmode = mode;
>   	int cshift = adev->devno ? IDE_CAST_D1_SHIFT : IDE_CAST_D0_SHIFT;
> +#ifdef __IDE2LIBATA
> +	unsigned long timings = (unsigned long)ide_get_drivedata(adev);
> +#endif
>   	u32 cast;
>
>   	if (pair)
>   		cmdmode = min(mode, pair->pio_mode - XFER_PIO_0);
>
> +#ifdef __IDE2LIBATA
> +	timings&= (IDE_DRV_MASK<<  8);
> +	timings |= drv_timings[mode];
> +	ide_set_drivedata(adev, (void *)timings);
> +#endif
>   	cs5536_program_dtc(adev, drv_timings[mode]);
>
>   	cs5536_read(pdev, CAST,&cast);
> @@ -160,7 +172,9 @@ static void cs5536_set_dmamode(struct at
>   	u32 etc;
>   	int mode = adev->dma_mode;
>   	int dshift = adev->devno ? IDE_D1_SHIFT : IDE_D0_SHIFT;
> -
> +#ifdef __IDE2LIBATA
> +	unsigned long timings = (unsigned long)ide_get_drivedata(adev);
> +#endif
>   	cs5536_read(pdev, ETC,&etc);
>
>   	if (mode>= XFER_UDMA_0) {
> @@ -168,7 +182,13 @@ static void cs5536_set_dmamode(struct at
>   		etc |= udma_timings[mode - XFER_UDMA_0]<<  dshift;
>   	} else { /* MWDMA */
>   		etc&= ~(IDE_ETC_UDMA_MASK<<  dshift);
> +#ifndef __IDE2LIBATA
>   		cs5536_program_dtc(adev, mwdma_timings[mode - XFER_MW_DMA_0]);
> +#else
> +		timings&= IDE_DRV_MASK;
> +		timings |= mwdma_timings[mode - XFER_MW_DMA_0]<<  8;
> +		ide_set_drivedata(adev, (void *)timings);
> +#endif
>   	}
>
>   	cs5536_write(pdev, ETC, etc);

Wow, that's really turning into a rat's nest of ifdefs, isn't it?

	Jeff




  reply	other threads:[~2010-01-30 21:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-30 19:49 [PATCH 0/9] few more ide2libata patches Bartlomiej Zolnierkiewicz
2010-01-30 19:49 ` [PATCH 1/9] pata_cs5536: forward port changes from cs5536 Bartlomiej Zolnierkiewicz
2010-01-30 19:49 ` [PATCH 2/9] pata_sil680: CodingStyle fixes Bartlomiej Zolnierkiewicz
2010-01-30 19:49 ` [PATCH 3/9] siimage: cleanup I/O helpers Bartlomiej Zolnierkiewicz
2010-01-30 19:49 ` [PATCH 4/9] [ata_]piix: move documentation to ata_piix.h Bartlomiej Zolnierkiewicz
2010-01-30 19:49 ` [PATCH 5/9] ide2libata: add missing credits Bartlomiej Zolnierkiewicz
2010-01-30 19:49 ` [PATCH 6/9] pata_cs5536: move code to be re-used by ide2libata to pata_cs5536.h Bartlomiej Zolnierkiewicz
2010-01-30 19:50 ` [PATCH 7/9] cs5536: convert to ide2libata Bartlomiej Zolnierkiewicz
2010-01-30 21:55   ` Jeff Garzik [this message]
2010-01-31  0:30     ` Bartlomiej Zolnierkiewicz
2010-01-30 19:50 ` [PATCH 8/9] pata_sil680: move code to be re-used by ide2libata to pata_sil680.h Bartlomiej Zolnierkiewicz
2010-01-30 19:50 ` [PATCH 9/9] siimage: convert to ide2libata 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=4B64AAE3.5040501@garzik.org \
    --to=jeff@garzik.org \
    --cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox