drm/radeon: Fix backlight control on iMac 12,1
[linux-2.6-microblaze.git] / drivers / pci / pci.c
index 287fa40..9ecce43 100644 (file)
@@ -1115,7 +1115,7 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state)
                return -EIO;
 
        pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
-       if (pmcsr == (u16) ~0) {
+       if (PCI_POSSIBLE_ERROR(pmcsr)) {
                pci_err(dev, "can't change power state from %s to %s (config space inaccessible)\n",
                        pci_power_name(dev->current_state),
                        pci_power_name(state));
@@ -1271,16 +1271,16 @@ static int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout)
         * After reset, the device should not silently discard config
         * requests, but it may still indicate that it needs more time by
         * responding to them with CRS completions.  The Root Port will
-        * generally synthesize ~0 data to complete the read (except when
-        * CRS SV is enabled and the read was for the Vendor ID; in that
-        * case it synthesizes 0x0001 data).
+        * generally synthesize ~0 (PCI_ERROR_RESPONSE) data to complete
+        * the read (except when CRS SV is enabled and the read was for the
+        * Vendor ID; in that case it synthesizes 0x0001 data).
         *
         * Wait for the device to return a non-CRS completion.  Read the
         * Command register instead of Vendor ID so we don't have to
         * contend with the CRS SV value.
         */
        pci_read_config_dword(dev, PCI_COMMAND, &id);
-       while (id == ~0) {
+       while (PCI_POSSIBLE_ERROR(id)) {
                if (delay > timeout) {
                        pci_warn(dev, "not ready %dms after %s; giving up\n",
                                 delay - 1, reset_type);
@@ -2024,11 +2024,6 @@ static void pcim_release(struct device *gendev, void *res)
        struct pci_devres *this = res;
        int i;
 
-       if (dev->msi_enabled)
-               pci_disable_msi(dev);
-       if (dev->msix_enabled)
-               pci_disable_msix(dev);
-
        for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
                if (this->region_mask & (1 << i))
                        pci_release_region(dev, i);