[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20201117025933.668938-1-dingxiang@cmss.chinamobile.com>
Date: Tue, 17 Nov 2020 10:59:33 +0800
From: Ding Xiang <dingxiang@...s.chinamobile.com>
To: TheSven73@...il.com
Cc: gregkh@...uxfoundation.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] staging: fieldbus: use kobj_to_dev() to get device
Use kobj_to_dev() instead of container_of()
Signed-off-by: Ding Xiang <dingxiang@...s.chinamobile.com>
---
drivers/staging/fieldbus/dev_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/fieldbus/dev_core.c b/drivers/staging/fieldbus/dev_core.c
index 1ba0234cc60d..5aab734606ea 100644
--- a/drivers/staging/fieldbus/dev_core.c
+++ b/drivers/staging/fieldbus/dev_core.c
@@ -134,7 +134,7 @@ static struct attribute *fieldbus_attrs[] = {
static umode_t fieldbus_is_visible(struct kobject *kobj, struct attribute *attr,
int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct fieldbus_dev *fb = dev_get_drvdata(dev);
umode_t mode = attr->mode;
--
2.28.0
Powered by blists - more mailing lists