summaryrefslogtreecommitdiffstats
path: root/drivers/pci/access.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2016-02-22 13:58:20 -0600
committerBjorn Helgaas <bhelgaas@google.com>2016-02-29 17:47:24 -0600
commitda006847231b2b2ce443b29f1d3df6df7415030d (patch)
tree812f934cd9a63896b012fe19b1fce59d3551ce88 /drivers/pci/access.c
parent64379079a9e37ab9e1c755921d7ff1c4fa3ac486 (diff)
downloadop-kernel-dev-da006847231b2b2ce443b29f1d3df6df7415030d.zip
op-kernel-dev-da006847231b2b2ce443b29f1d3df6df7415030d.tar.gz
PCI: Remove struct pci_vpd_ops.release function pointer
The struct pci_vpd_ops.release function pointer is always pci_vpd_pci22_release(), so there's no need for the flexibility of a function pointer. Inline the pci_vpd_pci22_release() body into pci_vpd_release() and remove pci_vpd_pci22_release() and the struct pci_vpd_ops.release function pointer. 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>
Diffstat (limited to 'drivers/pci/access.c')
-rw-r--r--drivers/pci/access.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/pci/access.c b/drivers/pci/access.c
index ca42a33..68ed22a 100644
--- a/drivers/pci/access.c
+++ b/drivers/pci/access.c
@@ -508,15 +508,9 @@ out:
return ret ? ret : count;
}
-static void pci_vpd_pci22_release(struct pci_dev *dev)
-{
- kfree(container_of(dev->vpd, struct pci_vpd_pci22, base));
-}
-
static const struct pci_vpd_ops pci_vpd_pci22_ops = {
.read = pci_vpd_pci22_read,
.write = pci_vpd_pci22_write,
- .release = pci_vpd_pci22_release,
};
static ssize_t pci_vpd_f0_read(struct pci_dev *dev, loff_t pos, size_t count,
@@ -552,7 +546,6 @@ static ssize_t pci_vpd_f0_write(struct pci_dev *dev, loff_t pos, size_t count,
static const struct pci_vpd_ops pci_vpd_f0_ops = {
.read = pci_vpd_f0_read,
.write = pci_vpd_f0_write,
- .release = pci_vpd_pci22_release,
};
int pci_vpd_pci22_init(struct pci_dev *dev)
@@ -584,7 +577,7 @@ int pci_vpd_pci22_init(struct pci_dev *dev)
void pci_vpd_release(struct pci_dev *dev)
{
if (dev->vpd)
- dev->vpd->ops->release(dev);
+ kfree(container_of(dev->vpd, struct pci_vpd_pci22, base));
}
/**
OpenPOWER on IntegriCloud