Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d824c7a8 authored by Leonard Crestez's avatar Leonard Crestez Committed by Mark Brown
Browse files

regulator: rn5t618: Do not index regulator_desc arrays by id



The regulator_desc arrays in this driver are indexed by RN5T618_*
constants and some elements can be missing. This causes probe failures
on older models:

rn5t618-regulator rn5t618-regulator: failed to register (null) regulator
rn5t618-regulator: probe of rn5t618-regulator failed with error -22

Fix this by making the arrays flat. This also saves a little memory
because the regulator_desc arrays become smaller.

Signed-off-by: default avatarLeonard Crestez <leonard.crestez@nxp.com>
Fixes: 83b2a3c2 ("regulator: rn5t618: add RC5T619 PMIC support")
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2bd6bf03
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@ static const struct regulator_ops rn5t618_reg_ops = {
};
};


#define REG(rid, ereg, emask, vreg, vmask, min, max, step)		\
#define REG(rid, ereg, emask, vreg, vmask, min, max, step)		\
	[RN5T618_##rid] = {						\
	{								\
		.name		= #rid,					\
		.name		= #rid,					\
		.of_match	= of_match_ptr(#rid),			\
		.of_match	= of_match_ptr(#rid),			\
		.regulators_node = of_match_ptr("regulators"),		\
		.regulators_node = of_match_ptr("regulators"),		\