From: Dan Carpenter <dan.carpenter@linaro.org>
To: Soham Kute <officialsohamkute@gmail.com>
Cc: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com,
gregkh@linuxfoundation.org, linux-fbdev@vger.kernel.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/6] staging: sm750fb: sw_i2c_write_byte: return -ETIMEDOUT on timeout
Date: Wed, 4 Mar 2026 17:29:54 +0300 [thread overview]
Message-ID: <aahB4trbBPTc9B97@stanley.mountain> (raw)
In-Reply-To: <20260304084545.156170-6-officialsohamkute@gmail.com>
On Wed, Mar 04, 2026 at 02:15:44PM +0530, Soham Kute wrote:
> Return -ETIMEDOUT instead of -1 when the I2C byte write times out.
> The callers check for non-zero return value and treat it as failure.
>
"The callers either ignore errors or treat all non-zero returns as
failure and return -1."
> Signed-off-by: Soham Kute <officialsohamkute@gmail.com>
> ---
> drivers/staging/sm750fb/ddk750_swi2c.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c
> index 0ef8d4ff2ef9..a17f758dda6c 100644
> --- a/drivers/staging/sm750fb/ddk750_swi2c.c
> +++ b/drivers/staging/sm750fb/ddk750_swi2c.c
> @@ -294,7 +294,7 @@ static long sw_i2c_write_byte(unsigned char data)
Need to update the comments at the start of the function as well.
234 /*
235 * This function writes one byte to the slave device
236 *
237 * Parameters:
238 * data - Data to be write to the slave device
239 *
240 * Return Value:
241 * 0 - Success
242 * -1 - Fail to write byte
^^^^^^^^^^^^^^^^^^^^^^^^^
243 */
244 static long sw_i2c_write_byte(unsigned char data)
> if (i < 0xff)
> return 0;
> else
> - return -1;
> + return -ETIMEDOUT;
I don't think -ETIMEDOUT is the correct error code. Maybe -EIO or
-EINVAL.
regards,
dan carpenter
next prev parent reply other threads:[~2026-03-04 14:29 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-01 5:14 [PATCH] staging: sm750fb: use proper error codes instead of -1 Soham Kute
2026-03-02 9:09 ` Dan Carpenter
2026-03-04 8:45 ` [PATCH v2 0/6] staging: sm750fb: fix error return values Soham Kute
2026-03-04 8:45 ` [PATCH 1/6] staging: sm750fb: hw_sm750le_de_wait: return -ETIMEDOUT on timeout Soham Kute
2026-03-04 8:45 ` [PATCH 2/6] staging: sm750fb: sm750_hw_fillrect: propagate de_wait() error Soham Kute
2026-03-04 8:45 ` [PATCH 3/6] staging: sm750fb: sm750_hw_copyarea: " Soham Kute
2026-03-04 14:24 ` Dan Carpenter
2026-03-04 8:45 ` [PATCH 4/6] staging: sm750fb: sm750_hw_imageblit: " Soham Kute
2026-03-04 14:25 ` Dan Carpenter
2026-03-04 8:45 ` [PATCH 5/6] staging: sm750fb: sw_i2c_write_byte: return -ETIMEDOUT on timeout Soham Kute
2026-03-04 14:29 ` Dan Carpenter [this message]
2026-03-04 8:45 ` [PATCH 6/6] staging: sm750fb: sm750_sw_i2c_init: return -EINVAL for invalid GPIO Soham Kute
2026-03-04 14:30 ` Dan Carpenter
2026-03-04 17:35 ` [PATCH 1/6] staging: sm750fb: hw_sm750le_de_wait: return -ETIMEDOUT on timeout Soham Kute
2026-03-04 17:35 ` [PATCH 2/6] staging: sm750fb: sm750_hw_fillrect: propagate de_wait() error Soham Kute
2026-03-05 5:34 ` Dan Carpenter
2026-03-04 17:35 ` [PATCH 3/6] staging: sm750fb: sm750_hw_copyarea: " Soham Kute
2026-03-04 17:35 ` [PATCH 4/6] staging: sm750fb: sm750_hw_imageblit: " Soham Kute
2026-03-04 17:35 ` [PATCH 5/6] staging: sm750fb: sw_i2c_write_byte: return -EIO on failure Soham Kute
2026-03-04 17:35 ` [PATCH 6/6] staging: sm750fb: sm750_sw_i2c_init: return -EINVAL for invalid GPIO Soham Kute
2026-03-05 5:48 ` Dan Carpenter
2026-03-05 5:33 ` [PATCH 1/6] staging: sm750fb: hw_sm750le_de_wait: return -ETIMEDOUT on timeout Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aahB4trbBPTc9B97@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=officialsohamkute@gmail.com \
--cc=sudipm.mukherjee@gmail.com \
--cc=teddy.wang@siliconmotion.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox