rdesc->name/regulator-name is optional according to standard regulator binding doc. Use it conditionally to avoid a kernel NULL point crash.
Cc: Liam Girdwood <[email protected]> Cc: Mark Brown <[email protected]> Cc: Shawn Guo <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Robin Gong <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> --- drivers/regulator/anatop-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c index 19eb1f4..6da0b20 100644 --- a/drivers/regulator/anatop-regulator.c +++ b/drivers/regulator/anatop-regulator.c @@ -298,7 +298,7 @@ static int anatop_regulator_probe(struct platform_device *pdev) * a sane default until imx6-cpufreq was probed and changes the * voltage to the correct value. In this case we set 1.25V. */ - if (!sreg->sel && !strcmp(rdesc->name, "vddpu")) + if (!sreg->sel && rdesc->name && !strcmp(rdesc->name, "vddpu")) sreg->sel = 22; if (!sreg->bypass && !sreg->sel) { -- 2.7.4

