summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorRobin Gong <yibin.gong@nxp.com>2016-10-12 14:53:28 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit1b217bc5b89627cf5ad80554e8c1c1e0613281d3 (patch)
tree960b04a83ea13e4781b9ff1743afb38b3e39ae4c /drivers/regulator
parent748263ac1048082ae58e8898a864d954426b1d5e (diff)
MLK-12928-16 regulator: pf1550: check device node check
Do not probe if the device node is not correct in dts. Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/pf1550.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/regulator/pf1550.c b/drivers/regulator/pf1550.c
index c7e8bfb861a1..f6837052859b 100644
--- a/drivers/regulator/pf1550.c
+++ b/drivers/regulator/pf1550.c
@@ -287,10 +287,14 @@ static irqreturn_t pf1550_regulator_irq_handler(int irq, void *data)
static int pf1550_regulator_probe(struct platform_device *pdev)
{
struct pf1550_dev *iodev = dev_get_drvdata(pdev->dev.parent);
+ struct device_node *np = pdev->dev.of_node;
struct pf1550_regulator_info *info;
int i, ret = 0;
struct regulator_config config = { };
+ if (!np)
+ return -ENODEV;
+
info = devm_kzalloc(&pdev->dev, sizeof(struct pf1550_regulator_info),
GFP_KERNEL);
if (!info)