Message ID | 20250323-s2mpg10-v1-17-d08943702707@linaro.org (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Series | Samsung S2MPG10 PMIC MFD-based drivers | expand |
On 23/03/2025 23:39, André Draszik wrote: > When support for PMICs without compatibles was removed in > commit f736d2c0caa8 ("mfd: sec: Remove PMICs without compatibles"), > sec_regmap_config effectively became an orphan, because S5M8763X was > the only user left of it before removal, using the default: case of the > switch statement. > > Subsequently, the accidental new users have been updated, so > sec_regmap_config is an orphan again, and can and should be removed > from the code. Doing so will also ensure future additions to support > new devices in this driver don't forget to add a regmap config. > > Drop this fallback regmap config. > > Signed-off-by: André Draszik <andre.draszik@linaro.org> > --- Please squash it with previous patch. Logically you want to get rid of default regmap config - that's the change you are making. Your previous patch - adding regmap_configs for these variants - makes no sense on its own, because they were using the same regmap config already - the default one. Best regards, Krzysztof
diff --git a/drivers/mfd/sec-i2c.c b/drivers/mfd/sec-i2c.c index 3912baa5c2f918b7ad345e2bbbbe4daf2e49ca6d..1bdd6ea36fcd9f56ea5ec1159a87723f4c09a0bd 100644 --- a/drivers/mfd/sec-i2c.c +++ b/drivers/mfd/sec-i2c.c @@ -61,11 +61,6 @@ static bool s2mpu02_volatile(struct device *dev, unsigned int reg) } } -static const struct regmap_config sec_regmap_config = { - .reg_bits = 8, - .val_bits = 8, -}; - static const struct regmap_config s2dos05_regmap_config = { .reg_bits = 8, .val_bits = 8, @@ -196,8 +191,9 @@ static int sec_pmic_i2c_probe(struct i2c_client *client) regmap = &s5m8767_regmap_config; break; default: - regmap = &sec_regmap_config; - break; + return dev_err_probe(&client->dev, -ENODEV, + "Unsupported device type %lu\n", + device_type); } regmap_pmic = devm_regmap_init_i2c(client, regmap);
When support for PMICs without compatibles was removed in commit f736d2c0caa8 ("mfd: sec: Remove PMICs without compatibles"), sec_regmap_config effectively became an orphan, because S5M8763X was the only user left of it before removal, using the default: case of the switch statement. Subsequently, the accidental new users have been updated, so sec_regmap_config is an orphan again, and can and should be removed from the code. Doing so will also ensure future additions to support new devices in this driver don't forget to add a regmap config. Drop this fallback regmap config. Signed-off-by: André Draszik <andre.draszik@linaro.org> --- drivers/mfd/sec-i2c.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)