From: Joe Perches Date: Thu, 26 Jun 2014 00:43:16 +0000 (+1000) Subject: pci-dma-compat: add pci_zalloc_consistent helper X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6c9d16edca567354cd56c32e1d2956a4dbd4f7f7;p=karo-tx-linux.git pci-dma-compat: add pci_zalloc_consistent helper Add this helper for consistency with pci_zalloc_coherent and the ability to remove unnecessary memset(,0,) uses. Signed-off-by: Joe Perches Cc: Arnd Bergmann Cc: "James E.J. Bottomley" Cc: "John W. Linville" Cc: "Stephen M. Cameron" Cc: Adam Radford Cc: Chaoming Li Cc: Chas Williams Cc: Christian Benvenuti Cc: Christopher Harrer Cc: Dario Ballabio Cc: David Airlie Cc: Don Fry Cc: Faisal Latif Cc: Forest Bond Cc: Govindarajulu Varadarajan <_govind@gmx.com> Cc: Greg Kroah-Hartman Cc: Hal Rosenstock Cc: Hans Verkuil Cc: Jayamohan Kallickal Cc: Jiri Slaby Cc: Jitendra Kalsaria Cc: Larry Finger Cc: Lennert Buytenhek Cc: Lior Dotan Cc: Manish Chopra Cc: Manohar Vanga Cc: Martyn Welch Cc: Mauro Carvalho Chehab Cc: Michael Neuffer Cc: Mirko Lindner Cc: Neel Patel Cc: Neela Syam Kolli Cc: Rajesh Borundia Cc: Roland Dreier Cc: Ron Mercer Cc: Samuel Ortiz Cc: Sean Hefty Cc: Shahed Shaikh Cc: Sony Chacko Cc: Stanislav Yakovlev Cc: Stephen Hemminger Cc: Steve Wise Cc: Sujith Sankar Cc: Tom Tucker Signed-off-by: Andrew Morton --- diff --git a/include/asm-generic/pci-dma-compat.h b/include/asm-generic/pci-dma-compat.h index 1437b7da09b2..c110843fc53b 100644 --- a/include/asm-generic/pci-dma-compat.h +++ b/include/asm-generic/pci-dma-compat.h @@ -19,6 +19,14 @@ pci_alloc_consistent(struct pci_dev *hwdev, size_t size, return dma_alloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, dma_handle, GFP_ATOMIC); } +static inline void * +pci_zalloc_consistent(struct pci_dev *hwdev, size_t size, + dma_addr_t *dma_handle) +{ + return dma_zalloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, + size, dma_handle, GFP_ATOMIC); +} + static inline void pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle)