[PATCH] media: uvcvideo: Reorder uvc_status_init()

Ricardo Ribalda posted 1 patch 1 month ago
drivers/media/usb/uvc/uvc_status.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] media: uvcvideo: Reorder uvc_status_init()
Posted by Ricardo Ribalda 1 month ago
Only initialize the input device if the interrupt endpoint has been
properly initialized.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/usb/uvc/uvc_status.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c
index 06c867510c8f..02c90acf6964 100644
--- a/drivers/media/usb/uvc/uvc_status.c
+++ b/drivers/media/usb/uvc/uvc_status.c
@@ -262,8 +262,6 @@ int uvc_status_init(struct uvc_device *dev)
 	if (ep == NULL)
 		return 0;
 
-	uvc_input_init(dev);
-
 	dev->status = kzalloc(sizeof(*dev->status), GFP_KERNEL);
 	if (!dev->status)
 		return -ENOMEM;
@@ -289,6 +287,8 @@ int uvc_status_init(struct uvc_device *dev)
 		dev->status, sizeof(*dev->status), uvc_status_complete,
 		dev, interval);
 
+	uvc_input_init(dev);
+
 	return 0;
 }
 

---
base-commit: 698b6e3163bafd61e1b7d13572e2c42974ac85ec
change-id: 20241022-order_status-b1d985f7423c

Best regards,
-- 
Ricardo Ribalda <ribalda@chromium.org>
Re: [PATCH] media: uvcvideo: Reorder uvc_status_init()
Posted by Laurent Pinchart 2 weeks, 4 days ago
Hi Ricardo,

Thank you for the patch.

On Tue, Oct 22, 2024 at 08:37:13AM +0000, Ricardo Ribalda wrote:
> Only initialize the input device if the interrupt endpoint has been
> properly initialized.
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/usb/uvc/uvc_status.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c
> index 06c867510c8f..02c90acf6964 100644
> --- a/drivers/media/usb/uvc/uvc_status.c
> +++ b/drivers/media/usb/uvc/uvc_status.c
> @@ -262,8 +262,6 @@ int uvc_status_init(struct uvc_device *dev)
>  	if (ep == NULL)
>  		return 0;
>  
> -	uvc_input_init(dev);
> -
>  	dev->status = kzalloc(sizeof(*dev->status), GFP_KERNEL);
>  	if (!dev->status)
>  		return -ENOMEM;
> @@ -289,6 +287,8 @@ int uvc_status_init(struct uvc_device *dev)
>  		dev->status, sizeof(*dev->status), uvc_status_complete,
>  		dev, interval);
>  
> +	uvc_input_init(dev);
> +
>  	return 0;
>  }
>  
> 
> ---
> base-commit: 698b6e3163bafd61e1b7d13572e2c42974ac85ec
> change-id: 20241022-order_status-b1d985f7423c

-- 
Regards,

Laurent Pinchart