linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: jeff@garzik.org, linux-ide@vger.kernel.org, sshtylyov@mvista.com
Cc: Tejun Heo <tj@kernel.org>
Subject: [PATCH 11/23] libata-sff: introduce ata_sff_init/exit() and ata_sff_port_init()
Date: Mon, 10 May 2010 21:41:35 +0200	[thread overview]
Message-ID: <1273520507-32459-12-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1273520507-32459-1-git-send-email-tj@kernel.org>

In preparation of proper SFF/BMDMA separation, introduce
ata_sff_init/exit() and ata_sff_port_init().  These functions
currently don't do anything.

Signed-off-by: Tejun Heo <tj@kernel.org>
---
 drivers/ata/libata-core.c |   23 +++++++++++++++++------
 drivers/ata/libata-sff.c  |   23 +++++++++++++++++++++++
 drivers/ata/libata.h      |   10 ++++++++++
 3 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index cc49a0d..200f49d 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5670,6 +5670,8 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
 	ap->stats.unhandled_irq = 1;
 	ap->stats.idle_irq = 1;
 #endif
+	ata_sff_port_init(ap);
+
 	return ap;
 }
 
@@ -6584,6 +6586,8 @@ static void __init ata_parse_force_param(void)
 
 static int __init ata_init(void)
 {
+	int rc = -ENOMEM;
+
 	ata_parse_force_param();
 
 	/*
@@ -6595,24 +6599,31 @@ static int __init ata_init(void)
 	 */
 	ata_wq = create_workqueue("ata");
 	if (!ata_wq)
-		goto free_force_tbl;
+		goto fail;
 
 	ata_aux_wq = create_singlethread_workqueue("ata_aux");
 	if (!ata_aux_wq)
-		goto free_wq;
+		goto fail;
+
+	rc = ata_sff_init();
+	if (rc)
+		goto fail;
 
 	printk(KERN_DEBUG "libata version " DRV_VERSION " loaded.\n");
 	return 0;
 
-free_wq:
-	destroy_workqueue(ata_wq);
-free_force_tbl:
+fail:
 	kfree(ata_force_tbl);
-	return -ENOMEM;
+	if (ata_wq)
+		destroy_workqueue(ata_wq);
+	if (ata_aux_wq)
+		destroy_workqueue(ata_aux_wq);
+	return rc;
 }
 
 static void __exit ata_exit(void)
 {
+	ata_sff_exit();
 	kfree(ata_force_tbl);
 	destroy_workqueue(ata_wq);
 	destroy_workqueue(ata_aux_wq);
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index bc52a75..470553d 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -3041,3 +3041,26 @@ void ata_pci_bmdma_init(struct ata_host *host)
 EXPORT_SYMBOL_GPL(ata_pci_bmdma_init);
 
 #endif /* CONFIG_PCI */
+
+/**
+ *	ata_sff_port_init - Initialize SFF/BMDMA ATA port
+ *	@ap: Port to initialize
+ *
+ *	Called on port allocation to initialize SFF/BMDMA specific
+ *	fields.
+ *
+ *	LOCKING:
+ *	None.
+ */
+void ata_sff_port_init(struct ata_port *ap)
+{
+}
+
+int __init ata_sff_init(void)
+{
+	return 0;
+}
+
+void __exit ata_sff_exit(void)
+{
+}
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 132da80..d89502f 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -203,6 +203,16 @@ static inline int sata_pmp_attach(struct ata_device *dev)
 /* libata-sff.c */
 #ifdef CONFIG_ATA_SFF
 extern void ata_pio_task(struct work_struct *work);
+extern void ata_sff_port_init(struct ata_port *ap);
+extern int ata_sff_init(void);
+extern void ata_sff_exit(void);
+#else /* CONFIG_ATA_SFF */
+static inline void ata_sff_port_init(struct ata_port *ap)
+{ }
+static inline int ata_sff_init(void)
+{ return 0; }
+static inline void ata_sff_exit(void)
+{ }
 #endif /* CONFIG_ATA_SFF */
 
 #endif /* __LIBATA_H__ */
-- 
1.6.4.2


  parent reply	other threads:[~2010-05-10 19:42 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-10 19:41 [PATCHSET #upstream] libata: separate out SFF and BMDMA, take#2 Tejun Heo
2010-05-10 19:41 ` [PATCH 01/23] pata_sch: use ata_pci_sff_init_one() Tejun Heo
2010-05-15  2:39   ` Jeff Garzik
2010-05-10 19:41 ` [PATCH 02/23] sata_inic162x: inic162x is not dependent on CONFIG_ATA_SFF Tejun Heo
2010-05-10 19:41 ` [PATCH 03/23] sata_mv: remove unnecessary initialization Tejun Heo
2010-05-10 19:41 ` [PATCH 04/23] libata-sff: update bmdma host bus error handling Tejun Heo
2010-05-10 19:41 ` [PATCH 05/23] libata-sff: kill unused prototype and make ata_dev_select() static Tejun Heo
2010-05-10 19:41 ` [PATCH 06/23] libata: kill ATA_FLAG_DISABLED Tejun Heo
2010-05-18  2:49   ` Jeff Garzik
2010-05-10 19:41 ` [PATCH 07/23] sata_inic162x: kill PORT_PRD_ADDR initialization Tejun Heo
2010-05-10 19:41 ` [PATCH 08/23] libata-sff: reorder SFF/BMDMA functions Tejun Heo
2010-05-10 19:41 ` [PATCH 09/23] libata-sff: clean up inheritance in several drivers Tejun Heo
2010-05-18  2:52   ` Jeff Garzik
2010-05-18  8:36     ` Tejun Heo
2010-05-19 17:07       ` Jeff Garzik
2010-05-10 19:41 ` [PATCH 10/23] libata-sff: clean up BMDMA initialization Tejun Heo
2010-05-18  2:56   ` Jeff Garzik
2010-05-10 19:41 ` Tejun Heo [this message]
2010-05-18  3:00   ` [PATCH 11/23] libata-sff: introduce ata_sff_init/exit() and ata_sff_port_init() Jeff Garzik
2010-05-19 17:37   ` Jeff Garzik
2010-05-10 19:41 ` [PATCH 12/23] libata-sff: rename ap->ops->drain_fifo() to sff_drain_fifo() Tejun Heo
2010-05-18  3:04   ` Jeff Garzik
2010-05-18  8:40     ` Tejun Heo
2010-05-10 19:41 ` [PATCH 13/23] libata-sff: ap->[last_]ctl are SFF specific Tejun Heo
2010-05-10 19:41 ` [PATCH 14/23] libata-sff: port_task is " Tejun Heo
2010-05-10 19:41 ` [PATCH 15/23] libata-sff: separate out BMDMA EH Tejun Heo
2010-05-10 19:41 ` [PATCH 16/23] libata-sff: ata_sff_[dumb_]qc_prep are BMDMA specific Tejun Heo
2010-05-18  3:05   ` Jeff Garzik
2010-05-10 19:41 ` [PATCH 17/23] libata-sff: prd is " Tejun Heo
2010-05-18  3:06   ` Jeff Garzik
2010-05-18  8:38     ` Tejun Heo
2010-05-19 17:39   ` Jeff Garzik
2010-05-10 19:41 ` [PATCH 18/23] libata-sff: separate out BMDMA qc_issue Tejun Heo
2010-05-10 19:41 ` [PATCH 19/23] libata-sff: ata_sff_irq_clear() is BMDMA specific Tejun Heo
2010-05-19 17:40   ` Jeff Garzik
2010-05-10 19:41 ` [PATCH 20/23] libata-sff: separate out BMDMA irq handler Tejun Heo
2010-05-10 19:41 ` [PATCH 21/23] libata-sff: separate out BMDMA init Tejun Heo
2010-05-10 19:41 ` [PATCH 22/23] libata-sff: kill dummy BMDMA ops from sata_qstor and pata_octeon_cf Tejun Heo
2010-05-10 19:41 ` [PATCH 23/23] libata-sff: make BMDMA optional Tejun Heo
2010-05-18  3:10   ` Jeff Garzik
2010-05-10 20:22 ` [PATCHSET #upstream] libata: separate out SFF and BMDMA, take#2 Jeff Garzik
2010-05-10 20:38   ` Jeff Garzik

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=1273520507-32459-12-git-send-email-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=sshtylyov@mvista.com \
    /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).