diff options
author | hailizheng <haili.zheng@powercore.com.cn> | 2020-05-19 08:25:19 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2020-05-22 06:28:38 -0700 |
commit | d06f9e6c8960d1b27245e3fe149c3a32a4894d4b (patch) | |
tree | ff7c59eb26695763f922c84d12653344e7ebe42d /drivers/hwmon | |
parent | 229d495d8189ae785dacee72e5633a58edc25ddf (diff) |
hwmon: (nct7802) Replace container_of() API
Replace container_of() API with kobj_to_dev().
Signed-off-by: hailizheng <haili.zheng@powercore.com.cn>
Link: https://lore.kernel.org/r/1589891119-16508-1-git-send-email-haili.zheng@powercore.com.cn
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/nct7802.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hwmon/nct7802.c b/drivers/hwmon/nct7802.c index 2e97e56c72c7..570df8eb5272 100644 --- a/drivers/hwmon/nct7802.c +++ b/drivers/hwmon/nct7802.c @@ -679,7 +679,7 @@ static struct attribute *nct7802_temp_attrs[] = { static umode_t nct7802_temp_is_visible(struct kobject *kobj, struct attribute *attr, int index) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct nct7802_data *data = dev_get_drvdata(dev); unsigned int reg; int err; @@ -778,7 +778,7 @@ static struct attribute *nct7802_in_attrs[] = { static umode_t nct7802_in_is_visible(struct kobject *kobj, struct attribute *attr, int index) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct nct7802_data *data = dev_get_drvdata(dev); unsigned int reg; int err; @@ -853,7 +853,7 @@ static struct attribute *nct7802_fan_attrs[] = { static umode_t nct7802_fan_is_visible(struct kobject *kobj, struct attribute *attr, int index) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct nct7802_data *data = dev_get_drvdata(dev); int fan = index / 4; /* 4 attributes per fan */ unsigned int reg; |