|
@@ -148,7 +148,7 @@ static noinline void pci_wait_cfg(struct pci_dev *dev)
|
|
int pci_user_read_config_##size \
|
|
int pci_user_read_config_##size \
|
|
(struct pci_dev *dev, int pos, type *val) \
|
|
(struct pci_dev *dev, int pos, type *val) \
|
|
{ \
|
|
{ \
|
|
- int ret = 0; \
|
|
|
|
|
|
+ int ret = PCIBIOS_SUCCESSFUL; \
|
|
u32 data = -1; \
|
|
u32 data = -1; \
|
|
if (PCI_##size##_BAD) \
|
|
if (PCI_##size##_BAD) \
|
|
return -EINVAL; \
|
|
return -EINVAL; \
|
|
@@ -159,9 +159,7 @@ int pci_user_read_config_##size \
|
|
pos, sizeof(type), &data); \
|
|
pos, sizeof(type), &data); \
|
|
raw_spin_unlock_irq(&pci_lock); \
|
|
raw_spin_unlock_irq(&pci_lock); \
|
|
*val = (type)data; \
|
|
*val = (type)data; \
|
|
- if (ret > 0) \
|
|
|
|
- ret = -EINVAL; \
|
|
|
|
- return ret; \
|
|
|
|
|
|
+ return pcibios_err_to_errno(ret); \
|
|
} \
|
|
} \
|
|
EXPORT_SYMBOL_GPL(pci_user_read_config_##size);
|
|
EXPORT_SYMBOL_GPL(pci_user_read_config_##size);
|
|
|
|
|
|
@@ -170,7 +168,7 @@ EXPORT_SYMBOL_GPL(pci_user_read_config_##size);
|
|
int pci_user_write_config_##size \
|
|
int pci_user_write_config_##size \
|
|
(struct pci_dev *dev, int pos, type val) \
|
|
(struct pci_dev *dev, int pos, type val) \
|
|
{ \
|
|
{ \
|
|
- int ret = -EIO; \
|
|
|
|
|
|
+ int ret = PCIBIOS_SUCCESSFUL; \
|
|
if (PCI_##size##_BAD) \
|
|
if (PCI_##size##_BAD) \
|
|
return -EINVAL; \
|
|
return -EINVAL; \
|
|
raw_spin_lock_irq(&pci_lock); \
|
|
raw_spin_lock_irq(&pci_lock); \
|
|
@@ -179,9 +177,7 @@ int pci_user_write_config_##size \
|
|
ret = dev->bus->ops->write(dev->bus, dev->devfn, \
|
|
ret = dev->bus->ops->write(dev->bus, dev->devfn, \
|
|
pos, sizeof(type), val); \
|
|
pos, sizeof(type), val); \
|
|
raw_spin_unlock_irq(&pci_lock); \
|
|
raw_spin_unlock_irq(&pci_lock); \
|
|
- if (ret > 0) \
|
|
|
|
- ret = -EINVAL; \
|
|
|
|
- return ret; \
|
|
|
|
|
|
+ return pcibios_err_to_errno(ret); \
|
|
} \
|
|
} \
|
|
EXPORT_SYMBOL_GPL(pci_user_write_config_##size);
|
|
EXPORT_SYMBOL_GPL(pci_user_write_config_##size);
|
|
|
|
|