Explorar o código

PCI: Use to_pci_dev() instead of open-coding it

Use to_pci_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Geliang Tang %!s(int64=9) %!d(string=hai) anos
pai
achega
f3d2f1655b
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      drivers/pci/hotplug/shpchp_sysfs.c
  2. 1 1
      drivers/pci/pci.c

+ 1 - 1
drivers/pci/hotplug/shpchp_sysfs.c

@@ -43,7 +43,7 @@ static ssize_t show_ctrl(struct device *dev, struct device_attribute *attr, char
 	struct resource *res;
 	struct pci_bus *bus;
 
-	pdev = container_of(dev, struct pci_dev, dev);
+	pdev = to_pci_dev(dev);
 	bus = pdev->subordinate;
 
 	out += sprintf(buf, "Free resources: memory\n");

+ 1 - 1
drivers/pci/pci.c

@@ -1417,7 +1417,7 @@ struct pci_devres {
 
 static void pcim_release(struct device *gendev, void *res)
 {
-	struct pci_dev *dev = container_of(gendev, struct pci_dev, dev);
+	struct pci_dev *dev = to_pci_dev(gendev);
 	struct pci_devres *this = res;
 	int i;