diff mbox series

drm: gm12u320: Fix the timeout usage for usb_bulk_msg()

Message ID 20230903085547.1577439-1-ruanjinjie@huawei.com (mailing list archive)
State New, archived
Headers show
Series drm: gm12u320: Fix the timeout usage for usb_bulk_msg() | expand

Commit Message

Jinjie Ruan Sept. 3, 2023, 8:55 a.m. UTC
The timeout arg of usb_bulk_msg() is ms already and it has convert it
to jiffies by msecs_to_jiffies() in usb_start_wait_urb(). So fix the usage
by remove the redundant msecs_to_jiffies() in the macros.

Fixes: 77b8cabf3d52 ("drm/gm12u320: Move driver to drm/tiny")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/gpu/drm/tiny/gm12u320.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Hans de Goede Sept. 3, 2023, 12:13 p.m. UTC | #1
Hi Jinjie,

On 9/3/23 10:55, Jinjie Ruan wrote:
> The timeout arg of usb_bulk_msg() is ms already and it has convert it
> to jiffies by msecs_to_jiffies() in usb_start_wait_urb(). So fix the usage
> by remove the redundant msecs_to_jiffies() in the macros.
> 
> Fixes: 77b8cabf3d52 ("drm/gm12u320: Move driver to drm/tiny")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>

Good catch, thank you.

> ---
>  drivers/gpu/drm/tiny/gm12u320.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c
> index c5bb683e440c..31fa50c665d1 100644
> --- a/drivers/gpu/drm/tiny/gm12u320.c
> +++ b/drivers/gpu/drm/tiny/gm12u320.c
> @@ -70,10 +70,10 @@ MODULE_PARM_DESC(eco_mode, "Turn on Eco mode (less bright, more silent)");
>  #define READ_STATUS_SIZE		13
>  #define MISC_VALUE_SIZE			4
>  
> -#define CMD_TIMEOUT			msecs_to_jiffies(200)
> -#define DATA_TIMEOUT			msecs_to_jiffies(1000)
> +#define CMD_TIMEOUT			200
> +#define DATA_TIMEOUT			1000
>  #define IDLE_TIMEOUT			msecs_to_jiffies(2000)
> -#define FIRST_FRAME_TIMEOUT		msecs_to_jiffies(2000)
> +#define FIRST_FRAME_TIMEOUT		2000

Lets be consistent here and change all *_TIMEOUT defines to
be in milliseconds.

And then in the 1 place where IDLE_TIMEOUT is used, change
"IDLE_TIMEOUT" to "msecs_to_jiffies(IDLE_TIMEOUT)"

REgards,

Hans





>  
>  #define MISC_REQ_GET_SET_ECO_A		0xff
>  #define MISC_REQ_GET_SET_ECO_B		0x35
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c
index c5bb683e440c..31fa50c665d1 100644
--- a/drivers/gpu/drm/tiny/gm12u320.c
+++ b/drivers/gpu/drm/tiny/gm12u320.c
@@ -70,10 +70,10 @@  MODULE_PARM_DESC(eco_mode, "Turn on Eco mode (less bright, more silent)");
 #define READ_STATUS_SIZE		13
 #define MISC_VALUE_SIZE			4
 
-#define CMD_TIMEOUT			msecs_to_jiffies(200)
-#define DATA_TIMEOUT			msecs_to_jiffies(1000)
+#define CMD_TIMEOUT			200
+#define DATA_TIMEOUT			1000
 #define IDLE_TIMEOUT			msecs_to_jiffies(2000)
-#define FIRST_FRAME_TIMEOUT		msecs_to_jiffies(2000)
+#define FIRST_FRAME_TIMEOUT		2000
 
 #define MISC_REQ_GET_SET_ECO_A		0xff
 #define MISC_REQ_GET_SET_ECO_B		0x35