* [PATCH linux dev-5.15] leds: pca955x: Fix i2c_smbus_read_i2c_block_data return code check
@ 2022-09-29 19:18 Eddie James
2022-09-29 20:32 ` Patrick Williams
0 siblings, 1 reply; 3+ messages in thread
From: Eddie James @ 2022-09-29 19:18 UTC (permalink / raw)
To: openbmc; +Cc: Eddie James, joel
The function returns either a negative errno or the number of bytes
successfully read. So, only return for a negative return code.
Fixes: c9fb275212da ("leds: pca955x: Add HW blink support")
Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
drivers/leds/leds-pca955x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c
index cf0a9fe20086..cba9876b1187 100644
--- a/drivers/leds/leds-pca955x.c
+++ b/drivers/leds/leds-pca955x.c
@@ -689,7 +689,7 @@ static int pca955x_probe(struct i2c_client *client)
err = i2c_smbus_read_i2c_block_data(client,
0x10 | (pca955x_num_input_regs(chip->bits) + 4), nls,
ls1);
- if (err)
+ if (err < 0)
return err;
for (i = 0; i < nls; ++i)
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH linux dev-5.15] leds: pca955x: Fix i2c_smbus_read_i2c_block_data return code check
2022-09-29 19:18 [PATCH linux dev-5.15] leds: pca955x: Fix i2c_smbus_read_i2c_block_data return code check Eddie James
@ 2022-09-29 20:32 ` Patrick Williams
2022-09-29 20:36 ` Eddie James
0 siblings, 1 reply; 3+ messages in thread
From: Patrick Williams @ 2022-09-29 20:32 UTC (permalink / raw)
To: Eddie James; +Cc: openbmc, joel
[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]
On Thu, Sep 29, 2022 at 02:18:48PM -0500, Eddie James wrote:
> The function returns either a negative errno or the number of bytes
> successfully read. So, only return for a negative return code.
>
> Fixes: c9fb275212da ("leds: pca955x: Add HW blink support")
> Signed-off-by: Eddie James <eajames@linux.ibm.com>
> ---
> drivers/leds/leds-pca955x.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c
> index cf0a9fe20086..cba9876b1187 100644
> --- a/drivers/leds/leds-pca955x.c
> +++ b/drivers/leds/leds-pca955x.c
> @@ -689,7 +689,7 @@ static int pca955x_probe(struct i2c_client *client)
> err = i2c_smbus_read_i2c_block_data(client,
> 0x10 | (pca955x_num_input_regs(chip->bits) + 4), nls,
> ls1);
> - if (err)
> + if (err < 0)
> return err;
>
> for (i = 0; i < nls; ++i)
> --
> 2.31.1
>
I think Potin sent this same patch 2 days ago:
https://lore.kernel.org/openbmc/20220928085701.1822967-1-potin.lai.pt@gmail.com/
Would you mind sending a Reviewed-By / Tested-By for his patch?
--
Patrick Williams
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH linux dev-5.15] leds: pca955x: Fix i2c_smbus_read_i2c_block_data return code check
2022-09-29 20:32 ` Patrick Williams
@ 2022-09-29 20:36 ` Eddie James
0 siblings, 0 replies; 3+ messages in thread
From: Eddie James @ 2022-09-29 20:36 UTC (permalink / raw)
To: Patrick Williams; +Cc: openbmc, joel
On 9/29/22 15:32, Patrick Williams wrote:
> On Thu, Sep 29, 2022 at 02:18:48PM -0500, Eddie James wrote:
>> The function returns either a negative errno or the number of bytes
>> successfully read. So, only return for a negative return code.
>>
>> Fixes: c9fb275212da ("leds: pca955x: Add HW blink support")
>> Signed-off-by: Eddie James <eajames@linux.ibm.com>
>> ---
>> drivers/leds/leds-pca955x.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c
>> index cf0a9fe20086..cba9876b1187 100644
>> --- a/drivers/leds/leds-pca955x.c
>> +++ b/drivers/leds/leds-pca955x.c
>> @@ -689,7 +689,7 @@ static int pca955x_probe(struct i2c_client *client)
>> err = i2c_smbus_read_i2c_block_data(client,
>> 0x10 | (pca955x_num_input_regs(chip->bits) + 4), nls,
>> ls1);
>> - if (err)
>> + if (err < 0)
>> return err;
>>
>> for (i = 0; i < nls; ++i)
>> --
>> 2.31.1
>>
> I think Potin sent this same patch 2 days ago:
> https://lore.kernel.org/openbmc/20220928085701.1822967-1-potin.lai.pt@gmail.com/
>
> Would you mind sending a Reviewed-By / Tested-By for his patch?
Ah, thanks. Missed that. Will do.
Eddie
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-29 20:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29 19:18 [PATCH linux dev-5.15] leds: pca955x: Fix i2c_smbus_read_i2c_block_data return code check Eddie James
2022-09-29 20:32 ` Patrick Williams
2022-09-29 20:36 ` Eddie James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).