Skip to content

Commit 2d1d308

Browse files
rfrandseGitHub Enterprise
authored andcommitted
Merge pull request torvalds#240 from eajames/1060-dev-6.5+i2c
Fix for 594063 and Everest warnings
2 parents 1122d06 + e36f358 commit 2d1d308

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

drivers/i2c/muxes/i2c-mux-pca954x.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ static void pca954x_remove(struct i2c_client *client)
567567
{
568568
struct i2c_mux_core *muxc = i2c_get_clientdata(client);
569569

570+
device_remove_file(&client->dev, &dev_attr_hold_idle);
570571
device_remove_file(&client->dev, &dev_attr_idle_state);
571572

572573
pca954x_cleanup(muxc);

drivers/leds/leds-pca955x.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ static int pca955x_probe(struct i2c_client *client)
602602
u8 ls1[4];
603603
u8 ls2[4];
604604
struct pca955x_platform_data *pdata;
605+
u8 ls;
605606
u8 psc0;
606607
bool keep_psc0 = false;
607608
bool set_default_label = false;
@@ -678,12 +679,18 @@ static int pca955x_probe(struct i2c_client *client)
678679
init_data.devicename = "pca955x";
679680

680681
nls = pca955x_num_led_regs(chip->bits);
682+
ls = pca955x_num_input_regs(chip->bits) + 4;
681683
/* use auto-increment feature to read all the led selectors at once */
682-
err = i2c_smbus_read_i2c_block_data(client,
683-
0x10 | (pca955x_num_input_regs(chip->bits) + 4), nls,
684-
ls1);
685-
if (err < 0)
686-
return err;
684+
err = i2c_smbus_read_i2c_block_data(client, 0x10 | ls, nls, ls1);
685+
if (err < 0) {
686+
/* sometimes auto-increment feature times out, so retry */
687+
for (i = 0; i < nls; ++i) {
688+
err = i2c_smbus_read_byte_data(client, ls + i);
689+
if (err < 0)
690+
return err;
691+
ls1[i] = err;
692+
}
693+
}
687694

688695
for (i = 0; i < nls; ++i)
689696
ls2[i] = ls1[i];

0 commit comments

Comments
 (0)