linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: linux-ide@vger.kernel.org
Subject: Re: [PATCH 4/4] ide: use only ->set_pio_mode method for programming PIO modes
Date: Mon, 23 Jul 2007 22:58:03 +0400	[thread overview]
Message-ID: <46A4FA3B.2050300@ru.mvista.com> (raw)
In-Reply-To: <200707201226.13405.bzolnier@gmail.com>

Hello.

Bartlomiej Zolnierkiewicz wrote:

> Use ->set_pio_mode method to program PIO modes in ide_set_xfer_rate()
> (the only place which used ->speedproc to program PIO modes) and remove
> handling of PIO modes from all ->speedproc implementations.

> There should be no functionality changes caused by this patch.

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

> Index: b/drivers/ide/cris/ide-cris.c
> ===================================================================
> --- a/drivers/ide/cris/ide-cris.c
> +++ b/drivers/ide/cris/ide-cris.c
> @@ -724,11 +724,6 @@ static int speed_cris_ide(ide_drive_t *d
>  {
>  	int cyc = 0, dvs = 0, strobe = 0, hold = 0;
>  
> -	if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) {
> -		cris_set_pio_mode(drive, speed - XFER_PIO_0);
> -		return ide_config_drive_speed(drive, speed);
> -	}
> -
>  	switch(speed)
>  	{
>  		case XFER_UDMA_0:
> Index: b/drivers/ide/ide-lib.c
> ===================================================================
> --- a/drivers/ide/ide-lib.c
> +++ b/drivers/ide/ide-lib.c
> @@ -398,6 +398,18 @@ int ide_set_xfer_rate(ide_drive_t *drive
>  
>  	rate = ide_rate_filter(drive, rate);
>  
> +	if (rate >= XFER_PIO_0 && rate <= XFER_PIO_5) {
> +		if (hwif->set_pio_mode)
> +			hwif->set_pio_mode(drive, rate - XFER_PIO_0);

    BTW, why doesn it pass CF-specific PIO6? Not an issue now, but what the 
hell?  I'd suggest instead:

	if (rate & XFER_PIO_0) {

MBR, Sergei

  parent reply	other threads:[~2007-07-23 18:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-20 10:26 [PATCH 4/4] ide: use only ->set_pio_mode method for programming PIO modes Bartlomiej Zolnierkiewicz
2007-07-22 20:25 ` Sergei Shtylyov
2007-07-23 21:45   ` Bartlomiej Zolnierkiewicz
2007-07-23 18:58 ` Sergei Shtylyov [this message]
2007-07-23 21:52   ` 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=46A4FA3B.2050300@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).