aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-05-10 15:41:35 -0400
committerJeff Garzik <jgarzik@redhat.com>2010-05-19 13:34:10 -0400
commit270390e1ae1818b111543b8bfffa08095d73c1a5 (patch)
treebe6145d1a3ea7d2e80f303a62c5f9ba5a753c0f5 /drivers/ata/libata-core.c
parentc7087652e1890a3feef35b30ee1d4be68e1932cd (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/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c23
1 files changed, 17 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
6585static int __init ata_init(void) 6587static 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
6607free_wq: 6615fail:
6608 destroy_workqueue(ata_wq);
6609free_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
6614static void __exit ata_exit(void) 6624static 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);