]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/pci/cs5520.c
Merge branches 'x86/prototypes', 'x86/x2apic' and 'x86/debug' into x86/core
[linux-2.6-omap-h63xx.git] / drivers / ide / pci / cs5520.c
index b8ec06d22c613331be5f1ca12ff4cc4e34537ecc..151844fcbb079555979669f0c72cf6169815426b 100644 (file)
@@ -41,6 +41,8 @@
 #include <linux/ide.h>
 #include <linux/dma-mapping.h>
 
+#define DRV_NAME "cs5520"
+
 struct pio_clocks
 {
        int address;
@@ -92,18 +94,12 @@ static const struct ide_port_ops cs5520_port_ops = {
        .set_dma_mode           = cs5520_set_dma_mode,
 };
 
-#define DECLARE_CS_DEV(name_str)                               \
-       {                                                       \
-               .name           = name_str,                     \
-               .port_ops       = &cs5520_port_ops,             \
-               .host_flags     = IDE_HFLAG_ISA_PORTS |         \
-                                 IDE_HFLAG_CS5520,             \
-               .pio_mask       = ATA_PIO4,                     \
-       }
-
-static const struct ide_port_info cyrix_chipsets[] __devinitdata = {
-       /* 0 */ DECLARE_CS_DEV("Cyrix 5510"),
-       /* 1 */ DECLARE_CS_DEV("Cyrix 5520")
+static const struct ide_port_info cyrix_chipset __devinitdata = {
+       .name           = DRV_NAME,
+       .enablebits     = { { 0x60, 0x01, 0x01 }, { 0x60, 0x02, 0x02 } },
+       .port_ops       = &cs5520_port_ops,
+       .host_flags     = IDE_HFLAG_ISA_PORTS | IDE_HFLAG_CS5520,
+       .pio_mask       = ATA_PIO4,
 };
 
 /*
@@ -114,8 +110,7 @@ static const struct ide_port_info cyrix_chipsets[] __devinitdata = {
  
 static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-       struct ide_host *host;
-       const struct ide_port_info *d = &cyrix_chipsets[id->driver_data];
+       const struct ide_port_info *d = &cyrix_chipset;
        hw_regs_t hw[4], *hws[] = { NULL, NULL, NULL, NULL };
 
        ide_setup_pci_noise(dev, d);
@@ -129,7 +124,8 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
        }
        pci_set_master(dev);
        if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) {
-               printk(KERN_WARNING "cs5520: No suitable DMA available.\n");
+               printk(KERN_WARNING "%s: No suitable DMA available.\n",
+                       d->name);
                return -ENODEV;
        }
 
@@ -140,11 +136,7 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
 
        ide_pci_setup_ports(dev, d, 14, &hw[0], &hws[0]);
 
-       host = ide_host_alloc(d, hws);
-       if (host)
-               ide_host_register(host, d, hws);
-
-       return 0;
+       return ide_host_add(d, hws, NULL);
 }
 
 static const struct pci_device_id cs5520_pci_tbl[] = {