X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fide%2Fpci%2Fcs5520.c;h=151844fcbb079555979669f0c72cf6169815426b;hb=2fdc86901d2ab30a12402b46238951d2a7891590;hp=d30cb4d99c45ad952d1be154b92655004c6151cb;hpb=ba4b2e607e4e9eaa929935325dafd5c86d3b5262;p=linux-2.6 diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c index d30cb4d99c..151844fcbb 100644 --- a/drivers/ide/pci/cs5520.c +++ b/drivers/ide/pci/cs5520.c @@ -41,6 +41,8 @@ #include #include +#define DRV_NAME "cs5520" + struct pio_clocks { int address; @@ -92,19 +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 | \ - IDE_HFLAG_ABUSE_SET_DMA_MODE, \ - .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, }; /* @@ -115,9 +110,8 @@ 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) { - 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 }; - u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; ide_setup_pci_noise(dev, d); @@ -130,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; } @@ -139,11 +134,9 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic * do all the device setup for us */ - ide_pci_setup_ports(dev, d, 14, &idx[0], &hw[0], &hws[0]); - - ide_device_add(idx, d, hws); + ide_pci_setup_ports(dev, d, 14, &hw[0], &hws[0]); - return 0; + return ide_host_add(d, hws, NULL); } static const struct pci_device_id cs5520_pci_tbl[] = {