Skip to contentSkip to conversation

libnvdimm/region: use kobj_to_dev()

PATCH New [email protected] 1 participant 1 message May 12, 2022 libnvdimm: non-volatile memory device

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libnvdimm/region: use kobj_to_dev()

From: Minghao Chi <[email protected]>

Use kobj_to_dev() instead of open-coding it.

---
 drivers/nvdimm/region_devs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvdimm/region_devs.c +1 -1
index 0cb274c2b508..d1bd82a3a500 100644
@@ -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