summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorYang Li <yang.lee@linux.alibaba.com>2021-02-23 12:12:24 +0300
committerOded Gabbay <ogabbay@kernel.org>2021-04-09 14:09:23 +0300
commitdd0a25c77a00e2b10d7520af31cfac949e51bbba (patch)
tree578469ed4647575db78ebbb1ba7a38f339c41e0c /drivers/misc
parent99cb017e728227f5c046a044a6acec088f68a1c8 (diff)
downloadlinux-dd0a25c77a00e2b10d7520af31cfac949e51bbba.tar.xz
habanalabs: Switch to using the new API kobj_to_dev()
fixed the following coccicheck: ./drivers/misc/habanalabs/common/sysfs.c:347:60-61: WARNING opportunity for kobj_to_dev() Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/habanalabs/common/sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/common/sysfs.c b/drivers/misc/habanalabs/common/sysfs.c
index 9bd13bdc1ba9..f37634cf8b65 100644
--- a/drivers/misc/habanalabs/common/sysfs.c
+++ b/drivers/misc/habanalabs/common/sysfs.c
@@ -344,7 +344,7 @@ static ssize_t eeprom_read_handler(struct file *filp, struct kobject *kobj,
struct bin_attribute *attr, char *buf, loff_t offset,
size_t max_size)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct hl_device *hdev = dev_get_drvdata(dev);
char *data;
int rc;