Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit28371cc

Browse files
Tian Taogregkh
Tian Tao
authored andcommitted
nvmem: core: Use kobj_to_dev() instead of container_of()
Use kobj_to_dev() instead of container_of()Signed-off-by: Tian Tao <tiantao6@hisilicon.com>Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>Link:https://lore.kernel.org/r/20200917134437.16637-3-srinivas.kandagatla@linaro.orgSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent8e2aeb5 commit28371cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎drivers/nvmem/core.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static ssize_t bin_attr_nvmem_read(struct file *filp, struct kobject *kobj,
128128
if (attr->private)
129129
dev=attr->private;
130130
else
131-
dev=container_of(kobj,structdevice,kobj);
131+
dev=kobj_to_dev(kobj);
132132
nvmem=to_nvmem_device(dev);
133133

134134
/* Stop the user from reading */
@@ -168,7 +168,7 @@ static ssize_t bin_attr_nvmem_write(struct file *filp, struct kobject *kobj,
168168
if (attr->private)
169169
dev=attr->private;
170170
else
171-
dev=container_of(kobj,structdevice,kobj);
171+
dev=kobj_to_dev(kobj);
172172
nvmem=to_nvmem_device(dev);
173173

174174
/* Stop the user from writing */
@@ -219,7 +219,7 @@ static umode_t nvmem_bin_attr_get_umode(struct nvmem_device *nvmem)
219219
staticumode_tnvmem_bin_attr_is_visible(structkobject*kobj,
220220
structbin_attribute*attr,inti)
221221
{
222-
structdevice*dev=container_of(kobj,structdevice,kobj);
222+
structdevice*dev=kobj_to_dev(kobj);
223223
structnvmem_device*nvmem=to_nvmem_device(dev);
224224

225225
returnnvmem_bin_attr_get_umode(nvmem);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp