Skip to content

Commit

Permalink
Merge pull request torvalds#240 from eajames/1060-dev-6.5+i2c
Browse files Browse the repository at this point in the history
Fix for 594063 and Everest warnings
  • Loading branch information
rfrandse authored and GitHub Enterprise committed Feb 6, 2024
2 parents 1122d06 + e36f358 commit 2d1d308
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions drivers/i2c/muxes/i2c-mux-pca954x.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ static void pca954x_remove(struct i2c_client *client)
{
struct i2c_mux_core *muxc = i2c_get_clientdata(client);

device_remove_file(&client->dev, &dev_attr_hold_idle);
device_remove_file(&client->dev, &dev_attr_idle_state);

pca954x_cleanup(muxc);
Expand Down
17 changes: 12 additions & 5 deletions drivers/leds/leds-pca955x.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ static int pca955x_probe(struct i2c_client *client)
u8 ls1[4];
u8 ls2[4];
struct pca955x_platform_data *pdata;
u8 ls;
u8 psc0;
bool keep_psc0 = false;
bool set_default_label = false;
Expand Down Expand Up @@ -678,12 +679,18 @@ static int pca955x_probe(struct i2c_client *client)
init_data.devicename = "pca955x";

nls = pca955x_num_led_regs(chip->bits);
ls = pca955x_num_input_regs(chip->bits) + 4;
/* use auto-increment feature to read all the led selectors at once */
err = i2c_smbus_read_i2c_block_data(client,
0x10 | (pca955x_num_input_regs(chip->bits) + 4), nls,
ls1);
if (err < 0)
return err;
err = i2c_smbus_read_i2c_block_data(client, 0x10 | ls, nls, ls1);
if (err < 0) {
/* sometimes auto-increment feature times out, so retry */
for (i = 0; i < nls; ++i) {
err = i2c_smbus_read_byte_data(client, ls + i);
if (err < 0)
return err;
ls1[i] = err;
}
}

for (i = 0; i < nls; ++i)
ls2[i] = ls1[i];
Expand Down

0 comments on commit 2d1d308

Please sign in to comment.