forked from Minki/linux
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:
parent
ba3e4a2a0b
commit
6b8fb5ecf7
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user