diff options
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 6225b78fa65b..dcd17e7458ab 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -777,4 +777,17 @@ static inline unsigned int __ac_err_mask(u8 status) | |||
777 | return mask; | 777 | return mask; |
778 | } | 778 | } |
779 | 779 | ||
780 | static inline int ata_pad_alloc(struct ata_port *ap, struct device *dev) | ||
781 | { | ||
782 | ap->pad_dma = 0; | ||
783 | ap->pad = dma_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ, | ||
784 | &ap->pad_dma, GFP_KERNEL); | ||
785 | return (ap->pad == NULL) ? -ENOMEM : 0; | ||
786 | } | ||
787 | |||
788 | static inline void ata_pad_free(struct ata_port *ap, struct device *dev) | ||
789 | { | ||
790 | dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma); | ||
791 | } | ||
792 | |||
780 | #endif /* __LINUX_LIBATA_H__ */ | 793 | #endif /* __LINUX_LIBATA_H__ */ |