Skip to content

Commit 756b7b8

Browse files
author
Wolfram Sang
committed
Merge tag 'at24-updates-for-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-mergewindow
at24 updates for v7.0-rc1 - add a set of new compatibles to DT bindings - use dev_err_probe() consistently in the driver
2 parents 71ebc45 + de28498 commit 756b7b8

2 files changed

Lines changed: 11 additions & 13 deletions

File tree

Documentation/devicetree/bindings/eeprom/at24.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ properties:
116116
- const: atmel,24c02
117117
- items:
118118
- enum:
119+
- belling,bl24c04a
119120
- giantec,gt24c04a
120121
- onnn,cat24c04
121122
- onnn,cat24c05
@@ -124,6 +125,7 @@ properties:
124125
- items:
125126
- enum:
126127
- belling,bl24c16a
128+
- belling,bl24c16f
127129
- renesas,r1ex24016
128130
- const: atmel,24c16
129131
- items:
@@ -132,13 +134,15 @@ properties:
132134
- items:
133135
- enum:
134136
- belling,bl24s64
137+
- giantec,gt24p64a
135138
- onnn,n24s64b
136139
- puya,p24c64f
137140
- const: atmel,24c64
138141
- items:
139142
- enum:
140143
- giantec,gt24p128e
141144
- giantec,gt24p128f
145+
- puya,p24c128f
142146
- renesas,r1ex24128
143147
- samsung,s524ad0xd1
144148
- const: atmel,24c128

drivers/misc/eeprom/at24.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,8 @@ static int at24_probe(struct i2c_client *client)
657657
if (!i2c_fn_i2c && !i2c_fn_block)
658658
page_size = 1;
659659

660-
if (!page_size) {
661-
dev_err(dev, "page_size must not be 0!\n");
662-
return -EINVAL;
663-
}
660+
if (!page_size)
661+
return dev_err_probe(dev, -EINVAL, "page_size must not be 0!\n");
664662

665663
if (!is_power_of_2(page_size))
666664
dev_warn(dev, "page_size looks suspicious (no power of 2)!\n");
@@ -674,11 +672,9 @@ static int at24_probe(struct i2c_client *client)
674672
(flags & AT24_FLAG_ADDR16) ? 65536 : 256);
675673
}
676674

677-
if ((flags & AT24_FLAG_SERIAL) && (flags & AT24_FLAG_MAC)) {
678-
dev_err(dev,
679-
"invalid device data - cannot have both AT24_FLAG_SERIAL & AT24_FLAG_MAC.");
680-
return -EINVAL;
681-
}
675+
if ((flags & AT24_FLAG_SERIAL) && (flags & AT24_FLAG_MAC))
676+
return dev_err_probe(dev, -EINVAL,
677+
"invalid device data - cannot have both AT24_FLAG_SERIAL & AT24_FLAG_MAC.");
682678

683679
regmap_config.val_bits = 8;
684680
regmap_config.reg_bits = (flags & AT24_FLAG_ADDR16) ? 16 : 8;
@@ -759,10 +755,8 @@ static int at24_probe(struct i2c_client *client)
759755
full_power = acpi_dev_state_d0(&client->dev);
760756
if (full_power) {
761757
err = regulator_enable(at24->vcc_reg);
762-
if (err) {
763-
dev_err(dev, "Failed to enable vcc regulator\n");
764-
return err;
765-
}
758+
if (err)
759+
return dev_err_probe(dev, err, "Failed to enable vcc regulator\n");
766760

767761
pm_runtime_set_active(dev);
768762
}

0 commit comments

Comments
 (0)