[PATCH 6/9] ssb: use to_pci_dev()

From: Geliang Tang
Date: Sun Dec 27 2015 - 05:47:47 EST


Use to_pci_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@xxxxxxx>
---
drivers/ssb/pci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
index 0f28c08..67428f4 100644
--- a/drivers/ssb/pci.c
+++ b/drivers/ssb/pci.c
@@ -1130,7 +1130,7 @@ static ssize_t ssb_pci_attr_sprom_show(struct device *pcidev,
struct device_attribute *attr,
char *buf)
{
- struct pci_dev *pdev = container_of(pcidev, struct pci_dev, dev);
+ struct pci_dev *pdev = to_pci_dev(pcidev);
struct ssb_bus *bus;

bus = ssb_pci_dev_to_bus(pdev);
@@ -1144,7 +1144,7 @@ static ssize_t ssb_pci_attr_sprom_store(struct device *pcidev,
struct device_attribute *attr,
const char *buf, size_t count)
{
- struct pci_dev *pdev = container_of(pcidev, struct pci_dev, dev);
+ struct pci_dev *pdev = to_pci_dev(pcidev);
struct ssb_bus *bus;

bus = ssb_pci_dev_to_bus(pdev);
--
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/