Skip to content

Commit 21b3fb7

Browse files
MrVanbroonie
authored andcommitted
regulator: pca9450: Correct probed name for PCA9452
An incorrect device name was logged for PCA9452 because the dev_info() ternary omitted PCA9452 and fell through to "pca9450bc". Introduce a type_name and set it per device type so the probed message matches the actual PMIC. While here, make the PCA9451A case explicit. No functional changes. Fixes: 017b76f ("regulator: pca9450: Add PMIC pca9452 support") Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://patch.msgid.link/20260310-pca9450-irq-v1-2-36adf52c2c55@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 5d0efaf commit 21b3fb7

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

drivers/regulator/pca9450-regulator.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,7 @@ static int pca9450_i2c_probe(struct i2c_client *i2c)
12931293
struct regulator_dev *ldo5;
12941294
struct pca9450 *pca9450;
12951295
unsigned int device_id, i;
1296+
const char *type_name;
12961297
int ret;
12971298

12981299
pca9450 = devm_kzalloc(&i2c->dev, sizeof(struct pca9450), GFP_KERNEL);
@@ -1303,15 +1304,22 @@ static int pca9450_i2c_probe(struct i2c_client *i2c)
13031304
case PCA9450_TYPE_PCA9450A:
13041305
regulator_desc = pca9450a_regulators;
13051306
pca9450->rcnt = ARRAY_SIZE(pca9450a_regulators);
1307+
type_name = "pca9450a";
13061308
break;
13071309
case PCA9450_TYPE_PCA9450BC:
13081310
regulator_desc = pca9450bc_regulators;
13091311
pca9450->rcnt = ARRAY_SIZE(pca9450bc_regulators);
1312+
type_name = "pca9450bc";
13101313
break;
13111314
case PCA9450_TYPE_PCA9451A:
1315+
regulator_desc = pca9451a_regulators;
1316+
pca9450->rcnt = ARRAY_SIZE(pca9451a_regulators);
1317+
type_name = "pca9451a";
1318+
break;
13121319
case PCA9450_TYPE_PCA9452:
13131320
regulator_desc = pca9451a_regulators;
13141321
pca9450->rcnt = ARRAY_SIZE(pca9451a_regulators);
1322+
type_name = "pca9452";
13151323
break;
13161324
default:
13171325
dev_err(&i2c->dev, "Unknown device type");
@@ -1413,9 +1421,7 @@ static int pca9450_i2c_probe(struct i2c_client *i2c)
14131421
pca9450_i2c_restart_handler, pca9450))
14141422
dev_warn(&i2c->dev, "Failed to register restart handler\n");
14151423

1416-
dev_info(&i2c->dev, "%s probed.\n",
1417-
type == PCA9450_TYPE_PCA9450A ? "pca9450a" :
1418-
(type == PCA9450_TYPE_PCA9451A ? "pca9451a" : "pca9450bc"));
1424+
dev_info(&i2c->dev, "%s probed.\n", type_name);
14191425

14201426
return 0;
14211427
}

0 commit comments

Comments
 (0)