[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1491962327-12477-5-git-send-email-aisheng.dong@nxp.com>
Date: Wed, 12 Apr 2017 09:58:46 +0800
From: Dong Aisheng <aisheng.dong@....com>
To: <linux-kernel@...r.kernel.org>
CC: <shawnguo@...nel.org>, <linux-arm-kernel@...ts.infradead.org>,
<aisheng.dong@....com>, <kernel@...gutronix.de>,
<lgirdwood@...il.com>, <broonie@...nel.org>, <yibin.gong@....com>
Subject: [PATCH 5/6] regulator: anatop-regulator: make regulator-name using optionally
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 <lgirdwood@...il.com>
Cc: Mark Brown <broonie@...nel.org>
Cc: Shawn Guo <shawnguo@...nel.org>
Cc: Sascha Hauer <kernel@...gutronix.de>
Cc: Robin Gong <yibin.gong@....com>
Signed-off-by: Dong Aisheng <aisheng.dong@....com>
---
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
Powered by blists - more mailing lists