From: Geliang Tang <geliangtang@163.com>
Date: Tue, 5 Jan 2016 14:07:55 +0000 (+0800)
Subject: regulator: core: use dev_to_rdev
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=83080a140874b6860b5191b375cfdad267eaa107;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git

regulator: core: use dev_to_rdev

Use dev_to_rdev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 73b7683355cd..0853a80bf7fe 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3708,7 +3708,7 @@ static umode_t regulator_attr_is_visible(struct kobject *kobj,
 					 struct attribute *attr, int idx)
 {
 	struct device *dev = kobj_to_dev(kobj);
-	struct regulator_dev *rdev = container_of(dev, struct regulator_dev, dev);
+	struct regulator_dev *rdev = dev_to_rdev(dev);
 	const struct regulator_ops *ops = rdev->desc->ops;
 	umode_t mode = attr->mode;