Commit 177581fa authored by Aaron Sierra's avatar Aaron Sierra Committed by Greg Kroah-Hartman

vme_tsi148: Utilize to_pci_dev() macro

Save some characters by using to_pci_dev() instead of container_of().
Signed-off-by: default avatarAaron Sierra <asierra@xes-inc.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 226572b1
...@@ -320,7 +320,7 @@ static int tsi148_irq_init(struct vme_bridge *tsi148_bridge) ...@@ -320,7 +320,7 @@ static int tsi148_irq_init(struct vme_bridge *tsi148_bridge)
struct pci_dev *pdev; struct pci_dev *pdev;
struct tsi148_driver *bridge; struct tsi148_driver *bridge;
pdev = container_of(tsi148_bridge->parent, struct pci_dev, dev); pdev = to_pci_dev(tsi148_bridge->parent);
bridge = tsi148_bridge->driver_priv; bridge = tsi148_bridge->driver_priv;
...@@ -433,9 +433,7 @@ static void tsi148_irq_set(struct vme_bridge *tsi148_bridge, int level, ...@@ -433,9 +433,7 @@ static void tsi148_irq_set(struct vme_bridge *tsi148_bridge, int level,
iowrite32be(tmp, bridge->base + TSI148_LCSR_INTEO); iowrite32be(tmp, bridge->base + TSI148_LCSR_INTEO);
if (sync != 0) { if (sync != 0) {
pdev = container_of(tsi148_bridge->parent, pdev = to_pci_dev(tsi148_bridge->parent);
struct pci_dev, dev);
synchronize_irq(pdev->irq); synchronize_irq(pdev->irq);
} }
} else { } else {
...@@ -814,7 +812,7 @@ static int tsi148_alloc_resource(struct vme_master_resource *image, ...@@ -814,7 +812,7 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
tsi148_bridge = image->parent; tsi148_bridge = image->parent;
pdev = container_of(tsi148_bridge->parent, struct pci_dev, dev); pdev = to_pci_dev(tsi148_bridge->parent);
existing_size = (unsigned long long)(image->bus_resource.end - existing_size = (unsigned long long)(image->bus_resource.end -
image->bus_resource.start); image->bus_resource.start);
...@@ -917,7 +915,7 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled, ...@@ -917,7 +915,7 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
bridge = tsi148_bridge->driver_priv; bridge = tsi148_bridge->driver_priv;
pdev = container_of(tsi148_bridge->parent, struct pci_dev, dev); pdev = to_pci_dev(tsi148_bridge->parent);
/* Verify input data */ /* Verify input data */
if (vme_base & 0xFFFF) { if (vme_base & 0xFFFF) {
...@@ -2238,7 +2236,7 @@ static void *tsi148_alloc_consistent(struct device *parent, size_t size, ...@@ -2238,7 +2236,7 @@ static void *tsi148_alloc_consistent(struct device *parent, size_t size,
struct pci_dev *pdev; struct pci_dev *pdev;
/* Find pci_dev container of dev */ /* 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); return pci_alloc_consistent(pdev, size, dma);
} }
...@@ -2249,7 +2247,7 @@ static void tsi148_free_consistent(struct device *parent, size_t size, ...@@ -2249,7 +2247,7 @@ static void tsi148_free_consistent(struct device *parent, size_t size,
struct pci_dev *pdev; struct pci_dev *pdev;
/* Find pci_dev container of dev */ /* 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); pci_free_consistent(pdev, size, vaddr, dma);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment