]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/misc/ioc4.c
Merge branch 'for-linus' of git://neil.brown.name/md
[linux-2.6-omap-h63xx.git] / drivers / misc / ioc4.c
index b995a15b7526a43d12439ce955fb91579d4cff72..6f76573e7c8a244bdac0be865a1a1df72bfee94c 100644 (file)
@@ -75,7 +75,7 @@ ioc4_register_submodule(struct ioc4_submodule *is)
                        printk(KERN_WARNING
                               "%s: IOC4 submodule %s probe failed "
                               "for pci_dev %s",
-                              __FUNCTION__, module_name(is->is_owner),
+                              __func__, module_name(is->is_owner),
                               pci_name(idd->idd_pdev));
                }
        }
@@ -102,7 +102,7 @@ ioc4_unregister_submodule(struct ioc4_submodule *is)
                        printk(KERN_WARNING
                               "%s: IOC4 submodule %s remove failed "
                               "for pci_dev %s.\n",
-                              __FUNCTION__, module_name(is->is_owner),
+                              __func__, module_name(is->is_owner),
                               pci_name(idd->idd_pdev));
                }
        }
@@ -244,10 +244,11 @@ ioc4_variant(struct ioc4_driver_data *idd)
                    idd->idd_pdev->bus->number == pdev->bus->number &&
                    3 == PCI_SLOT(pdev->devfn))
                        found = 1;
-               pci_dev_put(pdev);
        } while (pdev && !found);
-       if (NULL != pdev)
+       if (NULL != pdev) {
+               pci_dev_put(pdev);
                return IOC4_VARIANT_IO9;
+       }
 
        /* IO10: Look for a Vitesse VSC 7174 at the same bus and slot 3. */
        pdev = NULL;
@@ -258,10 +259,11 @@ ioc4_variant(struct ioc4_driver_data *idd)
                    idd->idd_pdev->bus->number == pdev->bus->number &&
                    3 == PCI_SLOT(pdev->devfn))
                        found = 1;
-               pci_dev_put(pdev);
        } while (pdev && !found);
-       if (NULL != pdev)
+       if (NULL != pdev) {
+               pci_dev_put(pdev);
                return IOC4_VARIANT_IO10;
+       }
 
        /* PCI-RT: No SCSI/SATA controller will be present */
        return IOC4_VARIANT_PCI_RT;
@@ -280,7 +282,7 @@ ioc4_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
        if ((ret = pci_enable_device(pdev))) {
                printk(KERN_WARNING
                       "%s: Failed to enable IOC4 device for pci_dev %s.\n",
-                      __FUNCTION__, pci_name(pdev));
+                      __func__, pci_name(pdev));
                goto out;
        }
        pci_set_master(pdev);
@@ -290,7 +292,7 @@ ioc4_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
        if (!idd) {
                printk(KERN_WARNING
                       "%s: Failed to allocate IOC4 data for pci_dev %s.\n",
-                      __FUNCTION__, pci_name(pdev));
+                      __func__, pci_name(pdev));
                ret = -ENODEV;
                goto out_idd;
        }
@@ -305,16 +307,16 @@ ioc4_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
                printk(KERN_WARNING
                       "%s: Unable to find IOC4 misc resource "
                       "for pci_dev %s.\n",
-                      __FUNCTION__, pci_name(idd->idd_pdev));
+                      __func__, pci_name(idd->idd_pdev));
                ret = -ENODEV;
                goto out_pci;
        }
-       if (!request_region(idd->idd_bar0, sizeof(struct ioc4_misc_regs),
+       if (!request_mem_region(idd->idd_bar0, sizeof(struct ioc4_misc_regs),
                            "ioc4_misc")) {
                printk(KERN_WARNING
                       "%s: Unable to request IOC4 misc region "
                       "for pci_dev %s.\n",
-                      __FUNCTION__, pci_name(idd->idd_pdev));
+                      __func__, pci_name(idd->idd_pdev));
                ret = -ENODEV;
                goto out_pci;
        }
@@ -324,7 +326,7 @@ ioc4_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
                printk(KERN_WARNING
                       "%s: Unable to remap IOC4 misc region "
                       "for pci_dev %s.\n",
-                      __FUNCTION__, pci_name(idd->idd_pdev));
+                      __func__, pci_name(idd->idd_pdev));
                ret = -ENODEV;
                goto out_misc_region;
        }
@@ -370,7 +372,7 @@ ioc4_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
                        printk(KERN_WARNING
                               "%s: IOC4 submodule 0x%s probe failed "
                               "for pci_dev %s.\n",
-                              __FUNCTION__, module_name(is->is_owner),
+                              __func__, module_name(is->is_owner),
                               pci_name(idd->idd_pdev));
                }
        }
@@ -379,7 +381,7 @@ ioc4_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
        return 0;
 
 out_misc_region:
-       release_region(idd->idd_bar0, sizeof(struct ioc4_misc_regs));
+       release_mem_region(idd->idd_bar0, sizeof(struct ioc4_misc_regs));
 out_pci:
        kfree(idd);
 out_idd:
@@ -404,7 +406,7 @@ ioc4_remove(struct pci_dev *pdev)
                        printk(KERN_WARNING
                               "%s: IOC4 submodule 0x%s remove failed "
                               "for pci_dev %s.\n",
-                              __FUNCTION__, module_name(is->is_owner),
+                              __func__, module_name(is->is_owner),
                               pci_name(idd->idd_pdev));
                }
        }
@@ -416,9 +418,9 @@ ioc4_remove(struct pci_dev *pdev)
                printk(KERN_WARNING
                       "%s: Unable to get IOC4 misc mapping for pci_dev %s. "
                       "Device removal may be incomplete.\n",
-                      __FUNCTION__, pci_name(idd->idd_pdev));
+                      __func__, pci_name(idd->idd_pdev));
        }
-       release_region(idd->idd_bar0, sizeof(struct ioc4_misc_regs));
+       release_mem_region(idd->idd_bar0, sizeof(struct ioc4_misc_regs));
 
        /* Disable IOC4 and relinquish */
        pci_disable_device(pdev);