diff mbox

[V1,resend,1/2] libata-sff: add ata_sff_queue_work() & ata_sff_queue_delayed_work()

Message ID f9a8bb8c5bcba1b9e5f84f8cfcfbc4a0f338151f.1298358936.git.viresh.kumar@st.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Viresh KUMAR Feb. 22, 2011, 9:02 a.m. UTC
This patch adds ata_sff_queue_work() & ata_sff_queue_delayed_work() routine in
libata-sff.c file. This routine can be used by ata drivers to use ata_sff_wq.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Tejun Heo <tj@kernel.org>
---
 drivers/ata/libata-sff.c |   15 +++++++++++++--
 include/linux/libata.h   |    3 +++
 2 files changed, 16 insertions(+), 2 deletions(-)

Comments

Jeff Garzik March 14, 2011, 6:54 a.m. UTC | #1
On 02/22/2011 04:02 AM, Viresh Kumar wrote:
> This patch adds ata_sff_queue_work()&  ata_sff_queue_delayed_work() routine in
> libata-sff.c file. This routine can be used by ata drivers to use ata_sff_wq.
>
> Signed-off-by: Viresh Kumar<viresh.kumar@st.com>
> Acked-by: Tejun Heo<tj@kernel.org>

applied 1-2


--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 484697f..52f13ea 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -1302,6 +1302,18 @@  fsm_start:
 }
 EXPORT_SYMBOL_GPL(ata_sff_hsm_move);
 
+void ata_sff_queue_work(struct work_struct *work)
+{
+	queue_work(ata_sff_wq, work);
+}
+EXPORT_SYMBOL_GPL(ata_sff_queue_work);
+
+void ata_sff_queue_delayed_work(struct delayed_work *dwork, unsigned long delay)
+{
+	queue_delayed_work(ata_sff_wq, dwork, delay);
+}
+EXPORT_SYMBOL_GPL(ata_sff_queue_delayed_work);
+
 void ata_sff_queue_pio_task(struct ata_link *link, unsigned long delay)
 {
 	struct ata_port *ap = link->ap;
@@ -1311,8 +1323,7 @@  void ata_sff_queue_pio_task(struct ata_link *link, unsigned long delay)
 	ap->sff_pio_task_link = link;
 
 	/* may fail if ata_sff_flush_pio_task() in progress */
-	queue_delayed_work(ata_sff_wq, &ap->sff_pio_task,
-			   msecs_to_jiffies(delay));
+	ata_sff_queue_delayed_work(&ap->sff_pio_task, msecs_to_jiffies(delay));
 }
 EXPORT_SYMBOL_GPL(ata_sff_queue_pio_task);
 
diff --git a/include/linux/libata.h b/include/linux/libata.h
index d947b12..9ac7f0a 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1615,6 +1615,9 @@  extern void ata_sff_irq_on(struct ata_port *ap);
 extern void ata_sff_irq_clear(struct ata_port *ap);
 extern int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,
 			    u8 status, int in_wq);
+extern void ata_sff_queue_work(struct work_struct *work);
+extern void ata_sff_queue_delayed_work(struct delayed_work *dwork,
+		unsigned long delay);
 extern void ata_sff_queue_pio_task(struct ata_link *link, unsigned long delay);
 extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc);
 extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc);