* [PATCH] i2c: Use kobj_to_dev() API
@ 2020-09-17 3:08 Wang Qing
2020-09-21 9:15 ` Wolfram Sang
0 siblings, 1 reply; 2+ messages in thread
From: Wang Qing @ 2020-09-17 3:08 UTC (permalink / raw)
To: Wolfram Sang, linux-i2c, linux-kernel; +Cc: Wang Qing
Use kobj_to_dev() instead of container_of()
Signed-off-by: Wang Qing <wangqing@vivo.com>
---
include/linux/i2c.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index fc55ea4..5662265
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -344,7 +344,7 @@ const struct i2c_device_id *i2c_match_id(const struct i2c_device_id *id,
static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
{
- struct device * const dev = container_of(kobj, struct device, kobj);
+ struct device * const dev = kobj_to_dev(kobj);
return to_i2c_client(dev);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] i2c: Use kobj_to_dev() API
2020-09-17 3:08 [PATCH] i2c: Use kobj_to_dev() API Wang Qing
@ 2020-09-21 9:15 ` Wolfram Sang
0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2020-09-21 9:15 UTC (permalink / raw)
To: Wang Qing; +Cc: linux-i2c, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 283 bytes --]
On Thu, Sep 17, 2020 at 11:08:44AM +0800, Wang Qing wrote:
> Use kobj_to_dev() instead of container_of()
Correct. But same patch was already sent earlier:
http://patchwork.ozlabs.org/project/linux-i2c/patch/1600133898-35883-1-git-send-email-tiantao6@hisilicon.com/
Still thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-21 9:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-17 3:08 [PATCH] i2c: Use kobj_to_dev() API Wang Qing
2020-09-21 9:15 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).