Commit 6b8fb5ec authored by Ding Xiang's avatar Ding Xiang Committed by Greg Kroah-Hartman

staging: fieldbus: use kobj_to_dev() to get device

Use kobj_to_dev() instead of container_of()
Signed-off-by: default avatarDing Xiang <dingxiang@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20201117025933.668938-1-dingxiang@cmss.chinamobile.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ba3e4a2a
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment