mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 15:33:28 +00:00
The following commit:
commit 815dd18788
Author: Bart Van Assche <[email protected]>
Date: Fri Jan 20 13:04:04 2017 -0800
treewide: Consolidate get_dma_ops() implementations
rearranges get_dma_ops in a way that xen_dma_ops are not returned when
running on Xen anymore, dev->dma_ops is returned instead (see
arch/arm/include/asm/dma-mapping.h:get_arch_dma_ops and
include/linux/dma-mapping.h:get_dma_ops).
Fix the problem by storing dev->dma_ops in dev_archdata, and setting
dev->dma_ops to xen_dma_ops. This way, xen_dma_ops is returned naturally
by get_dma_ops. The Xen code can retrieve the original dev->dma_ops from
dev_archdata when needed. It also allows us to remove __generic_dma_ops
from common headers.
Signed-off-by: Stefano Stabellini <[email protected]>
Tested-by: Julien Grall <[email protected]>
Suggested-by: Catalin Marinas <[email protected]>
Reviewed-by: Catalin Marinas <[email protected]>
Cc: <[email protected]> [4.11+]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: Julien Grall <[email protected]>
33 lines
886 B
C
33 lines
886 B
C
/*
|
|
* Copyright (C) 2012 ARM Ltd.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
#ifndef __ASM_DEVICE_H
|
|
#define __ASM_DEVICE_H
|
|
|
|
struct dev_archdata {
|
|
#ifdef CONFIG_IOMMU_API
|
|
void *iommu; /* private IOMMU data */
|
|
#endif
|
|
#ifdef CONFIG_XEN
|
|
const struct dma_map_ops *dev_dma_ops;
|
|
#endif
|
|
bool dma_coherent;
|
|
};
|
|
|
|
struct pdev_archdata {
|
|
};
|
|
|
|
#endif
|