]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/sgiioc4.c
[IA64] Clear up section mismatch for ioc4_ide_attach_one.
[linux-2.6-omap-h63xx.git] / drivers / ide / sgiioc4.c
index 9fadea41e1c69dcaf50daca2437bbe9d364268fd..a687a7dfea6fd849a3c79916ba5c8c7facfe8b7b 100644 (file)
@@ -550,7 +550,7 @@ static const struct ide_dma_ops sgiioc4_dma_ops = {
        .dma_timeout            = ide_dma_timeout,
 };
 
-static const struct ide_port_info sgiioc4_port_info __devinitdata = {
+static const struct ide_port_info sgiioc4_port_info __devinitconst = {
        .name                   = DRV_NAME,
        .chipset                = ide_pci,
        .init_dma               = ide_dma_sgiioc4,
@@ -567,14 +567,12 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
        unsigned long cmd_base, irqport;
        unsigned long bar0, cmd_phys_base, ctl;
        void __iomem *virt_base;
-       struct ide_host *host;
        hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
-       struct ide_port_info d = sgiioc4_port_info;
        int rc;
 
        /*  Get the CmdBlk and CtrlBlk Base Registers */
        bar0 = pci_resource_start(dev, 0);
-       virt_base = ioremap(bar0, pci_resource_len(dev, 0));
+       virt_base = pci_ioremap_bar(dev, 0);
        if (virt_base == NULL) {
                printk(KERN_ERR "%s: Unable to remap BAR 0 address: 0x%lx\n",
                                DRV_NAME, bar0);
@@ -604,20 +602,10 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
        /* Initializing chipset IRQ Registers */
        writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4));
 
-       host = ide_host_alloc(&d, hws);
-       if (host == NULL) {
-               rc = -ENOMEM;
-               goto err;
-       }
-
-       rc = ide_host_register(host, &d, hws);
-       if (rc)
-               goto err_free;
+       rc = ide_host_add(&sgiioc4_port_info, hws, NULL);
+       if (!rc)
+               return 0;
 
-       return 0;
-err_free:
-       ide_host_free(host);
-err:
        release_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE);
 req_mem_rgn_err:
        iounmap(virt_base);
@@ -645,7 +633,7 @@ out:
        return ret;
 }
 
-int
+int __devinit
 ioc4_ide_attach_one(struct ioc4_driver_data *idd)
 {
        /* PCI-RT does not bring out IDE connection.
@@ -657,7 +645,7 @@ ioc4_ide_attach_one(struct ioc4_driver_data *idd)
        return pci_init_sgiioc4(idd->idd_pdev);
 }
 
-static struct ioc4_submodule ioc4_ide_submodule = {
+static struct ioc4_submodule __devinitdata ioc4_ide_submodule = {
        .is_name = "IOC4_ide",
        .is_owner = THIS_MODULE,
        .is_probe = ioc4_ide_attach_one,