]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
thunderbolt: Use kobj_to_dev() instead of container_of()
authorTian Tao <tiantao6@hisilicon.com>
Tue, 1 Sep 2020 08:27:17 +0000 (16:27 +0800)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 1 Sep 2020 09:06:08 +0000 (12:06 +0300)
Doesn't really matter for an individual driver, but it may
get coppied to lots more. I consider it's a little tidy up.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/domain.c
drivers/thunderbolt/switch.c

index bba4cbfa9759bf2b6fed9f9e7ad4e4ec51186926..7a192b7ea85e655497f6b554bd5d2925f8d266ab 100644 (file)
@@ -275,7 +275,7 @@ static struct attribute *domain_attrs[] = {
 static umode_t domain_attr_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 tb *tb = container_of(dev, struct tb, dev);
 
        if (attr == &dev_attr_boot_acl.attr) {
index 3845db569e4c4432f3f462cb2abfea7e979c35bb..99effd6be3c18eb80e96cf91acfcfc3d6d87408c 100644 (file)
@@ -1648,7 +1648,7 @@ static struct attribute *switch_attrs[] = {
 static umode_t switch_attr_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 tb_switch *sw = tb_to_switch(dev);
 
        if (attr == &dev_attr_device.attr) {