From 19d564adff7085c9f976712cfe4737aa3b3e8cce Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Mon, 18 Nov 2019 11:35:32 +0100 Subject: media/videobuf2: Drop dma_buf->k(un)map support No in-tree users left. Acked-by: Marek Szyprowski Acked-by: Hans Verkuil Acked-by: Sumit Semwal Signed-off-by: Daniel Vetter Cc: Pawel Osciak Cc: Marek Szyprowski Cc: Kyungmin Park Cc: Tomasz Figa Cc: linux-media@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20191118103536.17675-12-daniel.vetter@ffwll.ch --- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 8 -------- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 8 -------- drivers/media/common/videobuf2/videobuf2-vmalloc.c | 8 -------- 3 files changed, 24 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c index 44cd0e530bbd..d0c9dffe49e5 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c @@ -335,13 +335,6 @@ static void vb2_dc_dmabuf_ops_release(struct dma_buf *dbuf) vb2_dc_put(dbuf->priv); } -static void *vb2_dc_dmabuf_ops_kmap(struct dma_buf *dbuf, unsigned long pgnum) -{ - struct vb2_dc_buf *buf = dbuf->priv; - - return buf->vaddr ? buf->vaddr + pgnum * PAGE_SIZE : NULL; -} - static void *vb2_dc_dmabuf_ops_vmap(struct dma_buf *dbuf) { struct vb2_dc_buf *buf = dbuf->priv; @@ -360,7 +353,6 @@ static const struct dma_buf_ops vb2_dc_dmabuf_ops = { .detach = vb2_dc_dmabuf_ops_detach, .map_dma_buf = vb2_dc_dmabuf_ops_map, .unmap_dma_buf = vb2_dc_dmabuf_ops_unmap, - .map = vb2_dc_dmabuf_ops_kmap, .vmap = vb2_dc_dmabuf_ops_vmap, .mmap = vb2_dc_dmabuf_ops_mmap, .release = vb2_dc_dmabuf_ops_release, diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c index ed706b2a263c..6db60e9d5183 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c @@ -470,13 +470,6 @@ static void vb2_dma_sg_dmabuf_ops_release(struct dma_buf *dbuf) vb2_dma_sg_put(dbuf->priv); } -static void *vb2_dma_sg_dmabuf_ops_kmap(struct dma_buf *dbuf, unsigned long pgnum) -{ - struct vb2_dma_sg_buf *buf = dbuf->priv; - - return buf->vaddr ? buf->vaddr + pgnum * PAGE_SIZE : NULL; -} - static void *vb2_dma_sg_dmabuf_ops_vmap(struct dma_buf *dbuf) { struct vb2_dma_sg_buf *buf = dbuf->priv; @@ -495,7 +488,6 @@ static const struct dma_buf_ops vb2_dma_sg_dmabuf_ops = { .detach = vb2_dma_sg_dmabuf_ops_detach, .map_dma_buf = vb2_dma_sg_dmabuf_ops_map, .unmap_dma_buf = vb2_dma_sg_dmabuf_ops_unmap, - .map = vb2_dma_sg_dmabuf_ops_kmap, .vmap = vb2_dma_sg_dmabuf_ops_vmap, .mmap = vb2_dma_sg_dmabuf_ops_mmap, .release = vb2_dma_sg_dmabuf_ops_release, diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c index 04d51ca63223..4d5af352e249 100644 --- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c +++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c @@ -319,13 +319,6 @@ static void vb2_vmalloc_dmabuf_ops_release(struct dma_buf *dbuf) vb2_vmalloc_put(dbuf->priv); } -static void *vb2_vmalloc_dmabuf_ops_kmap(struct dma_buf *dbuf, unsigned long pgnum) -{ - struct vb2_vmalloc_buf *buf = dbuf->priv; - - return buf->vaddr + pgnum * PAGE_SIZE; -} - static void *vb2_vmalloc_dmabuf_ops_vmap(struct dma_buf *dbuf) { struct vb2_vmalloc_buf *buf = dbuf->priv; @@ -344,7 +337,6 @@ static const struct dma_buf_ops vb2_vmalloc_dmabuf_ops = { .detach = vb2_vmalloc_dmabuf_ops_detach, .map_dma_buf = vb2_vmalloc_dmabuf_ops_map, .unmap_dma_buf = vb2_vmalloc_dmabuf_ops_unmap, - .map = vb2_vmalloc_dmabuf_ops_kmap, .vmap = vb2_vmalloc_dmabuf_ops_vmap, .mmap = vb2_vmalloc_dmabuf_ops_mmap, .release = vb2_vmalloc_dmabuf_ops_release, -- cgit v1.2.3-59-g8ed1b From 75d18496cf92f2bde86e0fdf103e4fb7423a3e55 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 3 Dec 2019 18:38:52 +0200 Subject: media: constify fb ops across all drivers Now that the fbops member of struct fb_info is const, we can start making the ops const as well. Remove the redundant fbops assignments while at it. v2: - actually add const in vivid - fix typo (Christophe de Dinechin) Cc: Hans Verkuil Cc: Andy Walls Cc: linux-media@vger.kernel.org Cc: ivtv-devel@ivtvdriver.org Reviewed-by: Daniel Vetter Reviewed-by: Sakari Ailus Acked-by: Hans Verkuil Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/71794337f8611271f2c1fdb3882119a58e743a87.1575390741.git.jani.nikula@intel.com --- drivers/media/pci/ivtv/ivtvfb.c | 3 +-- drivers/media/platform/vivid/vivid-osd.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/pci/ivtv/ivtvfb.c b/drivers/media/pci/ivtv/ivtvfb.c index 95a56cce9b65..f2922b554b09 100644 --- a/drivers/media/pci/ivtv/ivtvfb.c +++ b/drivers/media/pci/ivtv/ivtvfb.c @@ -925,7 +925,7 @@ static int ivtvfb_blank(int blank_mode, struct fb_info *info) return 0; } -static struct fb_ops ivtvfb_ops = { +static const struct fb_ops ivtvfb_ops = { .owner = THIS_MODULE, .fb_write = ivtvfb_write, .fb_check_var = ivtvfb_check_var, @@ -1049,7 +1049,6 @@ static int ivtvfb_init_vidmode(struct ivtv *itv) oi->ivtvfb_info.node = -1; oi->ivtvfb_info.flags = FBINFO_FLAG_DEFAULT; - oi->ivtvfb_info.fbops = &ivtvfb_ops; oi->ivtvfb_info.par = itv; oi->ivtvfb_info.var = oi->ivtvfb_defined; oi->ivtvfb_info.fix = oi->ivtvfb_fix; diff --git a/drivers/media/platform/vivid/vivid-osd.c b/drivers/media/platform/vivid/vivid-osd.c index f2e789bdf4a6..fbaec8acc161 100644 --- a/drivers/media/platform/vivid/vivid-osd.c +++ b/drivers/media/platform/vivid/vivid-osd.c @@ -244,7 +244,7 @@ static int vivid_fb_blank(int blank_mode, struct fb_info *info) return 0; } -static struct fb_ops vivid_fb_ops = { +static const struct fb_ops vivid_fb_ops = { .owner = THIS_MODULE, .fb_check_var = vivid_fb_check_var, .fb_set_par = vivid_fb_set_par, @@ -311,7 +311,6 @@ static int vivid_fb_init_vidmode(struct vivid_dev *dev) dev->fb_info.node = -1; dev->fb_info.flags = FBINFO_FLAG_DEFAULT; - dev->fb_info.fbops = &vivid_fb_ops; dev->fb_info.par = dev; dev->fb_info.var = dev->fb_defined; dev->fb_info.fix = dev->fb_fix; -- cgit v1.2.3-59-g8ed1b