[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220512011707.1621619-1-chi.minghao@zte.com.cn>
Date: Thu, 12 May 2022 01:17:07 +0000
From: cgel.zte@...il.com
To: dan.j.williams@...el.com
Cc: vishal.l.verma@...el.com, nvdimm@...ts.linux.dev,
linux-kernel@...r.kernel.org, Minghao Chi <chi.minghao@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] libnvdimm/region: use kobj_to_dev()
From: Minghao Chi <chi.minghao@....com.cn>
Use kobj_to_dev() instead of open-coding it.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
---
drivers/nvdimm/region_devs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
index 0cb274c2b508..d1bd82a3a500 100644
--- a/drivers/nvdimm/region_devs.c
+++ b/drivers/nvdimm/region_devs.c
@@ -720,7 +720,7 @@ REGION_MAPPING(31);
static umode_t mapping_visible(struct kobject *kobj, struct attribute *a, int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct nd_region *nd_region = to_nd_region(dev);
if (n < nd_region->ndr_mappings)
--
2.25.1
Powered by blists - more mailing lists