]> err.no Git - linux-2.6/blobdiff - drivers/ide/pci/aec62xx.c
Merge branch 'via-velocity' of git://git.kernel.org/pub/scm/linux/kernel/git/romieu...
[linux-2.6] / drivers / ide / pci / aec62xx.c
index 7ca7989bc35d80979363f720f4e5edd74f6261bc..40644b6f1c002876c6286e80a29923996e58eee9 100644 (file)
@@ -13,6 +13,8 @@
 
 #include <asm/io.h>
 
+#define DRV_NAME "aec62xx"
+
 struct chipset_bus_clock_list_entry {
        u8 xfer_speed;
        u8 chipset_settings;
@@ -138,7 +140,7 @@ static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio)
        drive->hwif->port_ops->set_dma_mode(drive, pio + XFER_PIO_0);
 }
 
-static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const char *name)
+static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev)
 {
        /* These are necessary to get AEC6280 Macintosh cards to work */
        if ((dev->device == PCI_DEVICE_ID_ARTOP_ATP865) ||
@@ -158,7 +160,7 @@ static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const ch
        return dev->irq;
 }
 
-static u8 __devinit atp86x_cable_detect(ide_hwif_t *hwif)
+static u8 atp86x_cable_detect(ide_hwif_t *hwif)
 {
        struct pci_dev *dev = to_pci_dev(hwif->dev);
        u8 ata66 = 0, mask = hwif->channel ? 0x02 : 0x01;
@@ -180,8 +182,8 @@ static const struct ide_port_ops atp86x_port_ops = {
 };
 
 static const struct ide_port_info aec62xx_chipsets[] __devinitdata = {
-       {       /* 0 */
-               .name           = "AEC6210",
+       {       /* 0: AEC6210 */
+               .name           = DRV_NAME,
                .init_chipset   = init_chipset_aec62xx,
                .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
                .port_ops       = &atp850_port_ops,
@@ -192,8 +194,9 @@ static const struct ide_port_info aec62xx_chipsets[] __devinitdata = {
                .pio_mask       = ATA_PIO4,
                .mwdma_mask     = ATA_MWDMA2,
                .udma_mask      = ATA_UDMA2,
-       },{     /* 1 */
-               .name           = "AEC6260",
+       },
+       {       /* 1: AEC6260 */
+               .name           = DRV_NAME,
                .init_chipset   = init_chipset_aec62xx,
                .port_ops       = &atp86x_port_ops,
                .host_flags     = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA |
@@ -201,8 +204,9 @@ static const struct ide_port_info aec62xx_chipsets[] __devinitdata = {
                .pio_mask       = ATA_PIO4,
                .mwdma_mask     = ATA_MWDMA2,
                .udma_mask      = ATA_UDMA4,
-       },{     /* 2 */
-               .name           = "AEC6260R",
+       },
+       {       /* 2: AEC6260R */
+               .name           = DRV_NAME,
                .init_chipset   = init_chipset_aec62xx,
                .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
                .port_ops       = &atp86x_port_ops,
@@ -211,8 +215,9 @@ static const struct ide_port_info aec62xx_chipsets[] __devinitdata = {
                .pio_mask       = ATA_PIO4,
                .mwdma_mask     = ATA_MWDMA2,
                .udma_mask      = ATA_UDMA4,
-       },{     /* 3 */
-               .name           = "AEC6280",
+       },
+       {       /* 3: AEC6280 */
+               .name           = DRV_NAME,
                .init_chipset   = init_chipset_aec62xx,
                .port_ops       = &atp86x_port_ops,
                .host_flags     = IDE_HFLAG_NO_ATAPI_DMA |
@@ -220,8 +225,9 @@ static const struct ide_port_info aec62xx_chipsets[] __devinitdata = {
                .pio_mask       = ATA_PIO4,
                .mwdma_mask     = ATA_MWDMA2,
                .udma_mask      = ATA_UDMA5,
-       },{     /* 4 */
-               .name           = "AEC6280R",
+       },
+       {       /* 4: AEC6280R */
+               .name           = DRV_NAME,
                .init_chipset   = init_chipset_aec62xx,
                .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
                .port_ops       = &atp86x_port_ops,
@@ -268,7 +274,8 @@ static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_devi
                unsigned long dma_base = pci_resource_start(dev, 4);
 
                if (inb(dma_base + 2) & 0x10) {
-                       d.name = (idx == 4) ? "AEC6880R" : "AEC6880";
+                       printk(KERN_INFO DRV_NAME " %s: AEC6880%s card detected"
+                               "\n", pci_name(dev), (idx == 4) ? "R" : "");
                        d.udma_mask = ATA_UDMA6;
                }
        }
@@ -280,6 +287,12 @@ static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_devi
        return err;
 }
 
+static void __devexit aec62xx_remove(struct pci_dev *dev)
+{
+       ide_pci_remove(dev);
+       pci_disable_device(dev);
+}
+
 static const struct pci_device_id aec62xx_pci_tbl[] = {
        { PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP850UF), 0 },
        { PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP860),   1 },
@@ -294,6 +307,7 @@ static struct pci_driver driver = {
        .name           = "AEC62xx_IDE",
        .id_table       = aec62xx_pci_tbl,
        .probe          = aec62xx_init_one,
+       .remove         = aec62xx_remove,
 };
 
 static int __init aec62xx_ide_init(void)
@@ -301,7 +315,13 @@ static int __init aec62xx_ide_init(void)
        return ide_pci_register_driver(&driver);
 }
 
+static void __exit aec62xx_ide_exit(void)
+{
+       pci_unregister_driver(&driver);
+}
+
 module_init(aec62xx_ide_init);
+module_exit(aec62xx_ide_exit);
 
 MODULE_AUTHOR("Andre Hedrick");
 MODULE_DESCRIPTION("PCI driver module for ARTOP AEC62xx IDE");