summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2020-12-03 12:00:50 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-01-27 15:52:23 +0100
commit98c588b6d27c04460a590f55f1e2474129abe87c (patch)
tree77614188a9812b87610aa474be1e0d282ab55884 /drivers/media/platform
parentmedia: allegro: extract RBSP handler from H.264 NAL generator (diff)
downloadlinux-98c588b6d27c04460a590f55f1e2474129abe87c.tar.xz
linux-98c588b6d27c04460a590f55f1e2474129abe87c.zip
media: allegro: add helper to report unsupported fields
Allow generators to explicitly signal an error if the C structs contain unsupported or invalid fields. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/allegro-dvt/nal-rbsp.c5
-rw-r--r--drivers/media/platform/allegro-dvt/nal-rbsp.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/platform/allegro-dvt/nal-rbsp.c b/drivers/media/platform/allegro-dvt/nal-rbsp.c
index 935ba23844f2..d911322d0efa 100644
--- a/drivers/media/platform/allegro-dvt/nal-rbsp.c
+++ b/drivers/media/platform/allegro-dvt/nal-rbsp.c
@@ -29,6 +29,11 @@ void rbsp_init(struct rbsp *rbsp, void *addr, size_t size,
rbsp->error = 0;
}
+void rbsp_unsupported(struct rbsp *rbsp)
+{
+ rbsp->error = -EINVAL;
+}
+
static int rbsp_read_bits(struct rbsp *rbsp, int n, unsigned int *value);
static int rbsp_write_bits(struct rbsp *rbsp, int n, unsigned int value);
diff --git a/drivers/media/platform/allegro-dvt/nal-rbsp.h b/drivers/media/platform/allegro-dvt/nal-rbsp.h
index 90cc1a4f716d..c72f49fed8d3 100644
--- a/drivers/media/platform/allegro-dvt/nal-rbsp.h
+++ b/drivers/media/platform/allegro-dvt/nal-rbsp.h
@@ -49,6 +49,7 @@ extern struct nal_rbsp_ops read;
void rbsp_init(struct rbsp *rbsp, void *addr, size_t size,
struct nal_rbsp_ops *ops);
+void rbsp_unsupported(struct rbsp *rbsp);
void rbsp_bit(struct rbsp *rbsp, int *value);
void rbsp_bits(struct rbsp *rbsp, int n, int *value);