diff options
author | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-03-14 14:43:10 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-03-18 07:58:34 +0300 |
commit | e7b8153e2a4f0c9c8d1450aa7328d54ea64fe8b2 (patch) | |
tree | 66b31cbad2bcee3f115a8c910cfebefcb9f4e048 /drivers/media/platform/sti/hva/hva-mem.c | |
parent | 43ecec16c4face9a59e81771e7cbff4671c62117 (diff) | |
download | linux-e7b8153e2a4f0c9c8d1450aa7328d54ea64fe8b2.tar.xz |
media: platform: place stm32/ and sti/ under st/ dir
As the end goal is to have platform drivers split by vendor,
move both stm32/ and sti/ for them to be inside st/ directory.
Acked-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/sti/hva/hva-mem.c')
-rw-r--r-- | drivers/media/platform/sti/hva/hva-mem.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/drivers/media/platform/sti/hva/hva-mem.c b/drivers/media/platform/sti/hva/hva-mem.c deleted file mode 100644 index 68047b60b66c..000000000000 --- a/drivers/media/platform/sti/hva/hva-mem.c +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Copyright (C) STMicroelectronics SA 2015 - * Authors: Yannick Fertre <yannick.fertre@st.com> - * Hugues Fruchet <hugues.fruchet@st.com> - */ - -#include "hva.h" -#include "hva-mem.h" - -int hva_mem_alloc(struct hva_ctx *ctx, u32 size, const char *name, - struct hva_buffer **buf) -{ - struct device *dev = ctx_to_dev(ctx); - struct hva_buffer *b; - dma_addr_t paddr; - void *base; - - b = devm_kzalloc(dev, sizeof(*b), GFP_KERNEL); - if (!b) { - ctx->sys_errors++; - return -ENOMEM; - } - - base = dma_alloc_attrs(dev, size, &paddr, GFP_KERNEL, - DMA_ATTR_WRITE_COMBINE); - if (!base) { - dev_err(dev, "%s %s : dma_alloc_attrs failed for %s (size=%d)\n", - ctx->name, __func__, name, size); - ctx->sys_errors++; - devm_kfree(dev, b); - return -ENOMEM; - } - - b->size = size; - b->paddr = paddr; - b->vaddr = base; - b->name = name; - - dev_dbg(dev, - "%s allocate %d bytes of HW memory @(virt=%p, phy=%pad): %s\n", - ctx->name, size, b->vaddr, &b->paddr, b->name); - - /* return hva buffer to user */ - *buf = b; - - return 0; -} - -void hva_mem_free(struct hva_ctx *ctx, struct hva_buffer *buf) -{ - struct device *dev = ctx_to_dev(ctx); - - dev_dbg(dev, - "%s free %d bytes of HW memory @(virt=%p, phy=%pad): %s\n", - ctx->name, buf->size, buf->vaddr, &buf->paddr, buf->name); - - dma_free_attrs(dev, buf->size, buf->vaddr, buf->paddr, - DMA_ATTR_WRITE_COMBINE); - - devm_kfree(dev, buf); -} |