linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] PCI: use to_pci_dev
@ 2015-12-23 12:28 Geliang Tang
  2015-12-23 12:28 ` [PATCH 2/2] PCI: label, sysfs: use kobj_to_dev Geliang Tang
  2016-01-08 18:08 ` [PATCH 1/2] PCI: use to_pci_dev Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Geliang Tang @ 2015-12-23 12:28 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Geliang Tang, linux-pci, linux-kernel

Use to_pci_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/pci/hotplug/shpchp_sysfs.c | 2 +-
 drivers/pci/pci.c                  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/hotplug/shpchp_sysfs.c b/drivers/pci/hotplug/shpchp_sysfs.c
index 52875b3..392a40b 100644
--- a/drivers/pci/hotplug/shpchp_sysfs.c
+++ b/drivers/pci/hotplug/shpchp_sysfs.c
@@ -43,7 +43,7 @@ static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, cha
 	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");
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index d1a7105..9356f90 100644
--- a/drivers/pci/pci.c
+++ b/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;
 
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-08 18:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-23 12:28 [PATCH 1/2] PCI: use to_pci_dev Geliang Tang
2015-12-23 12:28 ` [PATCH 2/2] PCI: label, sysfs: use kobj_to_dev Geliang Tang
2016-01-08 18:08 ` [PATCH 1/2] PCI: use to_pci_dev Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).