pata_sch: use ata_pci_sff_init_one()
authorTejun Heo <tj@kernel.org>
Mon, 10 May 2010 19:41:25 +0000 (21:41 +0200)
committerJeff Garzik <jgarzik@redhat.com>
Sat, 15 May 2010 02:38:38 +0000 (22:38 -0400)
pata_sch is standard SFF.  No reason to open code init.  Use
ata_pci_sff_init_one() instead.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/pata_sch.c

index 99cceb458e2a754b080056556d06c29aa10a53d5..86b3d0133c7c7f92b0c88966c9b48d7f02f81444 100644 (file)
@@ -174,22 +174,12 @@ static int __devinit sch_init_one(struct pci_dev *pdev,
 {
        static int printed_version;
        const struct ata_port_info *ppi[] = { &sch_port_info, NULL };
-       struct ata_host *host;
-       int rc;
 
        if (!printed_version++)
                dev_printk(KERN_DEBUG, &pdev->dev,
                           "version " DRV_VERSION "\n");
 
-       /* enable device and prepare host */
-       rc = pcim_enable_device(pdev);
-       if (rc)
-               return rc;
-       rc = ata_pci_sff_prepare_host(pdev, ppi, &host);
-       if (rc)
-               return rc;
-       pci_set_master(pdev);
-       return ata_pci_sff_activate_host(host, ata_sff_interrupt, &sch_sht);
+       return ata_pci_sff_init_one(pdev, ppi, &sch_sht, NULL, 0);
 }
 
 static int __init sch_init(void)