[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1614603535-24046-1-git-send-email-tiantao6@hisilicon.com>
Date: Mon, 1 Mar 2021 20:58:55 +0800
From: Tian Tao <tiantao6@...ilicon.com>
To: <zbr@...emap.net>, <rikard.falkeborn@...il.com>,
<gregkh@...uxfoundation.org>
CC: <linux-kernel@...r.kernel.org>
Subject: [PATCH] w1: ds2708 and ds2781 use the new API kobj_to_dev()
fix the below warnning:
/drivers/w1/slaves/w1_ds2780.c:93:60-61: WARNING opportunity for
kobj_to_dev()
Signed-off-by: Tian Tao <tiantao6@...ilicon.com>
---
drivers/w1/slaves/w1_ds2780.c | 3 ++-
drivers/w1/slaves/w1_ds2781.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2780.c b/drivers/w1/slaves/w1_ds2780.c
index c281fe5..3cde1bb 100644
--- a/drivers/w1/slaves/w1_ds2780.c
+++ b/drivers/w1/slaves/w1_ds2780.c
@@ -90,7 +90,8 @@ static ssize_t w1_slave_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf,
loff_t off, size_t count)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
+
return w1_ds2780_io(dev, buf, off, count, 0);
}
diff --git a/drivers/w1/slaves/w1_ds2781.c b/drivers/w1/slaves/w1_ds2781.c
index f0d393a..2cb7c02 100644
--- a/drivers/w1/slaves/w1_ds2781.c
+++ b/drivers/w1/slaves/w1_ds2781.c
@@ -87,7 +87,7 @@ static ssize_t w1_slave_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf,
loff_t off, size_t count)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
return w1_ds2781_io(dev, buf, off, count, 0);
}
--
2.7.4
Powered by blists - more mailing lists