summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2024-10-07 01:14:05 +0100
committerLee Jones <lee@kernel.org>2024-10-31 15:51:20 +0000
commit697a4001d31a607a72c6297e4eb0f7918c6e6929 (patch)
tree4cb246bcd7cd62a88e390169abd2bb80dec10eef /drivers/regulator
parentbd91530aee6007a979e52d816779a6e10ed8c00a (diff)
downloadlinux-next-697a4001d31a607a72c6297e4eb0f7918c6e6929.tar.gz
linux-next-697a4001d31a607a72c6297e4eb0f7918c6e6929.zip
mfd: axp20x: Ensure relationship between IDs and model names
At the moment there is an implicit relationship between the AXP model IDs and the order of the strings in the axp20x_model_names[] array. This is fragile, and makes adding IDs in the middle error prone. Make this relationship official by changing the ID type to the actual enum used, and using indexed initialisers for the string list. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Link: https://lore.kernel.org/r/20241007001408.27249-3-andre.przywara@arm.com Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/axp20x-regulator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index a8e91d9d028b..3ba76dbd0fb9 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -1597,7 +1597,7 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
nregulators = AXP15060_REG_ID_MAX;
break;
default:
- dev_err(&pdev->dev, "Unsupported AXP variant: %ld\n",
+ dev_err(&pdev->dev, "Unsupported AXP variant: %d\n",
axp20x->variant);
return -EINVAL;
}