diff mbox series

[v3,17/17] media: rkisp1: capture: Bypass the main device for handling querycap

Message ID 20220319163100.3083-18-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series media: rkisp1: Misc bug fixes and cleanups | expand

Commit Message

Laurent Pinchart March 19, 2022, 4:31 p.m. UTC
From: Paul Elder <paul.elder@ideasonboard.com>

When handling querycap, the capture node would access the main rkisp1
device unnecessarily. Get the information from the most direct source.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
---
 drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Dafna Hirschfeld March 22, 2022, 5:08 a.m. UTC | #1
On 19.03.2022 18:31, Laurent Pinchart wrote:
> From: Paul Elder <paul.elder@ideasonboard.com>
> 
> When handling querycap, the capture node would access the main rkisp1
> device unnecessarily. Get the information from the most direct source.
> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>

Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>

> ---
>  drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> index a7cf672457cd..94819e6c23e2 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> @@ -1248,11 +1248,8 @@ static int rkisp1_g_fmt_vid_cap_mplane(struct file *file, void *fh,
>  static int
>  rkisp1_querycap(struct file *file, void *priv, struct v4l2_capability *cap)
>  {
> -	struct rkisp1_capture *cap_dev = video_drvdata(file);
> -	struct rkisp1_device *rkisp1 = cap_dev->rkisp1;
> -
> -	strscpy(cap->driver, rkisp1->dev->driver->name, sizeof(cap->driver));
> -	strscpy(cap->card, rkisp1->dev->driver->name, sizeof(cap->card));
> +	strscpy(cap->driver, RKISP1_DRIVER_NAME, sizeof(cap->driver));
> +	strscpy(cap->card, RKISP1_DRIVER_NAME, sizeof(cap->card));
>  	strscpy(cap->bus_info, RKISP1_BUS_INFO, sizeof(cap->bus_info));
>  
>  	return 0;
> -- 
> Regards,
> 
> Laurent Pinchart
>
diff mbox series

Patch

diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
index a7cf672457cd..94819e6c23e2 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
@@ -1248,11 +1248,8 @@  static int rkisp1_g_fmt_vid_cap_mplane(struct file *file, void *fh,
 static int
 rkisp1_querycap(struct file *file, void *priv, struct v4l2_capability *cap)
 {
-	struct rkisp1_capture *cap_dev = video_drvdata(file);
-	struct rkisp1_device *rkisp1 = cap_dev->rkisp1;
-
-	strscpy(cap->driver, rkisp1->dev->driver->name, sizeof(cap->driver));
-	strscpy(cap->card, rkisp1->dev->driver->name, sizeof(cap->card));
+	strscpy(cap->driver, RKISP1_DRIVER_NAME, sizeof(cap->driver));
+	strscpy(cap->card, RKISP1_DRIVER_NAME, sizeof(cap->card));
 	strscpy(cap->bus_info, RKISP1_BUS_INFO, sizeof(cap->bus_info));
 
 	return 0;