linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, lkml@rtr.ca, axboe@suse.de,
	forrest.zhao@intel.com, alan@lxorguk.ukuu.org.uk,
	linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 04/10] libata: update ata_do_simple_cmd()
Date: Tue, 13 Jun 2006 00:50:28 +0900	[thread overview]
Message-ID: <11501274283498-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <11501274284082-git-send-email-htejun@gmail.com>

* export ata_do_simple_cmd() in drivers/scsi/libata.h
* add proper leading comment
* fix return value
* don't print error message.  it's the caller's responsibility

This will be used by new PM.

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

---

 drivers/scsi/libata-core.c |   25 ++++++++++++++-----------
 drivers/scsi/libata.h      |    1 +
 2 files changed, 15 insertions(+), 11 deletions(-)

722e4a01585700ae416ae7c7a746fd6835ddae34
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 4fc8759..ba9f346 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1123,14 +1123,22 @@ unsigned ata_exec_internal(struct ata_de
 	return err_mask;
 }
 
-/*
- * Execute a 'simple' command, that only consists of the opcode 'cmd' itself,
- * without filling any other registers
+/*	ata_do_simple_cmd - execute simple internal command
+ *	@dev: Device to which the command is sent
+ *	@cmd: Opcode to execute
+ *
+ *	Execute a 'simple' command, that only consists of the opcode
+ *	'cmd' itself, without filling any other registers
+ *
+ *	LOCKING:
+ *	Kernel thread context (may sleep).
+ *
+ *	RETURNS:
+ *	Zero on success, AC_ERR_* mask on failure
  */
-static int ata_do_simple_cmd(struct ata_device *dev, u8 cmd)
+unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd)
 {
 	struct ata_taskfile tf;
-	int err;
 
 	ata_tf_init(dev, &tf);
 
@@ -1138,12 +1146,7 @@ static int ata_do_simple_cmd(struct ata_
 	tf.flags |= ATA_TFLAG_DEVICE;
 	tf.protocol = ATA_PROT_NODATA;
 
-	err = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0);
-	if (err)
-		ata_dev_printk(dev, KERN_ERR, "%s: ata command failed: %d\n",
-			       __FUNCTION__, err);
-
-	return err;
+	return ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0);
 }
 
 /**
diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h
index bdd4888..539b0b5 100644
--- a/drivers/scsi/libata.h
+++ b/drivers/scsi/libata.h
@@ -50,6 +50,7 @@ extern void ata_port_flush_task(struct a
 extern unsigned ata_exec_internal(struct ata_device *dev,
 				  struct ata_taskfile *tf, const u8 *cdb,
 				  int dma_dir, void *buf, unsigned int buflen);
+extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd);
 extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
 			   int post_reset, u16 *id);
 extern int ata_dev_configure(struct ata_device *dev, int print_info);
-- 
1.3.2



  parent reply	other threads:[~2006-06-12 15:50 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-12 15:50 [PATCHSET] new Power Management for libata Tejun Heo
2006-06-12 15:50 ` [PATCH 01/10] libata: power down controller only on PMSG_SUSPEND Tejun Heo
2006-06-12 16:32   ` Jeff Garzik
2006-06-13  2:20     ` Tejun Heo
2006-06-12 15:50 ` [PATCH 03/10] libata: move ata_do_simple_cmd() right below ata_exec_internal() Tejun Heo
2006-06-12 15:50 ` [PATCH 02/10] libata: kill per-device PM Tejun Heo
2006-06-12 15:50 ` Tejun Heo [this message]
2006-06-12 15:50 ` [PATCH 09/10] sata_sil24: separate out sil24_init_controller() Tejun Heo
2006-06-12 15:50 ` [PATCH 10/10] sata_sil24: add suspend/sleep support Tejun Heo
2006-06-12 15:50 ` [PATCH 08/10] sata_sil: " Tejun Heo
2006-06-12 15:50 ` [PATCH 07/10] sata_sil: separate out sil_init_controller() Tejun Heo
2006-06-12 15:50 ` [PATCH 05/10] libata: implement new EH action ATA_EH_SPINUP Tejun Heo
2006-06-14  1:18   ` Jeff Garzik
2006-06-14 15:02     ` Tejun Heo
2006-06-14 15:25       ` Alan Cox
2006-06-12 15:50 ` [PATCH 06/10] libata: implement new Power Management framework Tejun Heo
2006-06-12 16:34   ` Alan Cox
2006-06-13  2:08     ` Tejun Heo
2006-06-13  6:25   ` zhao, forrest
2006-06-13  8:56     ` Tejun Heo
2006-06-13 11:59       ` Jeff Garzik
2006-06-13  8:17   ` zhao, forrest
2006-06-13  9:00     ` Tejun Heo
2006-06-13  8:54       ` zhao, forrest
2006-06-13  9:15         ` Tejun Heo
2006-06-13  8:37   ` zhao, forrest
2006-06-14  7:56   ` zhao, forrest
2006-06-14 13:29     ` Tejun Heo
2006-06-15  1:33       ` zhao, forrest
2006-06-15  3:41         ` Tejun Heo
2006-06-12 15:57 ` [PATCHSET] new Power Management for libata Tejun Heo
2006-06-13  6:28 ` zhao, forrest
2006-06-13  9:09 ` rolled up patch for " Tejun Heo
2006-06-13 10:38   ` Jens Axboe
2006-06-19  5:46     ` Jens Axboe
2006-06-14  1:25 ` [PATCHSET] " Jeff Garzik
2006-06-14 13:46   ` Tejun Heo
2006-06-19  5:18     ` zhao, forrest
2006-06-19  8:46       ` 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=11501274283498-git-send-email-htejun@gmail.com \
    --to=htejun@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=axboe@suse.de \
    --cc=forrest.zhao@intel.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=lkml@rtr.ca \
    /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).