diff options
author | Hans de Goede <hdegoede@redhat.com> | 2022-10-14 17:13:41 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-11-25 08:14:03 +0000 |
commit | 9a29f5fc3404061d1909e05b98edf0b34686dd3f (patch) | |
tree | 476a5bfe14783248c1c3b0d1578e20b1e8ea06e6 /drivers/staging/media/atomisp/pci/atomisp_fops.c | |
parent | ce8e2632835cda7e53936d9884d40e1cfe13e0ec (diff) | |
download | linux-9a29f5fc3404061d1909e05b98edf0b34686dd3f.tar.bz2 |
media: atomisp: Add ia_css_frame_get_info() helper
Several places rely on the [frame_]info member being the first member of
struct ia_css_frame, so that &frame->info will yield NULL when frame is
NULL (some places already explicitly check for a NULL frame pointer but
not nearly all).
For videobuf2 support the vb2_v4l2_buffer struct needs to be embedded
in the frame struct and it needs to be the first member. Breaking the
assumption that &frame->info will yield NULL when frame is NULL.
Add a ia_css_frame_get_info() helper to return either the ia_css_frame_info
struct embedded in the frame, or NULL when the frame pointer is NULL and
use this in places where a ia_css_frame_info ptr or NULL is expected.
To make sure that we catch all uses of the info field this patch also
renames the info field to frame_info.
This is a preparation patch for converting the driver to videobuf2.
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging/media/atomisp/pci/atomisp_fops.c')
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_fops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index ac9aa8649635..aefe1c56c262 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -992,7 +992,7 @@ static int remove_pad_from_frame(struct atomisp_device *isp, if (ret < 0) goto remove_pad_error; - load += in_frame->info.padded_width; + load += in_frame->frame_info.padded_width; store += width; } |