Messages in this thread Patch in this message | | | From | zhouchuangao <> | Subject | [PATCH] driver/base/soc: Use kobj_to_dev() API | Date | Sun, 26 Apr 2020 13:13:51 +0800 |
| |
Use kobj_to_dev() API instead of container_of().
Signed-off-by: zhouchuangao <zhouchuangao@xiaomi.com> --- drivers/base/soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/soc.c b/drivers/base/soc.c index 4af11a4..a5bae55 100644 --- a/drivers/base/soc.c +++ b/drivers/base/soc.c @@ -46,7 +46,7 @@ static umode_t soc_attribute_mode(struct kobject *kobj, struct attribute *attr, 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); if ((attr == &dev_attr_machine.attr) -- 2.7.4
| |