Re: [PATCH v2 1/2] staging: sm750fb: return -ETIMEDOUT on timeout in de_wait functions
From: Greg Kroah-Hartman
Date: Sun Apr 26 2026 - 23:51:31 EST
On Thu, Apr 09, 2026 at 03:58:20PM +0000, Hungyu Lin wrote:
> The hw_sm750le_de_wait() and hw_sm750_de_wait() functions return -1
> when a timeout occurs. Replace these with -ETIMEDOUT to use a proper
> errno value and better describe the error condition.
>
> All callers check the return value as non-zero, so this change does
> not alter existing behavior.
>
> Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
> ---
> drivers/staging/sm750fb/sm750_hw.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
> index a2798d428663..3809401baa3a 100644
> --- a/drivers/staging/sm750fb/sm750_hw.c
> +++ b/drivers/staging/sm750fb/sm750_hw.c
> @@ -502,7 +502,7 @@ int hw_sm750le_de_wait(void)
> return 0;
> }
> /* timeout error */
> - return -1;
> + return -ETIMEDOUT;
> }
>
> int hw_sm750_de_wait(void)
> @@ -520,7 +520,7 @@ int hw_sm750_de_wait(void)
> return 0;
> }
> /* timeout error */
> - return -1;
> + return -ETIMEDOUT;
The comment should be removed at the same time, now that the code itself
documents it properly, right?
thanks,
greg k-h