PCI: Move pci_read_vpd() and pci_write_vpd() close to other VPD code
pci_read_vpd() and pci_write_vpd() were stranded in the middle of config accessor functions. Move them close to the other VPD code in the file. No functional change. Tested-by: Shane Seymour <shane.seymour@hpe.com> Tested-by: Babu Moger <babu.moger@oracle.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Hannes Reinecke <hare@suse.com>
This commit is contained in:
parent
104daa71b3
commit
fc0a407e9e
|
@ -174,38 +174,6 @@ struct pci_ops *pci_bus_set_ops(struct pci_bus *bus, struct pci_ops *ops)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(pci_bus_set_ops);
|
EXPORT_SYMBOL(pci_bus_set_ops);
|
||||||
|
|
||||||
/**
|
|
||||||
* pci_read_vpd - Read one entry from Vital Product Data
|
|
||||||
* @dev: pci device struct
|
|
||||||
* @pos: offset in vpd space
|
|
||||||
* @count: number of bytes to read
|
|
||||||
* @buf: pointer to where to store result
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf)
|
|
||||||
{
|
|
||||||
if (!dev->vpd || !dev->vpd->ops)
|
|
||||||
return -ENODEV;
|
|
||||||
return dev->vpd->ops->read(dev, pos, count, buf);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(pci_read_vpd);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* pci_write_vpd - Write entry to Vital Product Data
|
|
||||||
* @dev: pci device struct
|
|
||||||
* @pos: offset in vpd space
|
|
||||||
* @count: number of bytes to write
|
|
||||||
* @buf: buffer containing write data
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf)
|
|
||||||
{
|
|
||||||
if (!dev->vpd || !dev->vpd->ops)
|
|
||||||
return -ENODEV;
|
|
||||||
return dev->vpd->ops->write(dev, pos, count, buf);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(pci_write_vpd);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following routines are to prevent the user from accessing PCI config
|
* The following routines are to prevent the user from accessing PCI config
|
||||||
* space when it's unsafe to do so. Some devices require this during BIST and
|
* space when it's unsafe to do so. Some devices require this during BIST and
|
||||||
|
@ -277,6 +245,36 @@ PCI_USER_WRITE_CONFIG(dword, u32)
|
||||||
|
|
||||||
/* VPD access through PCI 2.2+ VPD capability */
|
/* VPD access through PCI 2.2+ VPD capability */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pci_read_vpd - Read one entry from Vital Product Data
|
||||||
|
* @dev: pci device struct
|
||||||
|
* @pos: offset in vpd space
|
||||||
|
* @count: number of bytes to read
|
||||||
|
* @buf: pointer to where to store result
|
||||||
|
*/
|
||||||
|
ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf)
|
||||||
|
{
|
||||||
|
if (!dev->vpd || !dev->vpd->ops)
|
||||||
|
return -ENODEV;
|
||||||
|
return dev->vpd->ops->read(dev, pos, count, buf);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(pci_read_vpd);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pci_write_vpd - Write entry to Vital Product Data
|
||||||
|
* @dev: pci device struct
|
||||||
|
* @pos: offset in vpd space
|
||||||
|
* @count: number of bytes to write
|
||||||
|
* @buf: buffer containing write data
|
||||||
|
*/
|
||||||
|
ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf)
|
||||||
|
{
|
||||||
|
if (!dev->vpd || !dev->vpd->ops)
|
||||||
|
return -ENODEV;
|
||||||
|
return dev->vpd->ops->write(dev, pos, count, buf);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(pci_write_vpd);
|
||||||
|
|
||||||
#define PCI_VPD_PCI22_SIZE (PCI_VPD_ADDR_MASK + 1)
|
#define PCI_VPD_PCI22_SIZE (PCI_VPD_ADDR_MASK + 1)
|
||||||
|
|
||||||
struct pci_vpd_pci22 {
|
struct pci_vpd_pci22 {
|
||||||
|
|
Loading…
Reference in a new issue