driver/base/soc: Use kobj_to_dev() API

Use kobj_to_dev() API instead of container_of().

Signed-off-by: zhouchuangao <zhouchuangao@xiaomi.com>
Link: https://lore.kernel.org/r/1587878031-16591-1-git-send-email-zhouchuangao@xiaomi.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
zhouchuangao 2020-04-26 13:13:51 +08:00 committed by Greg Kroah-Hartman
parent 96fa72ffb2
commit baf1d9c182

View File

@ -46,7 +46,7 @@ static umode_t soc_attribute_mode(struct kobject *kobj,
struct attribute *attr, struct attribute *attr,
int index) int index)
{ {
struct device *dev = container_of(kobj, struct device, kobj); struct device *dev = kobj_to_dev(kobj);
struct soc_device *soc_dev = container_of(dev, struct soc_device, dev); struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
if ((attr == &dev_attr_machine.attr) if ((attr == &dev_attr_machine.attr)