[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1347030905-17722-1-git-send-email-anilkumar@ti.com>
Date: Fri, 7 Sep 2012 20:45:05 +0530
From: AnilKumar Ch <anilkumar@...com>
To: <broonie@...nsource.wolfsonmicro.com>,
<linux-kernel@...r.kernel.org>
CC: <axel.lin@...il.com>, <lrg@...com>, AnilKumar Ch <anilkumar@...com>
Subject: [PATCH] regulator: core: fix rdev->regmap NULL pointer
Fixes rdev->regmap NULL pointer if regmap for regulator device
is NULL. If it is NULL then get regmap for regulator device
from its parent (MFD).
Signed-off-by: AnilKumar Ch <anilkumar@...com>
---
drivers/regulator/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 4838531..7d85402 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3189,8 +3189,10 @@ regulator_register(const struct regulator_desc *regulator_desc,
rdev->desc = regulator_desc;
if (config->regmap)
rdev->regmap = config->regmap;
- else
+ else if (dev_get_regmap(dev, NULL))
rdev->regmap = dev_get_regmap(dev, NULL);
+ else if (dev->parent)
+ rdev->regmap = dev_get_regmap(dev->parent, NULL);
INIT_LIST_HEAD(&rdev->consumer_list);
INIT_LIST_HEAD(&rdev->list);
BLOCKING_INIT_NOTIFIER_HEAD(&rdev->notifier);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists