hwmon: (asus_atk0110) Refactor interface probe code
[safe/jmp/linux-2.6] / drivers / pnp / quirks.c
index 55f55ed..dfbd5a6 100644 (file)
@@ -245,15 +245,17 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
         */
        for_each_pci_dev(pdev) {
                for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
-                       if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM) ||
-                           pci_resource_len(pdev, i) == 0)
+                       unsigned long type;
+
+                       type = pci_resource_flags(pdev, i) &
+                                       (IORESOURCE_IO | IORESOURCE_MEM);
+                       if (!type || pci_resource_len(pdev, i) == 0)
                                continue;
 
                        pci_start = pci_resource_start(pdev, i);
                        pci_end = pci_resource_end(pdev, i);
                        for (j = 0;
-                            (res = pnp_get_resource(dev, IORESOURCE_MEM, j));
-                            j++) {
+                            (res = pnp_get_resource(dev, type, j)); j++) {
                                if (res->start == 0 && res->end == 0)
                                        continue;
 
@@ -283,14 +285,10 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
                                 * the PCI region, and that might prevent a PCI
                                 * driver from requesting its resources.
                                 */
-                               dev_warn(&dev->dev, "mem resource "
-                                       "(0x%llx-0x%llx) overlaps %s BAR %d "
-                                       "(0x%llx-0x%llx), disabling\n",
-                                       (unsigned long long) pnp_start,
-                                       (unsigned long long) pnp_end,
-                                       pci_name(pdev), i,
-                                       (unsigned long long) pci_start,
-                                       (unsigned long long) pci_end);
+                               dev_warn(&dev->dev,
+                                        "disabling %pR because it overlaps "
+                                        "%s BAR %d %pR\n", res,
+                                        pci_name(pdev), i, &pdev->resource[i]);
                                res->flags |= IORESOURCE_DISABLED;
                        }
                }
@@ -334,10 +332,8 @@ void pnp_fixup_device(struct pnp_dev *dev)
        for (f = pnp_fixups; *f->id; f++) {
                if (!compare_pnp_id(dev->id, f->id))
                        continue;
-#ifdef DEBUG
-               dev_dbg(&dev->dev, "%s: calling ", f->id);
-               print_fn_descriptor_symbol("%s\n", f->quirk_function);
-#endif
+               pnp_dbg(&dev->dev, "%s: calling %pF\n", f->id,
+                       f->quirk_function);
                f->quirk_function(dev);
        }
 }