From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Subject: [PATCH] amd74xx/via82cxxx: check ide_config_drive_speed() return value
Date: Thu, 26 Jul 2007 21:56:00 +0200 [thread overview]
Message-ID: <200707262156.00679.bzolnier@gmail.com> (raw)
* Check ide_config_drive_speed() return value.
* While at also call ide_config_drive_speed() if the transfer mode is
XFER_PIO_SLOW (this case happens iff the transfer mode has already been
set on the device by ide-proc.c::set_xfer_rate()) and remove redundant
setting of ->{init,current}_speed.
* Bump driver version.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/pci/amd74xx.c | 10 +++-------
drivers/ide/pci/via82cxxx.c | 10 +++-------
2 files changed, 6 insertions(+), 14 deletions(-)
Index: b/drivers/ide/pci/amd74xx.c
===================================================================
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -1,5 +1,5 @@
/*
- * Version 2.22
+ * Version 2.23
*
* AMD 755/756/766/8111 and nVidia nForce/2/2s/3/3s/CK804/MCP04
* IDE driver for Linux.
@@ -240,8 +240,8 @@ static int amd_set_drive(ide_drive_t *dr
struct ide_timing t, p;
int T, UT;
- if (speed != XFER_PIO_SLOW)
- ide_config_drive_speed(drive, speed);
+ if (ide_config_drive_speed(drive, speed))
+ return 1;
T = 1000000000 / amd_clock;
UT = (amd_config->udma_mask == ATA_UDMA2) ? T : (T / 2);
@@ -258,10 +258,6 @@ static int amd_set_drive(ide_drive_t *dr
amd_set_speed(HWIF(drive)->pci_dev, drive->dn, &t);
- if (!drive->init_speed)
- drive->init_speed = speed;
- drive->current_speed = speed;
-
return 0;
}
Index: b/drivers/ide/pci/via82cxxx.c
===================================================================
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -1,6 +1,6 @@
/*
*
- * Version 3.47
+ * Version 3.48
*
* VIA IDE driver for Linux. Supported southbridges:
*
@@ -164,8 +164,8 @@ static int via_set_drive(ide_drive_t *dr
struct ide_timing t, p;
unsigned int T, UT;
- if (speed != XFER_PIO_SLOW)
- ide_config_drive_speed(drive, speed);
+ if (ide_config_drive_speed(drive, speed))
+ return 1;
T = 1000000000 / via_clock;
@@ -186,10 +186,6 @@ static int via_set_drive(ide_drive_t *dr
via_set_speed(HWIF(drive), drive->dn, &t);
- if (!drive->init_speed)
- drive->init_speed = speed;
- drive->current_speed = speed;
-
return 0;
}
next reply other threads:[~2007-07-26 19:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-26 19:56 Bartlomiej Zolnierkiewicz [this message]
2007-07-29 10:33 ` [PATCH] amd74xx/via82cxxx: check ide_config_drive_speed() return value Sergei Shtylyov
2007-07-29 14:31 ` 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=200707262156.00679.bzolnier@gmail.com \
--to=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).