leds: pca955x: Fix i2c_smbus_read_i2c_block_data return code check
PATCH 1/1 leds: pca955x: Fix i2c_smbus_read_i2c_block_data return code check
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 <[email protected]>
--- drivers/leds/leds-pca955x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-pca955x.c +1 -1
@@ -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)
Signature · 1 line
2.31.1
Quoted 25 lines · Eddie James
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 <[email protected]>--- drivers/leds/leds-pca955x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/leds/leds-pca955x.c +1
-1@@ -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)Signature · 1 line
2.31.1
I think Potin sent this same patch 2 days ago:
https://lore.kernel.org/openbmc/[email protected]/
Would you mind sending a Reviewed-By / Tested-By for his patch?
Signature · 1 line
Patrick Williams
Quoted 22 lines · Patrick Williams
Quoted 21 lines · Eddie James
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 <[email protected]>--- drivers/leds/leds-pca955x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/leds/leds-pca955x.c +1
-1@@ -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;
Quoted 8 lines
Quoted 4 lines
drivers/leds/leds-pca955x.c +0
-0for (i =0 ; i < nls; ++i)Signature · 1 line
2.31.1I think Potin sent this same patch 2 days ago:
https://lore.kernel.org/openbmc/[email protected]/Would you mind sending a Reviewed-By / Tested-By for his patch?
Ah, thanks. Missed that. Will do.
Eddie