Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vme_tsi148: Utilize to_pci_dev() macro

Save some characters by using to_pci_dev() instead of container_of().

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Aaron Sierra and committed by
Greg Kroah-Hartman
177581fa 226572b1

+6 -8
+6 -8
drivers/vme/bridges/vme_tsi148.c
··· 320 320 struct pci_dev *pdev; 321 321 struct tsi148_driver *bridge; 322 322 323 - pdev = container_of(tsi148_bridge->parent, struct pci_dev, dev); 323 + pdev = to_pci_dev(tsi148_bridge->parent); 324 324 325 325 bridge = tsi148_bridge->driver_priv; 326 326 ··· 433 433 iowrite32be(tmp, bridge->base + TSI148_LCSR_INTEO); 434 434 435 435 if (sync != 0) { 436 - pdev = container_of(tsi148_bridge->parent, 437 - struct pci_dev, dev); 438 - 436 + pdev = to_pci_dev(tsi148_bridge->parent); 439 437 synchronize_irq(pdev->irq); 440 438 } 441 439 } else { ··· 812 814 813 815 tsi148_bridge = image->parent; 814 816 815 - pdev = container_of(tsi148_bridge->parent, struct pci_dev, dev); 817 + pdev = to_pci_dev(tsi148_bridge->parent); 816 818 817 819 existing_size = (unsigned long long)(image->bus_resource.end - 818 820 image->bus_resource.start); ··· 915 917 916 918 bridge = tsi148_bridge->driver_priv; 917 919 918 - pdev = container_of(tsi148_bridge->parent, struct pci_dev, dev); 920 + pdev = to_pci_dev(tsi148_bridge->parent); 919 921 920 922 /* Verify input data */ 921 923 if (vme_base & 0xFFFF) { ··· 2236 2238 struct pci_dev *pdev; 2237 2239 2238 2240 /* Find pci_dev container of dev */ 2239 - pdev = container_of(parent, struct pci_dev, dev); 2241 + pdev = to_pci_dev(parent); 2240 2242 2241 2243 return pci_alloc_consistent(pdev, size, dma); 2242 2244 } ··· 2247 2249 struct pci_dev *pdev; 2248 2250 2249 2251 /* Find pci_dev container of dev */ 2250 - pdev = container_of(parent, struct pci_dev, dev); 2252 + pdev = to_pci_dev(parent); 2251 2253 2252 2254 pci_free_consistent(pdev, size, vaddr, dma); 2253 2255 }