All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, alan@lxorguk.ukuu.org.uk, albertcc@tw.ibm.com,
	linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 02/14] libata: ata_dev_revalidate() printk update
Date: Sat, 1 Apr 2006 19:48:36 +0900	[thread overview]
Message-ID: <11438885161916-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <11438885151530-git-send-email-htejun@gmail.com>

Make sure ata_dev_revalidate() complains on failures and kill
revalidation failure message printed from ata_dev_set_mode().

Signed-off-by: Tejun Heo <htejun@gmail.com>

---

 drivers/scsi/libata-core.c |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

48633a90b26ada7104a8e320636f20f642ee2de4
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 93f8bce..402c0e4 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1972,12 +1972,8 @@ static int ata_dev_set_mode(struct ata_p
 	}
 
 	rc = ata_dev_revalidate(ap, dev, 0);
-	if (rc) {
-		printk(KERN_ERR
-		       "ata%u: failed to revalidate after set xfermode\n",
-		       ap->id);
+	if (rc)
 		return rc;
-	}
 
 	DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n",
 		dev->xfer_shift, (int)dev->xfer_mode);
@@ -2775,15 +2771,14 @@ static int ata_dev_same_device(struct at
 int ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev,
 		       int post_reset)
 {
-	unsigned int class;
-	u16 *id;
+	unsigned int class = dev->class;
+	u16 *id = NULL;
 	int rc;
 
-	if (!ata_dev_enabled(dev))
-		return -ENODEV;
-
-	class = dev->class;
-	id = NULL;
+	if (!ata_dev_enabled(dev)) {
+		rc = -ENODEV;
+		goto fail;
+	}
 
 	/* allocate & read ID data */
 	rc = ata_dev_read_id(ap, dev, &class, post_reset, &id);
@@ -2800,7 +2795,9 @@ int ata_dev_revalidate(struct ata_port *
 	dev->id = id;
 
 	/* configure device according to the new ID */
-	return ata_dev_configure(ap, dev, 0);
+	rc = ata_dev_configure(ap, dev, 0);
+	if (rc == 0)
+		return 0;
 
  fail:
 	printk(KERN_ERR "ata%u: dev %u revalidation failed (errno=%d)\n",
-- 
1.2.4



  reply	other threads:[~2006-04-01 10:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-01 10:48 [PATCHSET] libata: prep for new EH Tejun Heo
2006-04-01 10:48 ` Tejun Heo [this message]
2006-04-01 10:48 ` [PATCH 04/14] libata: clean up constants Tejun Heo
2006-04-01 20:02   ` Jeff Garzik
2006-04-01 10:48 ` [PATCH 03/14] libata: ATA_FLAG_IN_EH is not used, kill it Tejun Heo
2006-04-01 10:48 ` [PATCH 06/14] libata: clear ATA_DFLAG_PIO before setting it Tejun Heo
2006-04-01 10:48 ` [PATCH 09/14] libata: always generate sense if qc->err_mask is non-zero Tejun Heo
2006-04-01 20:02   ` Jeff Garzik
2006-04-01 10:48 ` [PATCH 08/14] libata: pass qc around intead of ap during PIO Tejun Heo
2006-04-01 10:48 ` [PATCH 07/14] libata: add ATA_QCFLAG_IO Tejun Heo
2006-04-01 10:48 ` [PATCH 05/14] libata: clear only affected flags during ata_dev_configure() Tejun Heo
2006-04-01 10:48 ` [PATCH 01/14] libata: report device number when PIO fails Tejun Heo
2006-04-01 10:48 ` [PATCH 11/14] libata: add @cdb to ata_exec_internal() Tejun Heo
2006-04-01 10:48 ` [PATCH 12/14] libata: dec scmd->retries for qcs with zero err_mask Tejun Heo
2006-04-01 10:48 ` [PATCH 14/14] libata: make some libata-core routines extern Tejun Heo
2006-04-01 10:48 ` [PATCH 10/14] libata: don't read TF directly from sense generation functions Tejun Heo
2006-04-01 20:05   ` Jeff Garzik
2006-04-01 10:48 ` [PATCH 13/14] libata: separate out libata-eh.c Tejun Heo
2006-04-01 10:51 ` [PATCHSET] libata: prep for new EH Tejun Heo

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=11438885161916-git-send-email-htejun@gmail.com \
    --to=htejun@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=albertcc@tw.ibm.com \
    --cc=jgarzik@pobox.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 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.