[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1587878031-16591-1-git-send-email-zhouchuangao@xiaomi.com>
Date: Sun, 26 Apr 2020 13:13:51 +0800
From: zhouchuangao <chuangaozhou@...il.com>
To: gregkh@...uxfoundation.org
Cc: rafael@...nel.org, linux-kernel@...r.kernel.org,
zhouchuangao <zhouchuangao@...omi.com>
Subject: [PATCH] driver/base/soc: Use kobj_to_dev() API
Use kobj_to_dev() API instead of container_of().
Signed-off-by: zhouchuangao <zhouchuangao@...omi.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
Powered by blists - more mailing lists