mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
misc: cxl: use kobj_to_dev()
Use kobj_to_dev() instead of open-coding it. Signed-off-by: Geliang Tang <[email protected]> Reviewed-by: Andrew Donnellan <[email protected]> Acked-by: Michael Ellerman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
092462c2b5
commit
85016ff33f
1 changed files with 2 additions and 3 deletions
|
|
@ -386,8 +386,7 @@ static ssize_t afu_eb_read(struct file *filp, struct kobject *kobj,
|
|||
struct bin_attribute *bin_attr, char *buf,
|
||||
loff_t off, size_t count)
|
||||
{
|
||||
struct cxl_afu *afu = to_cxl_afu(container_of(kobj,
|
||||
struct device, kobj));
|
||||
struct cxl_afu *afu = to_cxl_afu(kobj_to_dev(kobj));
|
||||
|
||||
return cxl_afu_read_err_buffer(afu, buf, off, count);
|
||||
}
|
||||
|
|
@ -467,7 +466,7 @@ static ssize_t afu_read_config(struct file *filp, struct kobject *kobj,
|
|||
loff_t off, size_t count)
|
||||
{
|
||||
struct afu_config_record *cr = to_cr(kobj);
|
||||
struct cxl_afu *afu = to_cxl_afu(container_of(kobj->parent, struct device, kobj));
|
||||
struct cxl_afu *afu = to_cxl_afu(kobj_to_dev(kobj->parent));
|
||||
|
||||
u64 i, j, val;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue