mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: core: use dev_to_rdev
@ 2016-01-05 14:07 Geliang Tang
  2016-01-05 17:49 ` Applied "regulator: core: use dev_to_rdev" to the regulator tree Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Geliang Tang @ 2016-01-05 14:07 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: Geliang Tang, linux-kernel

Use dev_to_rdev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/regulator/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 6653b1b..3308c6b 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3710,7 +3710,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;
 
-- 
2.5.0



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-05 17:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-05 14:07 [PATCH] regulator: core: use dev_to_rdev Geliang Tang
2016-01-05 17:49 ` Applied "regulator: core: use dev_to_rdev" to the regulator tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®