Skip to content

Commit 5d12ed4

Browse files
committed
Merge tag 'i2c-for-6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "Fix a race condition in the at24 eeprom handler, a NULL pointer exception in the I2C core for controllers only using target modes, drop a MAINTAINERS entry, and fix an incorrect DT binding for at24" * tag 'i2c-for-6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: smbus: fix NULL function pointer dereference MAINTAINERS: Drop entry for PCA9541 bus master selector eeprom: at24: fix memory corruption race condition dt-bindings: eeprom: at24: Fix ST M24C64-D compatible schema
2 parents 2e5449f + 91811a3 commit 5d12ed4

File tree

4 files changed

+16
-25
lines changed

4 files changed

+16
-25
lines changed

Documentation/devicetree/bindings/eeprom/at24.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,10 @@ properties:
6868
pattern: cs16$
6969
- items:
7070
pattern: c32$
71-
- items:
72-
pattern: c32d-wl$
7371
- items:
7472
pattern: cs32$
7573
- items:
7674
pattern: c64$
77-
- items:
78-
pattern: c64d-wl$
7975
- items:
8076
pattern: cs64$
8177
- items:
@@ -136,6 +132,7 @@ properties:
136132
- renesas,r1ex24128
137133
- samsung,s524ad0xd1
138134
- const: atmel,24c128
135+
- pattern: '^atmel,24c(32|64)d-wl$' # Actual vendor is st
139136

140137
label:
141138
description: Descriptive name of the EEPROM.

MAINTAINERS

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16798,12 +16798,6 @@ S: Maintained
1679816798
F: drivers/leds/leds-pca9532.c
1679916799
F: include/linux/leds-pca9532.h
1680016800

16801-
PCA9541 I2C BUS MASTER SELECTOR DRIVER
16802-
M: Guenter Roeck <[email protected]>
16803-
16804-
S: Maintained
16805-
F: drivers/i2c/muxes/i2c-mux-pca9541.c
16806-
1680716801
PCI DRIVER FOR AARDVARK (Marvell Armada 3700)
1680816802
M: Thomas Petazzoni <[email protected]>
1680916803
M: Pali Rohár <[email protected]>

drivers/i2c/i2c-core-base.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,13 +2200,18 @@ static int i2c_check_for_quirks(struct i2c_adapter *adap, struct i2c_msg *msgs,
22002200
* Returns negative errno, else the number of messages executed.
22012201
*
22022202
* Adapter lock must be held when calling this function. No debug logging
2203-
* takes place. adap->algo->master_xfer existence isn't checked.
2203+
* takes place.
22042204
*/
22052205
int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
22062206
{
22072207
unsigned long orig_jiffies;
22082208
int ret, try;
22092209

2210+
if (!adap->algo->master_xfer) {
2211+
dev_dbg(&adap->dev, "I2C level transfers not supported\n");
2212+
return -EOPNOTSUPP;
2213+
}
2214+
22102215
if (WARN_ON(!msgs || num < 1))
22112216
return -EINVAL;
22122217

@@ -2273,11 +2278,6 @@ int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
22732278
{
22742279
int ret;
22752280

2276-
if (!adap->algo->master_xfer) {
2277-
dev_dbg(&adap->dev, "I2C level transfers not supported\n");
2278-
return -EOPNOTSUPP;
2279-
}
2280-
22812281
/* REVISIT the fault reporting model here is weak:
22822282
*
22832283
* - When we get an error after receiving N bytes from a slave,

drivers/misc/eeprom/at24.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -758,15 +758,6 @@ static int at24_probe(struct i2c_client *client)
758758
}
759759
pm_runtime_enable(dev);
760760

761-
at24->nvmem = devm_nvmem_register(dev, &nvmem_config);
762-
if (IS_ERR(at24->nvmem)) {
763-
pm_runtime_disable(dev);
764-
if (!pm_runtime_status_suspended(dev))
765-
regulator_disable(at24->vcc_reg);
766-
return dev_err_probe(dev, PTR_ERR(at24->nvmem),
767-
"failed to register nvmem\n");
768-
}
769-
770761
/*
771762
* Perform a one-byte test read to verify that the chip is functional,
772763
* unless powering on the device is to be avoided during probe (i.e.
@@ -782,6 +773,15 @@ static int at24_probe(struct i2c_client *client)
782773
}
783774
}
784775

776+
at24->nvmem = devm_nvmem_register(dev, &nvmem_config);
777+
if (IS_ERR(at24->nvmem)) {
778+
pm_runtime_disable(dev);
779+
if (!pm_runtime_status_suspended(dev))
780+
regulator_disable(at24->vcc_reg);
781+
return dev_err_probe(dev, PTR_ERR(at24->nvmem),
782+
"failed to register nvmem\n");
783+
}
784+
785785
/* If this a SPD EEPROM, probe for DDR3 thermal sensor */
786786
if (cdata == &at24_data_spd)
787787
at24_probe_temp_sensor(client);

0 commit comments

Comments
 (0)