]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/pci/generic.c
ide: include PCI device name in messages from IDE PCI host drivers
[linux-2.6-omap-h63xx.git] / drivers / ide / pci / generic.c
index 59ebe84f1053b36d0bc922595d38ff2dee7cc893..e034e21af7fece1baad0cdda38e3f948900b3935 100644 (file)
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/delay.h>
-#include <linux/timer.h>
-#include <linux/mm.h>
-#include <linux/ioport.h>
-#include <linux/blkdev.h>
 #include <linux/hdreg.h>
 #include <linux/pci.h>
 #include <linux/ide.h>
 #include <linux/init.h>
 
-#include <asm/io.h>
-
 static int ide_generic_all;            /* Set to claim all devices */
 
-/*
- * the module_param_named() was added for the modular case
- * the __setup() is left as compatibility for existing setups
- */
-#ifndef MODULE
-static int __init ide_generic_all_on(char *unused)
-{
-       ide_generic_all = 1;
-       printk(KERN_INFO "IDE generic will claim all unknown PCI IDE storage controllers.\n");
-       return 1;
-}
-const __setup("all-generic-ide", ide_generic_all_on);
-#endif
 module_param_named(all_generic_ide, ide_generic_all, bool, 0444);
 MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE storage controllers.");
 
@@ -58,8 +38,7 @@ MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE st
        { \
                .name           = name_str, \
                .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA | \
-                                 extra_flags | \
-                                 IDE_HFLAG_BOOTABLE, \
+                                 extra_flags, \
                .swdma_mask     = ATA_SWDMA2, \
                .mwdma_mask     = ATA_MWDMA2, \
                .udma_mask      = ATA_UDMA6, \
@@ -70,9 +49,8 @@ static const struct ide_port_info generic_chipsets[] __devinitdata = {
 
        {       /* 1 */
                .name           = "NS87410",
-               .enablebits     = {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
-               .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
-                                 IDE_HFLAG_BOOTABLE,
+               .enablebits     = { {0x43, 0x08, 0x08}, {0x47, 0x08, 0x08} },
+               .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA,
                .swdma_mask     = ATA_SWDMA2,
                .mwdma_mask     = ATA_MWDMA2,
                .udma_mask      = ATA_UDMA6,
@@ -119,7 +97,7 @@ static const struct ide_port_info generic_chipsets[] __devinitdata = {
  *     Called when the PCI registration layer (or the IDE initialization)
  *     finds a device matching our IDE device tables.
  */
+
 static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
        const struct ide_port_info *d = &generic_chipsets[id->driver_data];
@@ -156,12 +134,12 @@ static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_devi
                u16 command;
                pci_read_config_word(dev, PCI_COMMAND, &command);
                if (!(command & PCI_COMMAND_IO)) {
-                       printk(KERN_INFO "Skipping disabled %s IDE "
-                                       "controller.\n", d->name);
+                       printk(KERN_INFO "%s %s: skipping disabled "
+                               "controller\n", d->name, pci_name(dev));
                        goto out;
                }
        }
-       ret = ide_setup_pci_device(dev, d);
+       ret = ide_pci_init_one(dev, d, NULL);
 out:
        return ret;
 }
@@ -196,6 +174,7 @@ static struct pci_driver driver = {
        .name           = "PCI_IDE",
        .id_table       = generic_pci_tbl,
        .probe          = generic_init_one,
+       .remove         = ide_pci_remove,
 };
 
 static int __init generic_ide_init(void)
@@ -203,7 +182,13 @@ static int __init generic_ide_init(void)
        return ide_pci_register_driver(&driver);
 }
 
+static void __exit generic_ide_exit(void)
+{
+       pci_unregister_driver(&driver);
+}
+
 module_init(generic_ide_init);
+module_exit(generic_ide_exit);
 
 MODULE_AUTHOR("Andre Hedrick");
 MODULE_DESCRIPTION("PCI driver module for generic PCI IDE");