diff options
author | Tejun Heo <tj@kernel.org> | 2010-05-10 15:41:35 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2010-05-19 13:34:10 -0400 |
commit | 270390e1ae1818b111543b8bfffa08095d73c1a5 (patch) | |
tree | be6145d1a3ea7d2e80f303a62c5f9ba5a753c0f5 /drivers/ata | |
parent | c7087652e1890a3feef35b30ee1d4be68e1932cd (diff) |
libata-sff: introduce ata_sff_init/exit() and ata_sff_port_init()
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>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-core.c | 23 | ||||
-rw-r--r-- | drivers/ata/libata-sff.c | 23 | ||||
-rw-r--r-- | 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 cc49a0d3089f..200f49d09228 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) | |||
5670 | ap->stats.unhandled_irq = 1; | 5670 | ap->stats.unhandled_irq = 1; |
5671 | ap->stats.idle_irq = 1; | 5671 | ap->stats.idle_irq = 1; |
5672 | #endif | 5672 | #endif |
5673 | ata_sff_port_init(ap); | ||
5674 | |||
5673 | return ap; | 5675 | return ap; |
5674 | } | 5676 | } |
5675 | 5677 | ||
@@ -6584,6 +6586,8 @@ static void __init ata_parse_force_param(void) | |||
6584 | 6586 | ||
6585 | static int __init ata_init(void) | 6587 | static int __init ata_init(void) |
6586 | { | 6588 | { |
6589 | int rc = -ENOMEM; | ||
6590 | |||
6587 | ata_parse_force_param(); | 6591 | ata_parse_force_param(); |
6588 | 6592 | ||
6589 | /* | 6593 | /* |
@@ -6595,24 +6599,31 @@ static int __init ata_init(void) | |||
6595 | */ | 6599 | */ |
6596 | ata_wq = create_workqueue("ata"); | 6600 | ata_wq = create_workqueue("ata"); |
6597 | if (!ata_wq) | 6601 | if (!ata_wq) |
6598 | goto free_force_tbl; | 6602 | goto fail; |
6599 | 6603 | ||
6600 | ata_aux_wq = create_singlethread_workqueue("ata_aux"); | 6604 | ata_aux_wq = create_singlethread_workqueue("ata_aux"); |
6601 | if (!ata_aux_wq) | 6605 | if (!ata_aux_wq) |
6602 | goto free_wq; | 6606 | goto fail; |
6607 | |||
6608 | rc = ata_sff_init(); | ||
6609 | if (rc) | ||
6610 | goto fail; | ||
6603 | 6611 | ||
6604 | printk(KERN_DEBUG "libata version " DRV_VERSION " loaded.\n"); | 6612 | printk(KERN_DEBUG "libata version " DRV_VERSION " loaded.\n"); |
6605 | return 0; | 6613 | return 0; |
6606 | 6614 | ||
6607 | free_wq: | 6615 | fail: |
6608 | destroy_workqueue(ata_wq); | ||
6609 | free_force_tbl: | ||
6610 | kfree(ata_force_tbl); | 6616 | kfree(ata_force_tbl); |
6611 | return -ENOMEM; | 6617 | if (ata_wq) |
6618 | destroy_workqueue(ata_wq); | ||
6619 | if (ata_aux_wq) | ||
6620 | destroy_workqueue(ata_aux_wq); | ||
6621 | return rc; | ||
6612 | } | 6622 | } |
6613 | 6623 | ||
6614 | static void __exit ata_exit(void) | 6624 | static void __exit ata_exit(void) |
6615 | { | 6625 | { |
6626 | ata_sff_exit(); | ||
6616 | kfree(ata_force_tbl); | 6627 | kfree(ata_force_tbl); |
6617 | destroy_workqueue(ata_wq); | 6628 | destroy_workqueue(ata_wq); |
6618 | destroy_workqueue(ata_aux_wq); | 6629 | destroy_workqueue(ata_aux_wq); |
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index f1c99a3e8b2c..4a3d1f214457 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -3061,3 +3061,26 @@ void ata_pci_bmdma_init(struct ata_host *host) | |||
3061 | EXPORT_SYMBOL_GPL(ata_pci_bmdma_init); | 3061 | EXPORT_SYMBOL_GPL(ata_pci_bmdma_init); |
3062 | 3062 | ||
3063 | #endif /* CONFIG_PCI */ | 3063 | #endif /* CONFIG_PCI */ |
3064 | |||
3065 | /** | ||
3066 | * ata_sff_port_init - Initialize SFF/BMDMA ATA port | ||
3067 | * @ap: Port to initialize | ||
3068 | * | ||
3069 | * Called on port allocation to initialize SFF/BMDMA specific | ||
3070 | * fields. | ||
3071 | * | ||
3072 | * LOCKING: | ||
3073 | * None. | ||
3074 | */ | ||
3075 | void ata_sff_port_init(struct ata_port *ap) | ||
3076 | { | ||
3077 | } | ||
3078 | |||
3079 | int __init ata_sff_init(void) | ||
3080 | { | ||
3081 | return 0; | ||
3082 | } | ||
3083 | |||
3084 | void __exit ata_sff_exit(void) | ||
3085 | { | ||
3086 | } | ||
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index 132da80aa23a..d89502f3123a 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) | |||
203 | /* libata-sff.c */ | 203 | /* libata-sff.c */ |
204 | #ifdef CONFIG_ATA_SFF | 204 | #ifdef CONFIG_ATA_SFF |
205 | extern void ata_pio_task(struct work_struct *work); | 205 | extern void ata_pio_task(struct work_struct *work); |
206 | extern void ata_sff_port_init(struct ata_port *ap); | ||
207 | extern int ata_sff_init(void); | ||
208 | extern void ata_sff_exit(void); | ||
209 | #else /* CONFIG_ATA_SFF */ | ||
210 | static inline void ata_sff_port_init(struct ata_port *ap) | ||
211 | { } | ||
212 | static inline int ata_sff_init(void) | ||
213 | { return 0; } | ||
214 | static inline void ata_sff_exit(void) | ||
215 | { } | ||
206 | #endif /* CONFIG_ATA_SFF */ | 216 | #endif /* CONFIG_ATA_SFF */ |
207 | 217 | ||
208 | #endif /* __LIBATA_H__ */ | 218 | #endif /* __LIBATA_H__ */ |