Merge ../linux-2.6-watchdog-mm
[linux-drm-fsl-dcu.git] / drivers / ide / pci / generic.c
index 78810ba982e9efb17b6713c1a12d480ec4e77491..9f306880491abea6b809e568ebeff51945bb49d6 100644 (file)
@@ -23,7 +23,6 @@
 
 #undef REALLY_SLOW_IO          /* most systems can safely undef this */
 
-#include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.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)
 {
@@ -50,6 +53,8 @@ static int __init ide_generic_all_on(char *unused)
 }
 __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.");
 
 static void __devinit init_hwif_generic (ide_hwif_t *hwif)
 {
@@ -242,13 +247,17 @@ static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_devi
            (!(PCI_FUNC(dev->devfn) & 1)))
                goto out;
 
-       if (dev->vendor == PCI_VENDOR_ID_JMICRON && PCI_FUNC(dev->devfn) != 1)
-               goto out;
+       if (dev->vendor == PCI_VENDOR_ID_JMICRON) {
+               if (dev->device != PCI_DEVICE_ID_JMICRON_JMB368 && PCI_FUNC(dev->devfn) != 1)
+                       goto out;
+       }
 
-       pci_read_config_word(dev, PCI_COMMAND, &command);
-       if (!(command & PCI_COMMAND_IO)) {
-               printk(KERN_INFO "Skipping disabled %s IDE controller.\n", d->name);
-               goto out;
+       if (dev->vendor != PCI_VENDOR_ID_JMICRON) {
+               pci_read_config_word(dev, PCI_COMMAND, &command);
+               if (!(command & PCI_COMMAND_IO)) {
+                       printk(KERN_INFO "Skipping disabled %s IDE controller.\n", d->name);
+                       goto out;
+               }
        }
        ret = ide_setup_pci_device(dev, d);
 out: