staging: fieldbus: use kobj_to_dev() to get device

Use kobj_to_dev() instead of container_of()

Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20201117025933.668938-1-dingxiang@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Ding Xiang 2020-11-17 10:59:33 +08:00 committed by Greg Kroah-Hartman
parent ba3e4a2a0b
commit 6b8fb5ecf7
1 changed files with 1 additions and 1 deletions

View File

@ -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;