Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 815dd187 authored by Bart Van Assche's avatar Bart Van Assche Committed by Doug Ledford
Browse files

treewide: Consolidate get_dma_ops() implementations



Introduce a new architecture-specific get_arch_dma_ops() function
that takes a struct bus_type * argument. Add get_dma_ops() in
<linux/dma-mapping.h>.

Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Russell King <linux@armlinux.org.uk>
Cc: x86@kernel.org
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent ca6e8e10
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@

extern const struct dma_map_ops *dma_ops;

static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
{
	return dma_ops;
}
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@

extern const struct dma_map_ops arc_dma_ops;

static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
{
	return &arc_dma_ops;
}
+2 −2
Original line number Diff line number Diff line
@@ -23,12 +23,12 @@ static inline const struct dma_map_ops *__generic_dma_ops(struct device *dev)
	return &arm_dma_ops;
}

static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
{
	if (xen_initial_domain())
		return xen_dma_ops;
	else
		return __generic_dma_ops(dev);
		return __generic_dma_ops(NULL);
}

#define HAVE_ARCH_DMA_SUPPORTED 1
+2 −2
Original line number Diff line number Diff line
@@ -39,12 +39,12 @@ static inline const struct dma_map_ops *__generic_dma_ops(struct device *dev)
	return &dummy_dma_ops;
}

static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
{
	if (xen_initial_domain())
		return xen_dma_ops;
	else
		return __generic_dma_ops(dev);
		return __generic_dma_ops(NULL);
}

void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size,

extern const struct dma_map_ops avr32_dma_ops;

static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
{
	return &avr32_dma_ops;
}
Loading