Skip to content

Commit

Permalink
PCI: Use to_pci_dev() instead of open-coding it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geliang Tang authored and Bjorn Helgaas committed Jan 8, 2016
1 parent ff3ce48 commit f3d2f16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/pci/hotplug/shpchp_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f3d2f16

Please sign in to comment.