Skip to content

Commit

Permalink
vme: vme_ca91cx42.c: use to_pci_dev()
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>
Acked-by: Martyn Welch <martyn@welchs.me.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Geliang Tang authored and Greg Kroah-Hartman committed Feb 8, 2016
1 parent c37ff3f commit 445f824
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions drivers/vme/bridges/vme_ca91cx42.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 445f824

Please sign in to comment.