From: Geliang Tang Date: Tue, 5 Jan 2016 14:07:55 +0000 (+0800) Subject: UPSTREAM: regulator: core: use dev_to_rdev X-Git-Tag: firefly_0821_release~488 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=363217784acf30e67f8c0731ed9d9d268ab489f3;p=firefly-linux-kernel-4.4.55.git UPSTREAM: regulator: core: use dev_to_rdev Use dev_to_rdev() instead of open-coding it. Signed-off-by: Geliang Tang Signed-off-by: Mark Brown (cherry picked from commit 83080a140874b6860b5191b375cfdad267eaa107) Change-Id: I63e284044a4681bdaa053191e8f77017430135de Signed-off-by: David Wu --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 3daefdf38524..1374cc2ce8c2 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;