summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2020-09-01 11:27:17 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2020-09-01 12:06:08 +0300
commitfff15f23b8e74c2f969a5d25f29d0565e76e7137 (patch)
treed8dad6164a2865ed2ecd21f2f507b1a322331e75 /drivers/thunderbolt
parentf75aef392f869018f78cfedf3c320a6b3fcfda6b (diff)
downloadlinux-fff15f23b8e74c2f969a5d25f29d0565e76e7137.tar.xz
thunderbolt: Use kobj_to_dev() instead of container_of()
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>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r--drivers/thunderbolt/domain.c2
-rw-r--r--drivers/thunderbolt/switch.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c
index bba4cbfa9759..7a192b7ea85e 100644
--- a/drivers/thunderbolt/domain.c
+++ b/drivers/thunderbolt/domain.c
@@ -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) {
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 3845db569e4c..99effd6be3c1 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -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) {