diff options
author | Geliang Tang <geliangtang@163.com> | 2015-12-27 18:46:04 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-07 23:17:59 -0800 |
commit | 445f82492f2256b9a7c09292b458e152e7fae7f1 (patch) | |
tree | 1c41cade1565947a21f089431dcb43d686b0e27c /drivers/vme | |
parent | c37ff3fbe06f44e8ec3f8077b3a3c468635a8868 (diff) | |
download | linux-exynos-445f82492f2256b9a7c09292b458e152e7fae7f1.tar.gz linux-exynos-445f82492f2256b9a7c09292b458e152e7fae7f1.tar.bz2 linux-exynos-445f82492f2256b9a7c09292b458e152e7fae7f1.zip |
vme: vme_ca91cx42.c: use to_pci_dev()
Use to_pci_dev() instead of open-coding it.
Signed-off-by: Geliang Tang <geliangtang@163.com>
Acked-by: Martyn Welch <martyn@welchs.me.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/vme')
-rw-r--r-- | drivers/vme/bridges/vme_ca91cx42.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/vme/bridges/vme_ca91cx42.c b/drivers/vme/bridges/vme_ca91cx42.c index b79a74a98a23..5fbeab38889e 100644 --- a/drivers/vme/bridges/vme_ca91cx42.c +++ b/drivers/vme/bridges/vme_ca91cx42.c @@ -202,7 +202,7 @@ static int ca91cx42_irq_init(struct vme_bridge *ca91cx42_bridge) bridge = ca91cx42_bridge->driver_priv; /* Need pdev */ - pdev = container_of(ca91cx42_bridge->parent, struct pci_dev, dev); + pdev = to_pci_dev(ca91cx42_bridge->parent); INIT_LIST_HEAD(&ca91cx42_bridge->vme_error_handlers); @@ -293,8 +293,7 @@ static void ca91cx42_irq_set(struct vme_bridge *ca91cx42_bridge, int level, iowrite32(tmp, bridge->base + LINT_EN); if ((state == 0) && (sync != 0)) { - pdev = container_of(ca91cx42_bridge->parent, struct pci_dev, - dev); + pdev = to_pci_dev(ca91cx42_bridge->parent); synchronize_irq(pdev->irq); } @@ -518,7 +517,7 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image, dev_err(ca91cx42_bridge->parent, "Dev entry NULL\n"); return -EINVAL; } - pdev = container_of(ca91cx42_bridge->parent, struct pci_dev, dev); + pdev = to_pci_dev(ca91cx42_bridge->parent); existing_size = (unsigned long long)(image->bus_resource.end - image->bus_resource.start); @@ -1519,7 +1518,7 @@ static void *ca91cx42_alloc_consistent(struct device *parent, size_t size, struct pci_dev *pdev; /* Find pci_dev container of dev */ - pdev = container_of(parent, struct pci_dev, dev); + pdev = to_pci_dev(parent); return pci_alloc_consistent(pdev, size, dma); } @@ -1530,7 +1529,7 @@ static void ca91cx42_free_consistent(struct device *parent, size_t size, struct pci_dev *pdev; /* Find pci_dev container of dev */ - pdev = container_of(parent, struct pci_dev, dev); + pdev = to_pci_dev(parent); pci_free_consistent(pdev, size, vaddr, dma); } |