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>
(cherry picked from commit
83080a140874b6860b5191b375cfdad267eaa107)
Change-Id: I63e284044a4681bdaa053191e8f77017430135de
Signed-off-by: David Wu <david.wu@rock-chips.com>
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;